Skip to content

Commit

Permalink
chore: simplify eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Oct 16, 2024
1 parent 7eb762d commit cfab33a
Showing 1 changed file with 41 additions and 17 deletions.
58 changes: 41 additions & 17 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,45 @@ import bpmnIoPlugin from 'eslint-plugin-bpmn-io';
import reactHooks from 'eslint-plugin-react-hooks';
import eslintImport from 'eslint-plugin-import';

const buildScripts = [ '*.js', '*.mjs' ];
const files = {
build: [
'*.js',
'*.mjs'
],
test: [
'test/**/*.js'
],
ignored: [
'preact',
'dist'
]
};


export default [
{
ignores: [ 'preact', 'dist' ],
ignores: files.ignored,
},
...bpmnIoPlugin.configs.browser,
...bpmnIoPlugin.configs.jsx,
...bpmnIoPlugin.configs.mocha.map(config => {

// build
...bpmnIoPlugin.configs.node.map(config => {
return {
...config,
files: [
'test/**/*.js'
]
files: files.build
};
}),
...bpmnIoPlugin.configs.node.map(config => {

// lib + test
...bpmnIoPlugin.configs.browser.map(config => {
return {
...config,
ignores: files.build
};
}),
...bpmnIoPlugin.configs.jsx.map(config => {
return {
...config,
files: [
...buildScripts,
'test/**/*.js'
]
ignores: files.build
};
}),
{
Expand All @@ -42,14 +58,22 @@ export default [
'react/no-unknown-property': 'off',
},
},

// test
...bpmnIoPlugin.configs.mocha.map(config => {
return {
...config,
files: files.test
};
}),
{
languageOptions: {
globals: {
sinon: true
sinon: true,
require: true,
global: true
},
},
files: [
'test/**/*.js'
]
files: files.test
}
];

0 comments on commit cfab33a

Please sign in to comment.