Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Housekeeping #192

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite unexpected 🐍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is unexpected there? Tests simply contain parts that are node, and parts that are client.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Happy to follow-up if there is stuff we can improve).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snake_case, sorry for unclear comment

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok 🐍 Now I got your emoji.

'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
Loading