Skip to content

Commit

Permalink
test: update eslint config to flat on eslint v8 (#836)
Browse files Browse the repository at this point in the history
* chore(deps): update eslint plugins

update to
@stylistic/eslint-plugin-js@1.8.0
eslint-plugin-cypress@3.1.1

* chore(deps): add @eslint/eslintrc@3.0.2

* test: migrate to eslint flat config
  • Loading branch information
MikeMcC399 committed May 6, 2024
1 parent 27c1fe5 commit 3181d68
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 41 deletions.
24 changes: 0 additions & 24 deletions .eslintrc

This file was deleted.

32 changes: 32 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import globals from 'globals'
import { FlatCompat } from '@eslint/eslintrc'
import pluginJs from '@eslint/js'
import eslintPluginJsonc from 'eslint-plugin-jsonc'
import stylisticJs from '@stylistic/eslint-plugin-js'
import mochaPlugin from 'eslint-plugin-mocha'

const compat = new FlatCompat()

export default [
pluginJs.configs.recommended,
...eslintPluginJsonc.configs['flat/recommended-with-json'],
mochaPlugin.configs.flat.recommended,
{
plugins: {
'@stylistic/js': stylisticJs,
},
rules: {
'@stylistic/js/indent': ['error', 2, { 'SwitchCase': 1, 'MemberExpression': 'off' }],
'mocha/no-exclusive-tests': 'error',
'mocha/no-skipped-tests': 'error',
'mocha/no-mocha-arrows': 'off'
},
languageOptions: {
globals: {
...globals.node
},
}
}, ...compat.config({
extends: ['plugin:cypress/recommended'],
})
]
95 changes: 80 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@
},
"devDependencies": {
"@bahmutov/print-env": "1.3.0",
"@stylistic/eslint-plugin-js": "1.7.2",
"@eslint/eslintrc": "3.0.2",
"@stylistic/eslint-plugin-js": "1.8.0",
"cypress": "13.8.1",
"eslint": "8.57.0",
"eslint-plugin-cypress": "3.0.2",
"eslint-plugin-cypress": "3.1.1",
"eslint-plugin-jsonc": "2.15.1",
"eslint-plugin-mocha": "10.4.3",
"globby": "11.1.0",
Expand Down

0 comments on commit 3181d68

Please sign in to comment.