diff --git a/eslint.config.mjs b/eslint.config.mjs index 474b4f06..d6aed4b4 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,35 +1,49 @@ import bpmnIoPlugin from 'eslint-plugin-bpmn-io'; +const files = { + build: [ + '*.mjs', + '*.js', + 'packages/*/*.mjs', + 'packages/*/*.mjs', + 'packages/*/*.js', + 'tasks/*.mjs', + 'packages/*/tasks/*.mjs', + 'packages/dmn-js/test/distro/karma.conf.js' + ], + test: [ + '**/test/**/*.js' + ], + ignored: [ + '**/lib', + '**/dist' + ] +}; + export default [ { - ignores: [ - '**/lib', - '**/dist' - ] + ignores: files.ignored }, - ...bpmnIoPlugin.configs.browser.map(config => { + + // build + ...bpmnIoPlugin.configs.node.map(config => { return { ...config, - files: [ - '**/src/**/*.js' - ] + files: files.build }; }), - ...bpmnIoPlugin.configs.jsx.map(config => { + + // lib + test + ...bpmnIoPlugin.configs.browser.map(config => { return { ...config, - files: [ - '**/src/**/*.js', - '**/test/**/*.js' - ] + ignores: files.build }; }), - ...bpmnIoPlugin.configs.mocha.map(config => { + ...bpmnIoPlugin.configs.jsx.map(config => { return { ...config, - files: [ - '**/test/**/*.js' - ] + ignores: files.build }; }), { @@ -42,6 +56,23 @@ export default [ 'react/no-deprecated': 'off', 'react/jsx-key': 'off', // TODO(@barmac): reenable and fix problems 'react/no-unknown-property': 'off', - } + }, + ignores: files.build + }, + + // test + ...bpmnIoPlugin.configs.mocha.map(config => { + return { + ...config, + files: files.test + }; + }), + { + languageOptions: { + globals: { + require: true + } + }, + files: files.test } ]; diff --git a/package.json b/package.json index 8f12f7b2..c31b0864 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "build": "lerna run build --parallel --stream", "lerna-publish": "lerna publish -m \"chore(project): publish %s\"", "lint": "run-s lint:*", - "lint:js": "eslint packages", + "lint:js": "eslint .", "lint:style": "stylelint \"packages/**/*.css\"", "reinstall": "npm ci", "release": "run-s distro test \"lerna-publish -- {@}\" --", diff --git a/packages/dmn-js-decision-table/test/spec/ViewerSpec.js b/packages/dmn-js-decision-table/test/spec/ViewerSpec.js index a9162081..8106a0d5 100644 --- a/packages/dmn-js-decision-table/test/spec/ViewerSpec.js +++ b/packages/dmn-js-decision-table/test/spec/ViewerSpec.js @@ -30,6 +30,7 @@ describe('DecisionTable', function() { let dmnJS; + // eslint-disable-next-line no-constant-binary-expression false && afterEach(function() { if (dmnJS) { dmnJS.destroy(); diff --git a/packages/dmn-js-decision-table/test/spec/features/context-menu/ContextMenuCloseBehaviorSpec.js b/packages/dmn-js-decision-table/test/spec/features/context-menu/ContextMenuCloseBehaviorSpec.js index 450b984a..c4b84655 100644 --- a/packages/dmn-js-decision-table/test/spec/features/context-menu/ContextMenuCloseBehaviorSpec.js +++ b/packages/dmn-js-decision-table/test/spec/features/context-menu/ContextMenuCloseBehaviorSpec.js @@ -1,6 +1,3 @@ - -import Inferno from 'inferno'; - import { bootstrapModeler, inject } from 'test/helper'; import { diff --git a/packages/dmn-js-decision-table/test/spec/features/context-menu/ContextMenuKeyboardSpec.js b/packages/dmn-js-decision-table/test/spec/features/context-menu/ContextMenuKeyboardSpec.js index 8408697c..aa39fec3 100644 --- a/packages/dmn-js-decision-table/test/spec/features/context-menu/ContextMenuKeyboardSpec.js +++ b/packages/dmn-js-decision-table/test/spec/features/context-menu/ContextMenuKeyboardSpec.js @@ -1,6 +1,3 @@ - -import Inferno from 'inferno'; - import { bootstrapModeler, inject } from 'test/helper'; import { diff --git a/packages/dmn-js-decision-table/test/spec/features/context-menu/ContextMenuSpec.js b/packages/dmn-js-decision-table/test/spec/features/context-menu/ContextMenuSpec.js index f80b5d3f..8e1117c3 100644 --- a/packages/dmn-js-decision-table/test/spec/features/context-menu/ContextMenuSpec.js +++ b/packages/dmn-js-decision-table/test/spec/features/context-menu/ContextMenuSpec.js @@ -1,6 +1,3 @@ - -import Inferno from 'inferno'; - import { bootstrapModeler, inject } from 'test/helper'; import { diff --git a/packages/dmn-js-decision-table/test/spec/features/drag-and-drop/DragAndDropSpec.js b/packages/dmn-js-decision-table/test/spec/features/drag-and-drop/DragAndDropSpec.js index 8820b13d..154b24f1 100644 --- a/packages/dmn-js-decision-table/test/spec/features/drag-and-drop/DragAndDropSpec.js +++ b/packages/dmn-js-decision-table/test/spec/features/drag-and-drop/DragAndDropSpec.js @@ -1,6 +1,3 @@ - -import Inferno from 'inferno'; - /* global sinon */ import { bootstrapModeler, inject } from 'test/helper'; diff --git a/packages/dmn-js-decision-table/test/spec/features/simple-date-edit/SimpleDateEditSpec.js b/packages/dmn-js-decision-table/test/spec/features/simple-date-edit/SimpleDateEditSpec.js index 7187a983..a8358795 100644 --- a/packages/dmn-js-decision-table/test/spec/features/simple-date-edit/SimpleDateEditSpec.js +++ b/packages/dmn-js-decision-table/test/spec/features/simple-date-edit/SimpleDateEditSpec.js @@ -155,7 +155,7 @@ describe('simple date edit', function() { // then expect(inputEntry7.businessObject.text).to - + .equal('[date("2018-01-25")..date("2000-01-01")]'); })); @@ -175,7 +175,7 @@ describe('simple date edit', function() { // then expect(inputEntry7.businessObject.text).to - + .equal('[date("2018-01-25")..date("foo")]'); })); @@ -195,7 +195,7 @@ describe('simple date edit', function() { // then expect(inputEntry7.businessObject.text).to - + .equal(`[date("2018-01-25")..date("${ getSampleDate() }")]`); })); }); diff --git a/packages/dmn-js-decision-table/test/spec/features/simple-date-edit/UtilsSpec.js b/packages/dmn-js-decision-table/test/spec/features/simple-date-edit/UtilsSpec.js index 28330830..e6192432 100644 --- a/packages/dmn-js-decision-table/test/spec/features/simple-date-edit/UtilsSpec.js +++ b/packages/dmn-js-decision-table/test/spec/features/simple-date-edit/UtilsSpec.js @@ -96,7 +96,7 @@ describe('simple date edit - utils', function() { date: '2000-01-01' })); - + it('between', expectParsed('[date("2000-01-01")..date("2000-01-02")]', { type: 'between', dates: [ '2000-01-01', '2000-01-02' ] diff --git a/packages/dmn-js-decision-table/test/spec/features/simple-date-time-edit/SimpleDateTimeEditSpec.js b/packages/dmn-js-decision-table/test/spec/features/simple-date-time-edit/SimpleDateTimeEditSpec.js index 6f2029e2..ecec65dc 100644 --- a/packages/dmn-js-decision-table/test/spec/features/simple-date-time-edit/SimpleDateTimeEditSpec.js +++ b/packages/dmn-js-decision-table/test/spec/features/simple-date-time-edit/SimpleDateTimeEditSpec.js @@ -175,7 +175,7 @@ describe('simple date time edit', function() { // then expect(inputEntry7.businessObject.text).to - + .equal('[date and time("2018-01-25T00:00:00Z")..date and time("foo")]'); })); diff --git a/packages/dmn-js-decision-table/test/spec/features/simple-time-edit/SimpleTimeEditSpec.js b/packages/dmn-js-decision-table/test/spec/features/simple-time-edit/SimpleTimeEditSpec.js index ad8b9ad3..7eef47ad 100644 --- a/packages/dmn-js-decision-table/test/spec/features/simple-time-edit/SimpleTimeEditSpec.js +++ b/packages/dmn-js-decision-table/test/spec/features/simple-time-edit/SimpleTimeEditSpec.js @@ -155,7 +155,7 @@ describe('simple time edit', function() { // then expect(inputEntry7.businessObject.text).to - + .equal('[time("08:00:00Z")..time("18:00:00Z")]'); })); @@ -175,7 +175,7 @@ describe('simple time edit', function() { // then expect(inputEntry7.businessObject.text).to - + .equal('[time("08:00:00Z")..time("foo")]'); })); @@ -195,7 +195,7 @@ describe('simple time edit', function() { // then expect(inputEntry7.businessObject.text).to - + .equal(`[time("08:00:00Z")..time("${ getSampleTime() }")]`); })); }); diff --git a/packages/dmn-js-decision-table/test/spec/features/simple-time-edit/UtilsSpec.js b/packages/dmn-js-decision-table/test/spec/features/simple-time-edit/UtilsSpec.js index 52d8c3d2..804bd3d2 100644 --- a/packages/dmn-js-decision-table/test/spec/features/simple-time-edit/UtilsSpec.js +++ b/packages/dmn-js-decision-table/test/spec/features/simple-time-edit/UtilsSpec.js @@ -124,7 +124,7 @@ describe('simple time edit - utils', function() { time: '08:00:00Z' })); - + it('between', expectParsed('[time("08:00:00Z")..time("08:00:00Z")]', { type: 'between', times: [ '08:00:00Z', '08:00:00Z' ] diff --git a/packages/dmn-js-shared/test/spec/components/ValidatedInputSpec.js b/packages/dmn-js-shared/test/spec/components/ValidatedInputSpec.js index c012dddb..f1c03a37 100644 --- a/packages/dmn-js-shared/test/spec/components/ValidatedInputSpec.js +++ b/packages/dmn-js-shared/test/spec/components/ValidatedInputSpec.js @@ -10,7 +10,7 @@ import { import { triggerInputEvent } from 'test/util/EventUtil'; - + import ValidatedInput from 'src/components/ValidatedInput';