Skip to content

Commit 957becb

Browse files
committed
chore(deps): migrate to ESLint 9 and include planet code in linting (sugarlabs#5386)
1 parent ae22267 commit 957becb

File tree

5 files changed

+813
-2127
lines changed

5 files changed

+813
-2127
lines changed

.eslintignore

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

.eslintrc.json

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

eslint.config.mjs

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import js from '@eslint/js';
2+
import globals from 'globals';
3+
import babelParser from '@babel/eslint-parser';
4+
import prettierConfig from 'eslint-config-prettier';
5+
6+
export default [
7+
js.configs.recommended,
8+
prettierConfig,
9+
{
10+
ignores: [
11+
'**/node_modules/**',
12+
'**/lib/**',
13+
'**/dist/**',
14+
'**/build/**',
15+
'**/coverage/**',
16+
'**/*.min.js',
17+
'**/bower_components/**',
18+
'**/planet/libs/**',
19+
],
20+
},
21+
{
22+
linterOptions: {
23+
reportUnusedDisableDirectives: 'off',
24+
},
25+
},
26+
{
27+
files: ['**/*.js', '**/*.mjs'],
28+
languageOptions: {
29+
ecmaVersion: 'latest',
30+
sourceType: 'script',
31+
parser: babelParser,
32+
parserOptions: {
33+
requireConfigFile: false,
34+
ecmaFeatures: {
35+
globalReturn: false,
36+
},
37+
},
38+
globals: {
39+
...globals.browser,
40+
...globals.node,
41+
...globals.jest,
42+
...globals.jquery,
43+
// Add specific Music Blocks globals if needed
44+
Logo: 'readonly',
45+
Blocks: 'readonly',
46+
Turtles: 'readonly',
47+
Activity: 'readonly',
48+
_: 'readonly', // i18n
49+
},
50+
},
51+
rules: {
52+
'no-console': 'off',
53+
'no-unused-vars': 'off',
54+
'no-use-before-define': 'off',
55+
'prefer-const': 'off',
56+
'no-undef': 'off',
57+
'no-redeclare': 'off',
58+
'semi': ['error', 'always'],
59+
'no-duplicate-case': 'error',
60+
'no-irregular-whitespace': 'warn',
61+
'no-prototype-builtins': 'off',
62+
'no-useless-escape': 'off',
63+
'no-inner-declarations': 'off',
64+
'no-constant-assign': 'off',
65+
'no-const-assign': 'off',
66+
'no-dupe-keys': 'off',
67+
'no-useless-catch': 'off',
68+
'no-loss-of-precision': 'off',
69+
},
70+
},
71+
];

0 commit comments

Comments
 (0)