Skip to content

Commit

Permalink
chore: migrate to eslint@9
Browse files Browse the repository at this point in the history
  • Loading branch information
barmac authored and abdul99ahad committed Nov 5, 2024
1 parent 265e5d5 commit 0df2ffc
Show file tree
Hide file tree
Showing 39 changed files with 109 additions and 107 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

25 changes: 0 additions & 25 deletions .eslintrc

This file was deleted.

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

export default [
{
ignores: [
'**/lib',
'**/dist'
]
},
...bpmnIoPlugin.configs.browser.map(config => {
return {
...config,
files: [
'**/src/**/*.js'
]
};
}),
...bpmnIoPlugin.configs.jsx.map(config => {
return {
...config,
files: [
'**/src/**/*.js',
'**/test/**/*.js'
]
};
}),
...bpmnIoPlugin.configs.mocha.map(config => {
return {
...config,
files: [
'**/test/**/*.js'
]
};
}),
{
rules: {
'max-len': [ 'error', { 'code': 90 } ],
'no-restricted-imports': [ 'error', {
'patterns': [ 'dmn-js/src', 'dmn-js-*/src' ]
} ],
'react/display-name': 'off',
'react/no-deprecated': 'off',
'react/jsx-key': 'off', // TODO(@barmac): reenable and fix problems
'react/no-unknown-property': 'off',
}
}
];
18 changes: 11 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"cross-env": "^7.0.3",
"del-cli": "^6.0.0",
"eslint": "^9.0.0",
"eslint-plugin-bpmn-io": "^2.0.0",
"eslint-plugin-bpmn-io": "^2.0.2",
"karma": "^6.4.4",
"karma-chrome-launcher": "^3.2.0",
"karma-coverage": "^2.2.1",
Expand Down
3 changes: 0 additions & 3 deletions packages/dmn-js-boxed-expression/test/.eslintrc

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default class InputCell extends Component {
<th
data-col-id={ input.id }
onDoubleClick={ this.onClick }
onContextmenu={ this.onContextmenu }
onContextMenu={ this.onContextmenu }
className="input-cell input-editor"
style={ { width } }
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default class OutputCell extends Component {
<th
data-col-id={ output.id }
onDoubleClick={ this.onClick }
onContextmenu={ this.onContextmenu }
onContextMenu={ this.onContextmenu }
className="output-cell output-editor"
style={ { width } }
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const ISO_DATE_REGEX = /^\d{4}(?:-\d\d){2}$/;

// eslint-disable-next-line

const BETWEEN_DATE_REGEX = /^\[date\("([^"]*)"\)..date\("([^"]*)"\)\]$/;

// eslint-disable-next-line

const BEFORE_AFTER_DATE_REGEX = /^(<|>)\s*date\("([^"]*)"\)$/;

const EXACT_DATE_REGEX = /^date\("([^"]*)"\)$/;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const ISO_DATE_REGEX = /^\d{4}(?:-\d\d){2}T(?:\d\d:){2}\d\d(?:Z|(?:[@+-][^")]+))?$/;

// eslint-disable-next-line

const BETWEEN_DATE_REGEX = /^\[date and time\("([^"]*)"\)..date and time\("([^"]*)"\)\]$/;

// eslint-disable-next-line

const BEFORE_AFTER_DATE_REGEX = /^(<|>)\s*date and time\("([^"]*)"\)$/;

// eslint-disable-next-line

const EXACT_DATE_REGEX = /^date and time\("([^"]*)"\)$/;

const EXACT = 'exact',
Expand Down
3 changes: 0 additions & 3 deletions packages/dmn-js-decision-table/test/.eslintrc

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-next-line
import Inferno from 'inferno';

import { bootstrapModeler, inject } from 'test/helper';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-next-line
import Inferno from 'inferno';

import { bootstrapModeler, inject } from 'test/helper';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-next-line
import Inferno from 'inferno';

import { bootstrapModeler, inject } from 'test/helper';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ describe('DescriptorUtil', function() {
}));


