Skip to content

Commit

Permalink
chore: migrate to eslint@9
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Nov 15, 2024
1 parent 1b33611 commit f6ebd11
Show file tree
Hide file tree
Showing 6 changed files with 2,389 additions and 1,160 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

20 changes: 0 additions & 20 deletions .eslintrc

This file was deleted.

107 changes: 107 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import bpmnIoPlugin from 'eslint-plugin-bpmn-io';

import typescriptPlugin from 'typescript-eslint';

const files = {
build: [
'*.js',
'*.mjs'
],
client: [
'src/client/**/*.ts',
'src/client/**/*.js'
],
test: [
'src/test/*/*.ts'
],
node_test: [
'src/test/*.ts'
],
ignored: [
'.vscode',
'.vscode-test',
'out'
]
};

export default [
{
'ignores': files.ignored
},
...bpmnIoPlugin.configs.recommended.map(config => {

return {
...config,
ignores: [
...files.build,
...files.node_test,
...files.client
]
};
}),
...bpmnIoPlugin.configs.browser.map(config => {

return {
...config,
files: files.client
};
}),
...bpmnIoPlugin.configs.node.map(config => {

return {
...config,
files: [
...files.build,
...files.node_test
]
};
}),
...bpmnIoPlugin.configs.mocha.map(config => {

return {
...config,
files: [
...files.test,
...files.node_test
]
};
}),
...typescriptPlugin.configs.recommended,
{
rules: {
'@typescript-eslint/no-explicit-any': [ 'warn', { 'ignoreRestArgs': true } ],
'@typescript-eslint/no-unused-vars': [
'error', {
'varsIgnorePattern': '^_',
'argsIgnorePattern': '^_'
}
]
},
languageOptions: {
parserOptions: {
tsconfigRootDir: import.meta.dirname
}
}
},
{
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-expressions': 'off'
},
files: [
...files.test,
...files.node_test
]
},
{
rules: {
'@typescript-eslint/no-require-imports': 'off'
},
files: [
...files.node_test
]
}
];
Loading

0 comments on commit f6ebd11

Please sign in to comment.