Skip to content

Commit da65016

Browse files
committed
⬆️ eslint 9.27.0
Closes #3886
1 parent a264c83 commit da65016

25 files changed

+565
-292
lines changed

.eslintrc.cjs

Lines changed: 0 additions & 65 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
import { defineConfig } from 'eslint/config';
2+
import react from 'eslint-plugin-react';
3+
import security from 'eslint-plugin-security';
4+
import globals from 'globals';
5+
import babelParser from '@babel/eslint-parser';
6+
import path from 'node:path';
7+
import { fileURLToPath } from 'node:url';
8+
import js from '@eslint/js';
9+
import { FlatCompat } from '@eslint/eslintrc';
10+
11+
const __filename = fileURLToPath(import.meta.url);
12+
const __dirname = path.dirname(__filename);
13+
const compat = new FlatCompat({
14+
baseDirectory: __dirname,
15+
recommendedConfig: js.configs.recommended,
16+
allConfig: js.configs.all
17+
});
18+
19+
export default defineConfig([
20+
js.configs.recommended, {
21+
extends: compat.extends(
22+
'eslint:recommended',
23+
'plugin:react/recommended',
24+
'plugin:security/recommended-legacy',
25+
),
26+
27+
plugins: {
28+
react,
29+
security,
30+
},
31+
32+
files: [
33+
'**/*.mjs', '**/*.jsx'
34+
],
35+
36+
languageOptions: {
37+
globals: {
38+
...globals.browser,
39+
...globals.amd,
40+
...globals.jquery,
41+
},
42+
43+
parser: babelParser,
44+
ecmaVersion: 'latest',
45+
sourceType: 'module',
46+
47+
parserOptions: {
48+
ecmaFeatures: {
49+
jsx: true,
50+
},
51+
},
52+
},
53+
54+
settings: {
55+
react: {
56+
version: 'detect',
57+
},
58+
},
59+
60+
rules: {
61+
indent: ['error', 4, {
62+
SwitchCase: 1,
63+
}],
64+
65+
'linebreak-style': ['error', 'unix'],
66+
67+
'no-unused-vars': ['error', {
68+
vars: 'all',
69+
args: 'none',
70+
}],
71+
72+
quotes: ['error', 'single'],
73+
semi: ['error', 'always'],
74+
'security/detect-buffer-noassert': 1,
75+
'security/detect-child-process': 1,
76+
'security/detect-disable-mustache-escape': 1,
77+
'security/detect-eval-with-expression': 1,
78+
'security/detect-new-buffer': 1,
79+
'security/detect-no-csrf-before-method-override': 1,
80+
'security/detect-non-literal-fs-filename': 1,
81+
'security/detect-non-literal-regexp': 1,
82+
'security/detect-non-literal-require': 0,
83+
'security/detect-object-injection': 0,
84+
'security/detect-possible-timing-attacks': 1,
85+
'security/detect-pseudoRandomBytes': 1,
86+
'security/detect-unsafe-regex': 1,
87+
},
88+
}, {
89+
files: ['**/*.js'],
90+
languageOptions: {
91+
globals: {
92+
...globals.browser,
93+
...globals.jquery
94+
}
95+
}
96+
}, {
97+
files: ['**/*.test.js', '**/*.test.jsx', '**/*.test.mjs'],
98+
languageOptions: {
99+
globals: {
100+
...globals.jest,
101+
}
102+
}
103+
}
104+
]);

media/js/config/env.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-env node */
1+
/* global process */
22

33
'use strict';
44

media/js/config/paths.cjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-env node */
1+
/* global process */
22

33
'use strict';
44

@@ -48,11 +48,11 @@ module.exports = {
4848
dotenv: resolveApp('.env'),
4949
appBuild: resolveApp(JS_PATH + 'build'),
5050
appPublic: resolveApp(JS_PATH + 'public'),
51-
appEditorJs: resolveApp(JS_PATH + 'src/editor-main.js'),
52-
appViewerJs: resolveApp(JS_PATH + 'src/viewer-main.js'),
53-
appStepGraphViewerJs: resolveApp(JS_PATH + 'src/stepGraphViewer-main.js'),
54-
appRubricJs: resolveApp(JS_PATH + 'src/rubric-main.js'),
55-
appGraphPreviewJs: resolveApp(JS_PATH + 'src/graphPreview-main.js'),
51+
appEditorJs: resolveApp(JS_PATH + 'src/editor-main.jsx'),
52+
appViewerJs: resolveApp(JS_PATH + 'src/viewer-main.jsx'),
53+
appStepGraphViewerJs: resolveApp(JS_PATH + 'src/stepGraphViewer-main.jsx'),
54+
appRubricJs: resolveApp(JS_PATH + 'src/rubric-main.jsx'),
55+
appGraphPreviewJs: resolveApp(JS_PATH + 'src/graphPreview-main.jsx'),
5656
appPackageJson: resolveApp('package.json'),
5757
appSrc: resolveApp(JS_PATH + 'src'),
5858
yarnLockFile: resolveApp('yarn.lock'),

media/js/config/webpack.config.dev.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-env node */
1+
/* global process */
22

33
'use strict';
44

media/js/config/webpack.config.prod.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-env node */
1+
/* global process */
22

33
'use strict';
44

File renamed without changes.
File renamed without changes.
File renamed without changes.

media/js/src/JXGBoard.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-env node */
2+
/* global process */
23

34
import React from 'react';
45
import PropTypes from 'prop-types';

0 commit comments

Comments
 (0)