Skip to content

Commit 2bb6439

Browse files
authored
Update Eslint to 9 version (DevExpress#28951)
Co-authored-by: Alyar <>
1 parent 60f5de4 commit 2bb6439

File tree

181 files changed

+2390
-1677
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+2390
-1677
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -16,51 +16,6 @@ env:
1616
NX_SKIP_NX_CACHE: ${{ (github.event_name != 'pull_request' || contains( github.event.pull_request.labels.*.name, 'skip-cache')) && 'true' || 'false' }}
1717

1818
jobs:
19-
Renovation:
20-
runs-on: devextreme-shr2
21-
timeout-minutes: 60
22-
steps:
23-
- name: Get sources
24-
uses: actions/checkout@v4
25-
26-
- name: Use Node.js
27-
uses: actions/setup-node@v4
28-
with:
29-
node-version: '20'
30-
31-
- uses: pnpm/action-setup@v3
32-
with:
33-
version: 9
34-
run_install: false
35-
36-
- name: Get pnpm store directory
37-
shell: bash
38-
run: |
39-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
40-
41-
- uses: actions/cache@v4
42-
name: Setup pnpm cache
43-
with:
44-
path: |
45-
${{ env.STORE_PATH }}
46-
.nx/cache
47-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
48-
restore-keys: |
49-
${{ runner.os }}-pnpm-store
50-
51-
- name: Install dependencies
52-
run: pnpm install
53-
54-
- name: Compile renovation
55-
working-directory: ./packages/devextreme
56-
run: |
57-
pnpx nx compile:r
58-
# Remove package install after upgrade to TypeScript >= 4.6
59-
60-
- name: Lint renovation
61-
working-directory: ./packages/devextreme
62-
run: pnpx nx lint-renovation
63-
6419
TS:
6520
runs-on: devextreme-shr2
6621
timeout-minutes: 60
@@ -380,7 +335,7 @@ jobs:
380335
notify:
381336
runs-on: devextreme-shr2
382337
name: Send notifications
383-
needs: [Renovation, TS, JS, CSS, texts, pnpm_lock, component_exports]
338+
needs: [TS, JS, CSS, texts, pnpm_lock, component_exports]
384339
if: github.event_name != 'pull_request' && contains(needs.*.result, 'failure')
385340

386341
steps:

.lintstagedrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"**/*.{css,scss}": "stylelint",
3-
"packages/devextreme/**/*.{js,ts,tsx}": "eslint --quiet"
2+
"**/*.{css,scss}": "stylelint"
43
}

