Skip to content

Commit

Permalink
WIP: migrate to eslint@9
Browse files Browse the repository at this point in the history
  • Loading branch information
barmac committed Oct 11, 2024
1 parent e32332d commit 9c1e406
Show file tree
Hide file tree
Showing 25 changed files with 94 additions and 50 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

43 changes: 43 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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': [ 2, { 'code': 90 } ],
'no-restricted-imports': [ 2, {
'patterns': [ 'dmn-js/src', 'dmn-js-*/src' ]
} ]
}
}
];
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
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
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
@@ -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 @@ -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 @@ -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
6 changes: 3 additions & 3 deletions packages/dmn-js-shared/src/components/ContentEditable.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,14 @@ export default class ContentEditable extends Component {
tabIndex="0"
className={ this.getClassName() }
contentEditable="true"
spellcheck="false"
spellCheck="false"
data-placeholder={ placeholder || '' }
onInput={ this.onInput }
onKeypress={ this.onKeypress }
onKeyPress={ this.onKeypress }
onPaste={ this.onPaste }
onFocus={ this.onFocus }
onBlur={ this.onBlur }
onKeydown={ this.onKeydown }
onKeyDown={ this.onKeydown }
ref={ node => this.node = node }
dangerouslySetInnerHTML={ { __html: value } }></div>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/dmn-js-shared/src/components/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default class Input extends Component {
onInput={ this.onInput }
onKeyDown={ this.onKeyDown }
onKeyUp={ this.onKeyUp }
spellcheck="false"
spellCheck="false"
type={ type || 'text' }
value={ value }
id={ id } />
Expand Down
4 changes: 2 additions & 2 deletions packages/dmn-js-shared/src/components/InputSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ export default class InputSelect extends Component {
<div
aria-label={ inputLabel }
className="dms-input"
tabindex="0"
tabIndex="0"
onKeyDown={ this.onKeyDown }
ref={ node => this.inputNode = node }
>{ label }</div>
Expand All @@ -354,7 +354,7 @@ export default class InputSelect extends Component {
className="dms-input"
onInput={ this.onInput }
onKeyDown={ this.onKeyDown }
spellcheck="false"
spellCheck="false"
ref={ node => this.inputNode = node }
type="text"
value={ value }
Expand Down
2 changes: 1 addition & 1 deletion packages/dmn-js-shared/src/components/ValidatedInput.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component } from 'inferno';

// eslint-disable-next-line

import Input from './Input';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/dmn-js-shared/test/spec/base/ManagerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ describe('Manager', function() {
});


it('should emit <import.done> when diagram clear fails', async () => {
it('should emit <import.done> when diagram clear fails', async function() {

// given
class ClearErrorView extends TestView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {

import { triggerInputEvent } from 'test/util/EventUtil';

// eslint-disable-next-line
import ValidatedInput from 'src/components/ValidatedInput';


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const DEFAULT_DATA_TYPES = [

describe('DataTypes', function() {

it('should set default data types', () => {
it('should set default data types', function() {

// given
const dataTypes = createDataTypes();
Expand All @@ -31,7 +31,7 @@ describe('DataTypes', function() {
});


it('should read data types from config', () => {
it('should read data types from config', function() {

// given
const dataTypes = createDataTypes({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ const CUSTOM_OPTIONS = [ {

describe('ExpressionLanguages', function() {

describe('defaults', () => {
describe('defaults', function() {

it('should set default editor expression language to FEEL', () => {
it('should set default editor expression language to FEEL', function() {

// given
const expressionLanguages = createExpressionLanguages();
Expand All @@ -49,7 +49,7 @@ describe('ExpressionLanguages', function() {
});


it('should set default input cell expression language to FEEL', () => {
it('should set default input cell expression language to FEEL', function() {

// given
const expressionLanguages = createExpressionLanguages();
Expand All @@ -65,7 +65,7 @@ describe('ExpressionLanguages', function() {
});


it('should use user provided defaults', () => {
it('should use user provided defaults', function() {

// given
const expressionLanguages = createExpressionLanguages({
Expand Down Expand Up @@ -94,7 +94,7 @@ describe('ExpressionLanguages', function() {
});


it('should support legacy defaults', () => {
it('should support legacy defaults', function() {

// given
const expressionLanguages = createExpressionLanguages({
Expand Down Expand Up @@ -122,9 +122,9 @@ describe('ExpressionLanguages', function() {
});


describe('options', () => {
describe('options', function() {

it('should correctly set default options', () => {
it('should correctly set default options', function() {

// given
const expressionLanguages = createExpressionLanguages();
Expand All @@ -137,7 +137,7 @@ describe('ExpressionLanguages', function() {
});


it('should use provided options', () => {
it('should use provided options', function() {

// given
const expressionLanguages = createExpressionLanguages({
Expand Down

0 comments on commit 9c1e406

Please sign in to comment.