Skip to content

Commit 295aadd

Browse files
authored
refactor: Bump eslint from 8.24.0 to 9.22.0 (#2692)
1 parent c628f42 commit 295aadd

Some content is hidden

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

42 files changed

+1951
-1217
lines changed

.eslintrc.json

-39
This file was deleted.

Parse-Dashboard/app.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ module.exports = function(config, options) {
185185
//Check also if the icons really exist
186186
checkIfIconsExistForApps(config.apps, config.iconsFolder);
187187
}
188-
} catch (e) {
188+
} catch {
189189
// Directory doesn't exist or something.
190190
console.warn('Iconsfolder at path: ' + config.iconsFolder +
191191
' not found!');

eslint.config.js

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
const { defineConfig } = require('eslint/config');
2+
const { includeIgnoreFile } = require('@eslint/compat');
3+
const path = require('node:path');
4+
const globals = require('globals');
5+
6+
const gitignorePath = path.resolve(__dirname, '.gitignore');
7+
8+
const js = require('@eslint/js');
9+
const babelParser = require('@babel/eslint-parser');
10+
const reactPlugin = require('eslint-plugin-react');
11+
const jestPlugin = require('eslint-plugin-jest');
12+
13+
module.exports = defineConfig([
14+
includeIgnoreFile(gitignorePath), // Load ignores from .gitignore
15+
js.configs.recommended,
16+
reactPlugin.configs.flat.recommended,
17+
{
18+
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
19+
languageOptions: {
20+
parser: babelParser,
21+
parserOptions: {
22+
ecmaVersion: 6,
23+
sourceType: 'module',
24+
requireConfigFile: false
25+
},
26+
globals: {
27+
...globals.builtin,
28+
...globals.browser,
29+
...globals.es6,
30+
...globals.node,
31+
}
32+
},
33+
settings: {
34+
react: {
35+
version: 'detect',
36+
},
37+
},
38+
rules: {
39+
'indent': ['error', 2, { 'SwitchCase': 1 }],
40+
'linebreak-style': ['error', 'unix'],
41+
'no-trailing-spaces': 'error',
42+
'eol-last': 'error',
43+
'space-in-parens': ['error', 'never'],
44+
'no-multiple-empty-lines': 'warn',
45+
'prefer-const': 'error',
46+
'space-infix-ops': 'error',
47+
'no-useless-escape': 'off',
48+
'require-atomic-updates': 'off',
49+
'react/jsx-uses-vars': 'warn',
50+
'react/jsx-uses-react': 'warn',
51+
'react/react-in-jsx-scope': 'warn',
52+
'no-console': 'off',
53+
'no-case-declarations': 'off',
54+
'quotes': ['error', 'single'],
55+
'no-var': 'error',
56+
'no-prototype-builtins': 'off',
57+
'curly': ['error', 'all'],
58+
'react/no-deprecated': 'off',
59+
'react/prop-types': 'off',
60+
'react/no-string-refs': 'off',
61+
}
62+
},
63+
{
64+
files: ['**/*.test.js', '**/*.test.jsx', '**/*.test.ts', '**/*.test.tsx'],
65+
plugins: {
66+
jest: jestPlugin
67+
},
68+
languageOptions: {
69+
globals: {
70+
...globals.builtin,
71+
...globals.browser,
72+
...globals.es6,
73+
...globals.node,
74+
...globals.jest
75+
}
76+
},
77+
}
78+
]);

0 commit comments

Comments
 (0)