apps/demos/package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
"devDependencies": {
9292
"@angular/platform-server": "17.3.12",
9393
"@babel/core": "7.23.9",
94-
"@babel/eslint-parser": "7.23.10",
9594
"@babel/preset-env": "7.23.9",
9695
"@rollup/plugin-babel": "6.0.4",
9796
"@rollup/plugin-node-resolve": "15.2.3",
@@ -102,18 +101,23 @@
102101
"@types/react": "17.0.2",
103102
"@types/react-dom": "17.0.2",
104103
"@types/yargs": "17.0.32",
105-
"@typescript-eslint/parser": "5.62.0",
106104
"@vue/eslint-config-typescript": "12.0.0",
107105
"axe-core": "4.10.2",
108106
"babel-jest": "29.7.0",
109107
"consola": "3.2.3",
110108
"cookie-parser": "1.4.6",
111109
"cross-env": "7.0.3",
112110
"devextreme-screenshot-comparer": "2.0.17",
113-
"eslint": "8.56.0",
114111
"eslint-plugin-deprecation": "2.0.0",
115112
"eslint-plugin-react": "7.33.2",
116113
"eslint-plugin-react-perf": "3.3.2",
114+
"eslint": "catalog:eslint8",
115+
"eslint-config-airbnb-typescript": "catalog:eslint8",
116+
"eslint-plugin-import": "catalog:eslint8",
117+
"@babel/eslint-parser": "catalog:eslint8",
118+
"@typescript-eslint/eslint-plugin": "catalog:eslint8",
119+
"@typescript-eslint/parser": "catalog:eslint8",
120+
"eslint-plugin-no-only-tests": "catalog:eslint8",
117121
"express": "4.21.1",
118122
"glob": "10.4.5",
119123
"gulp": "4.0.2",

e2e/.eslintrc.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

e2e/.eslintrc.js

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
/* eslint-env node */
2+
/* eslint-disable spellcheck/spell-checker */
3+
module.exports = {
4+
extends: ['devextreme/spell-check'],
5+
root: true,
6+
plugins: ['no-only-tests', 'i18n'],
7+
overrides: [
8+
{
9+
files: ['*.js'],
10+
parser: '@babel/eslint-parser',
11+
parserOptions: { 'requireConfigFile': false },
12+
extends: [
13+
// TODO: We're ready to move on to our linter.
14+
// 'devextreme/javascript',
15+
'eslint:recommended',
16+
'plugin:import/recommended',
17+
],
18+
env: { es6: true },
19+
globals: {
20+
'setInterval': true,
21+
'setTimeout': true,
22+
'clearInterval': true,
23+
'clearTimeout': true,
24+
'require': true,
25+
'module': true,
26+
'exports': true
27+
},
28+
rules: {
29+
'i18n/no-russian-character': ['error', { 'includeIdentifier': true }],
30+
'block-spacing': 'error',
31+
'comma-spacing': 'error',
32+
'computed-property-spacing': 'error',
33+
'comma-style': ['error', 'last'],
34+
'eqeqeq': ['error', 'allow-null'],
35+
'strict': 'error',
36+
'func-call-spacing': 'error',
37+
'key-spacing': 'error',
38+
'keyword-spacing': [
39+
'error',
40+
{
41+
'overrides': {
42+
'catch': {
43+
'after': false,
44+
},
45+
'for': {
46+
'after': false,
47+
},
48+
'if': {
49+
'after': false,
50+
},
51+
'switch': {
52+
'after': false,
53+
},
54+
'while': {
55+
'after': false,
56+
},
57+
},
58+
},
59+
],
60+
'no-multiple-empty-lines': ['error', { max: 2 }],
61+
'no-multi-spaces': 'error',
62+
'no-trailing-spaces': 'error',
63+
'no-empty': ['error', { allowEmptyCatch: true }],
64+
'no-new-func': 'error',
65+
'no-eval': 'error',
66+
'no-undef-init': 'error',
67+
'no-unused-vars': ['error', { args: 'none', ignoreRestSiblings: true }],
68+
'no-extend-native': 'error',
69+
'no-alert': 'error',
70+
'no-console': 'error',
71+
'no-restricted-syntax': ['error', 'ForOfStatement'],
72+
'no-var': 'error',
73+
'no-whitespace-before-property': 'error',
74+
'object-curly-spacing': ['error', 'always'],
75+
'one-var': ['error', 'never'],
76+
'prefer-const': 'error',
77+
'semi-spacing': 'error',
78+
'semi': 'error',
79+
'space-before-blocks': 'error',
80+
'space-before-function-paren': ['error', 'never'],
81+
'space-in-parens': 'error',
82+
'space-infix-ops': 'error',
83+
'space-unary-ops': 'error',
84+
'spaced-comment': [
85+
'error',
86+
'always',
87+
{
88+
'exceptions': [
89+
'#DEBUG',
90+
'#ENDDEBUG',
91+
],
92+
'markers': [
93+
'/',
94+
],
95+
},
96+
],
97+
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
98+
'curly': ['error', 'multi-line', 'consistent'],
99+
'unicode-bom': ['error', 'never'],
100+
'eol-last': ['error', 'always'],
101+
'indent': [
102+
'error',
103+
4,
104+
{
105+
'SwitchCase': 1,
106+
'MemberExpression': 1,
107+
'CallExpression': {
108+
'arguments': 1,
109+
},
110+
},
111+
],
112+
'quotes': ['error', 'single'],
113+
'import/named': 2,
114+
'import/default': 2,
115+
'import/no-duplicates': 2,
116+
}
117+
},
118+
{
119+
files: ['**/*.ts?(x)'],
120+
excludedFiles: ['*.d.ts'],
121+
parser: '@typescript-eslint/parser',
122+
parserOptions: {
123+
createDefaultProgram: true,
124+
project: './tsconfig.json',
125+
tsconfigRootDir: __dirname,
126+
ecmaVersion: 6,
127+
sourceType: 'module',
128+
},
129+
extends: ['devextreme/typescript'],
130+
rules: {
131+
'prefer-regex-literals': 'off',
132+
'i18n/no-russian-character': ['error', { 'includeIdentifier': true }],
133+
}
134+
},
135+
{
136+
files: [ '*.d.ts' ],
137+
excludedFiles: 'js/renovation/**/*.d.ts',
138+
parser: '@typescript-eslint/parser',
139+
parserOptions: {
140+
createDefaultProgram: true,
141+
project: './tsconfig.json',
142+
tsconfigRootDir: __dirname,
143+
ecmaVersion: 6,
144+
sourceType: 'module',
145+
ecmaFeatures: {
146+
globalReturn: true,
147+
jsx: true
148+
}
149+
},
150+
extends: ['devextreme/typescript'],
151+
rules: {
152+
'i18n/no-russian-character': ['error', { 'includeIdentifier': true }],
153+
},
154+
},
155+
],
156+
settings: {
157+
'import/resolver': {
158+
node: {
159+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
160+
},
161+
},
162+
},
163+
};

e2e/testcafe-devextreme/package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717
"minimist": "1.2.8",
1818
"mockdate": "3.0.5",
1919
"nconf": "0.12.1",
20-
"testcafe": "2.5.0"
20+
"testcafe": "2.5.0",
21+
"eslint": "catalog:eslint8",
22+
"eslint-config-airbnb-typescript": "catalog:eslint8",
23+
"eslint-plugin-i18n": "catalog:eslint8",
24+
"eslint-plugin-import": "catalog:eslint8",
25+
"eslint-plugin-no-only-tests": "catalog:eslint8",
26+
"eslint-plugin-qunit": "catalog:eslint8",
27+
"@babel/eslint-parser": "catalog:eslint8",
28+
"@typescript-eslint/eslint-plugin": "catalog:eslint8",
29+
"@typescript-eslint/parser": "catalog:eslint8"
2130
}
2231
}