it('should create Row descriptor', inject(function(elementRegistry) {
it('should create Col descriptor', inject(function(elementRegistry) {

// given
const col = elementRegistry.get('input1');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-next-line
import Inferno from 'inferno';

/* global sinon */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ describe('Modeling', function() {
}));


it('should undo', inject(function(modeling, commandStack) {
it('should redo', inject(function(modeling, commandStack) {

// given
var col = modeling.addCol({ type: 'dmn:OutputClause' }, 3);
Expand Down Expand Up @@ -250,7 +250,7 @@ describe('Modeling', function() {
}));


it('should undo', inject(function(modeling, sheet, commandStack) {
it('should redo', inject(function(modeling, sheet, commandStack) {

// given
var table = sheet.getRoot();
Expand Down Expand Up @@ -301,7 +301,7 @@ describe('Modeling', function() {
}));


it('should undo', inject(function(modeling, sheet, commandStack) {
it('should redo', inject(function(modeling, sheet, commandStack) {

// given
var table = sheet.getRoot();
Expand Down Expand Up @@ -356,7 +356,7 @@ describe('Modeling', function() {
}));


it('should undo', inject(function(modeling, sheet, commandStack) {
it('should redo', inject(function(modeling, sheet, commandStack) {

// given
var table = sheet.getRoot();
Expand Down Expand Up @@ -407,7 +407,7 @@ describe('Modeling', function() {
}));


it('should undo', inject(function(modeling, sheet, commandStack) {
it('should redo', inject(function(modeling, sheet, commandStack) {

// given
var table = sheet.getRoot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('IdChangeBehavior', function() {
}));


it('should update IDs on decision ID change', inject(function(modeling, sheet) {
it('should requirements refs on decision ID change', inject(function(modeling, sheet) {

// given
const root = sheet.getRoot(),
Expand Down Expand Up @@ -48,7 +48,7 @@ describe('IdChangeBehavior', function() {
}));


it('should update IDs on decision ID change', inject(function(modeling, sheet) {
it('should association refs on decision ID change', inject(function(modeling, sheet) {

// given
const root = sheet.getRoot(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ describe('simple date edit', function() {
// then
expect(inputEntry7.businessObject.text).to

// eslint-disable-next-line
.equal('[date("2018-01-25")..date("2000-01-01")]');
}));

Expand All @@ -175,7 +175,7 @@ describe('simple date edit', function() {
// then
expect(inputEntry7.businessObject.text).to

// eslint-disable-next-line
.equal('[date("2018-01-25")..date("foo")]');
}));

Expand All @@ -195,7 +195,7 @@ describe('simple date edit', function() {
// then
expect(inputEntry7.businessObject.text).to

// eslint-disable-next-line
.equal(`[date("2018-01-25")..date("${ getSampleDate() }")]`);
}));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe('simple date edit - utils', function() {
date: '2000-01-01'
}));

// eslint-disable-next-line
it('between', expectParsed('[date("2000-01-01")..date("2000-01-02")]', {
type: 'between',
dates: [ '2000-01-01', '2000-01-02' ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ describe('simple date time edit', function() {
// then
expect(inputEntry7.businessObject.text).to

// eslint-disable-next-line
.equal('[date and time("2018-01-25T00:00:00Z")..date and time("foo")]');
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ describe('simple string edit', function() {
}));


it('should override invalid custom value', inject(function(elementRegistry) {
it('should override invalid custom value (negate)', inject(function(elementRegistry) {

// given
const inputEntry3 = elementRegistry.get('inputEntry3');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ describe('simple time edit', function() {
// then
expect(inputEntry7.businessObject.text).to

// eslint-disable-next-line
.equal('[time("08:00:00Z")..time("18:00:00Z")]');
}));

Expand All @@ -175,7 +175,7 @@ describe('simple time edit', function() {
// then
expect(inputEntry7.businessObject.text).to

// eslint-disable-next-line
.equal('[time("08:00:00Z")..time("foo")]');
}));

Expand All @@ -195,7 +195,7 @@ describe('simple time edit', function() {
// then
expect(inputEntry7.businessObject.text).to

// eslint-disable-next-line
.equal(`[time("08:00:00Z")..time("${ getSampleTime() }")]`);
}));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ describe('simple time edit - utils', function() {
time: '08:00:00Z'
}));

// eslint-disable-next-line
it('between', expectParsed('[time("08:00:00Z")..time("08:00:00Z")]', {
type: 'between',
times: [ '08:00:00Z', '08:00:00Z' ]
Expand Down
3 changes: 0 additions & 3 deletions packages/dmn-js-drd/test/.eslintrc

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ describe('features/rules', function() {
});


describe('move', function() {
describe('move decision', function() {

it('decision -> definitions', inject(
function(drdRules, elementRegistry) {
Expand Down
3 changes: 0 additions & 3 deletions packages/dmn-js-literal-expression/test/.eslintrc

This file was deleted.

Loading

0 comments on commit 0df2ffc

Please sign in to comment.