Skip to content

Commit 3181d68

Browse files
authored
test: update eslint config to flat on eslint v8 (#836)
* chore(deps): update eslint plugins update to @stylistic/[email protected] [email protected] * chore(deps): add @eslint/[email protected] * test: migrate to eslint flat config
1 parent 27c1fe5 commit 3181d68

File tree

4 files changed

+115
-41
lines changed

4 files changed

+115
-41
lines changed

.eslintrc

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

eslint.config.mjs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import globals from 'globals'
2+
import { FlatCompat } from '@eslint/eslintrc'
3+
import pluginJs from '@eslint/js'
4+
import eslintPluginJsonc from 'eslint-plugin-jsonc'
5+
import stylisticJs from '@stylistic/eslint-plugin-js'
6+
import mochaPlugin from 'eslint-plugin-mocha'
7+
8+
const compat = new FlatCompat()
9+
10+
export default [
11+
pluginJs.configs.recommended,
12+
...eslintPluginJsonc.configs['flat/recommended-with-json'],
13+
mochaPlugin.configs.flat.recommended,
14+
{
15+
plugins: {
16+
'@stylistic/js': stylisticJs,
17+
},
18+
rules: {
19+
'@stylistic/js/indent': ['error', 2, { 'SwitchCase': 1, 'MemberExpression': 'off' }],
20+
'mocha/no-exclusive-tests': 'error',
21+
'mocha/no-skipped-tests': 'error',
22+
'mocha/no-mocha-arrows': 'off'
23+
},
24+
languageOptions: {
25+
globals: {
26+
...globals.node
27+
},
28+
}
29+
}, ...compat.config({
30+
extends: ['plugin:cypress/recommended'],
31+
})
32+
]

package-lock.json

Lines changed: 80 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@
6161
},
6262
"devDependencies": {
6363
"@bahmutov/print-env": "1.3.0",
64-
"@stylistic/eslint-plugin-js": "1.7.2",
64+
"@eslint/eslintrc": "3.0.2",
65+
"@stylistic/eslint-plugin-js": "1.8.0",
6566
"cypress": "13.8.1",
6667
"eslint": "8.57.0",
67-
"eslint-plugin-cypress": "3.0.2",
68+
"eslint-plugin-cypress": "3.1.1",
6869
"eslint-plugin-jsonc": "2.15.1",
6970
"eslint-plugin-mocha": "10.4.3",
7071
"globby": "11.1.0",

0 commit comments

Comments
 (0)