e2e/testcafe-devextreme/tests/dataGrid/focus/focus.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ test('DataGrid - FilterRow cell loses focus when focusedRowEnabled is true and e
213213

214214
await initStore();
215215

216-
return await createWidget('dxDataGrid', {
216+
await createWidget('dxDataGrid', {
217217
dataSource: {
218218
key: 'id',
219219
load(loadOptions) {

packages/devextreme-angular/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
"cross-env": "7.0.3",
4545
"css-loader": "6.10.0",
4646
"del": "2.2.2",
47-
"eslint": "8.56.0",
4847
"gulp": "4.0.2",
4948
"gulp-header": "2.0.9",
5049
"gulp-replace": "0.6.1",
@@ -66,7 +65,12 @@
6665
"typescript": "5.4.5",
6766
"webpack": "5.96.1",
6867
"yargs": "17.7.2",
69-
"zone.js": "0.14.10"
68+
"zone.js": "0.14.10",
69+
"eslint": "catalog:eslint8",
70+
"eslint-config-airbnb-typescript": "catalog:eslint8",
71+
"eslint-plugin-import": "catalog:eslint8",
72+
"@typescript-eslint/eslint-plugin": "catalog:eslint8",
73+
"@typescript-eslint/parser": "catalog:eslint8"
7074
},
7175
"main": "./src/index.ts",
7276
"keywords": [

packages/devextreme-react/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@
3737
"@types/react": "~18.0.0",
3838
"@types/react-dom": "~18.0.0",
3939
"del": "3.0.0",
40-
"eslint": "8.56.0",
4140
"eslint-config-airbnb-base": "15.0.0",
42-
"eslint-config-airbnb-typescript": "17.1.0",
4341
"eslint-config-devextreme": "1.1.5",
4442
"gulp": "4.0.2",
4543
"gulp-header": "2.0.9",
@@ -49,7 +47,12 @@
4947
"react": "18.0.0",
5048
"react-dom": "18.0.0",
5149
"ts-jest": "29.1.3",
52-
"typescript": "4.9.5"
50+
"typescript": "4.9.5",
51+
"eslint": "catalog:eslint8",
52+
"eslint-config-airbnb-typescript": "catalog:eslint8",
53+
"eslint-plugin-import": "catalog:eslint8",
54+
"@typescript-eslint/eslint-plugin": "catalog:eslint8",
55+
"@typescript-eslint/parser": "catalog:eslint8"
5356
},
5457
"publishConfig": {
5558
"directory": "npm",

packages/devextreme-themebuilder/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@
3535
"@types/filing-cabinet": "2.5.3",
3636
"@types/fs-extra": "11.0.4",
3737
"@types/node": "20.11.17",
38-
"eslint": "8.56.0",
3938
"eslint-config-airbnb-base": "15.0.0",
40-
"eslint-config-airbnb-typescript": "17.1.0",
4139
"eslint-config-devextreme": "1.1.5",
40+
"eslint": "catalog:eslint8",
41+
"eslint-config-airbnb-typescript": "catalog:eslint8",
42+
"@typescript-eslint/eslint-plugin": "catalog:eslint8",
43+
"@typescript-eslint/parser": "catalog:eslint8",
4244
"express": "4.21.1",
4345
"filing-cabinet": "4.1.6",
4446
"fs-extra": "11.2.0",

0 commit comments

Comments
 (0)