From cc53eb4346ef7acd2048125f67d1f228517d2e98 Mon Sep 17 00:00:00 2001 From: Philipp Fromme Date: Fri, 11 Oct 2024 14:39:17 +0200 Subject: [PATCH] chore: migrate to ESLint 9 --- .eslintrc | 5 ----- eslint.config.mjs | 22 +++++++++++++++++++ karma.config.js | 2 -- package-lock.json | 9 ++++++-- package.json | 4 ++-- test/.eslintrc | 4 ---- test/camunda-cloud/CopyPasteBehaviorSpec.js | 14 ++++++------ .../UpdateInputOutputBehaviorSpec.js | 2 +- 8 files changed, 39 insertions(+), 23 deletions(-) delete mode 100644 .eslintrc create mode 100644 eslint.config.mjs delete mode 100644 test/.eslintrc diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index fbce297..0000000 --- a/.eslintrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": [ - "plugin:bpmn-io/browser" - ] -} \ No newline at end of file diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..1d9fc01 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,22 @@ +import bpmnIoPlugin from 'eslint-plugin-bpmn-io'; + +export default [ + ...bpmnIoPlugin.configs.browser.map((config) => { + return { + ...config, + files: [ 'lib/**/*.js' ] + }; + }), + ...bpmnIoPlugin.configs.node.map((config) => { + return { + ...config, + files: [ 'karma.config.js' ] + }; + }), + ...bpmnIoPlugin.configs.mocha.map((config) => { + return { + ...config, + files: [ 'test/**/*.js' ] + }; + }) +]; \ No newline at end of file diff --git a/karma.config.js b/karma.config.js index f07a35a..c63cb2d 100644 --- a/karma.config.js +++ b/karma.config.js @@ -1,5 +1,3 @@ -/* eslint-env node */ - var path = require('path'); var singleStart = process.env.SINGLE_START; diff --git a/package-lock.json b/package-lock.json index 9886112..35e78c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,8 +20,8 @@ "camunda-bpmn-moddle": "^7.0.1", "chai": "^4.4.1", "cross-env": "^7.0.3", - "eslint": "^9.0.0", - "eslint-plugin-bpmn-io": "^2.0.0", + "eslint": "^9.12.0", + "eslint-plugin-bpmn-io": "^2.0.2", "execa": "^8.0.0", "karma": "^6.4.2", "karma-chai": "^0.1.0", @@ -2900,6 +2900,7 @@ "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.12.0.tgz", "integrity": "sha512-UVIOlTEWxwIopRL1wgSQYdnVDcEvs2wyaO6DGo5mXqe3r16IoCNWkR29iHhyaP4cICWjbgbmFUGAhh0GJRuGZw==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.11.0", @@ -2960,6 +2961,10 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-bpmn-io/-/eslint-plugin-bpmn-io-2.0.2.tgz", "integrity": "sha512-DiRhVFg+uPDn2WNC0pc2/BV8AtCPFz46SXetnLwLsFr+PbPQ70Py57kT8zAY/mbuAh39AXpABUz7J4hkq6N0WQ==", "dev": true, + "license": "MIT", + "workspaces": [ + "test" + ], "dependencies": { "eslint-plugin-mocha": "^10.5.0", "eslint-plugin-react": "^7.35.0", diff --git a/package.json b/package.json index 145e05a..a639061 100644 --- a/package.json +++ b/package.json @@ -44,8 +44,8 @@ "camunda-bpmn-moddle": "^7.0.1", "chai": "^4.4.1", "cross-env": "^7.0.3", - "eslint": "^9.0.0", - "eslint-plugin-bpmn-io": "^2.0.0", + "eslint": "^9.12.0", + "eslint-plugin-bpmn-io": "^2.0.2", "execa": "^8.0.0", "karma": "^6.4.2", "karma-chai": "^0.1.0", diff --git a/test/.eslintrc b/test/.eslintrc deleted file mode 100644 index 646337e..0000000 --- a/test/.eslintrc +++ /dev/null @@ -1,4 +0,0 @@ - -{ - "extends": "plugin:bpmn-io/mocha" -} \ No newline at end of file diff --git a/test/camunda-cloud/CopyPasteBehaviorSpec.js b/test/camunda-cloud/CopyPasteBehaviorSpec.js index 1e0edfd..fb4b6d2 100644 --- a/test/camunda-cloud/CopyPasteBehaviorSpec.js +++ b/test/camunda-cloud/CopyPasteBehaviorSpec.js @@ -790,7 +790,7 @@ describe('CopyPasteBehavior', function() { describe('timeCycle', function() { - it('should allow to copy to non-interrupting timer boundary event', function() { + it('should allow to copy to non-interrupting timer boundary event (start event)', function() { // given const timerEventDefinition = moddle.create('bpmn:TimerEventDefinition'), @@ -809,7 +809,7 @@ describe('CopyPasteBehavior', function() { }); - it('should NOT allow to copy to non-interrupting timer boundary event', function() { + it('should NOT allow to copy to non-interrupting timer boundary event (intermediate catch event)', function() { // given const timerEventDefinition = moddle.create('bpmn:TimerEventDefinition'), @@ -912,7 +912,7 @@ describe('CopyPasteBehavior', function() { describe('timeDate', function() { - it('should allow to copy to non-interrupting timer boundary event', function() { + it('should allow to copy to non-interrupting timer boundary event (start event)', function() { // given const timerEventDefinition = moddle.create('bpmn:TimerEventDefinition'), @@ -931,7 +931,7 @@ describe('CopyPasteBehavior', function() { }); - it('should allow to copy to non-interrupting timer boundary event', function() { + it('should allow to copy to non-interrupting timer boundary event (intermediate catch event)', function() { // given const timerEventDefinition = moddle.create('bpmn:TimerEventDefinition'), @@ -969,7 +969,7 @@ describe('CopyPasteBehavior', function() { }); - it('should allow to copy to non-interrupting timer boundary event', function() { + it('should allow to copy to non-interrupting timer boundary event (boundary event)', function() { // given const timerEventDefinition = moddle.create('bpmn:TimerEventDefinition'), @@ -1053,7 +1053,7 @@ describe('CopyPasteBehavior', function() { }); - it('should allow to copy to non-interrupting timer boundary event', function() { + it('should allow to copy to non-interrupting timer boundary event (intermediate catch event)', function() { // given const timerEventDefinition = moddle.create('bpmn:TimerEventDefinition'), @@ -1091,7 +1091,7 @@ describe('CopyPasteBehavior', function() { }); - it('should allow to copy to non-interrupting timer boundary event', function() { + it('should allow to copy to non-interrupting timer boundary event (boundary event)', function() { // given const timerEventDefinition = moddle.create('bpmn:TimerEventDefinition'), diff --git a/test/camunda-platform/UpdateInputOutputBehaviorSpec.js b/test/camunda-platform/UpdateInputOutputBehaviorSpec.js index ce3cb8f..6b20a7a 100644 --- a/test/camunda-platform/UpdateInputOutputBehaviorSpec.js +++ b/test/camunda-platform/UpdateInputOutputBehaviorSpec.js @@ -65,7 +65,7 @@ describe('camunda-platform/features/modeling - UpdateInputOutputBehavior', funct }); - describe('remove camunda:InputOuput when removing camunda:InputParameter', function() { + describe('remove camunda:InputOuput when removing camunda:OutputParameter', function() { let businessObject;