-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace deprecated .eslintrc with eslint.config.mjs
I tried to include all the rules and plugins from the old config as far as they are compatible with eslint 9. eslint-config-standard and eslint-config-standard-react seem to be dead and have been forked into neoconfig.The promise and n plugin is included in neoconfig afaik and doesn't need to be added explicitly.
- Loading branch information
Showing
3 changed files
with
55 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import globals from "globals"; | ||
import hooksPlugin from "eslint-plugin-react-hooks"; | ||
import importPlugin from "eslint-plugin-import"; | ||
import jsxA11y from "eslint-plugin-jsx-a11y"; | ||
import pluginJest from "eslint-plugin-jest"; | ||
import pluginJs from "@eslint/js"; | ||
import neostandard, { plugins } from "neostandard"; | ||
|
||
export default [ | ||
...neostandard(), | ||
jsxA11y.flatConfigs.recommended, | ||
importPlugin.flatConfigs.recommended, | ||
{ | ||
files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx,jest.jsx,jest.js}"], | ||
ignores: ["node_modules/", "venv/", "static/"], | ||
languageOptions: { | ||
...jsxA11y.flatConfigs.recommended.languageOptions, | ||
globals: { | ||
...globals.browser, | ||
...pluginJest.environments.globals.globals, | ||
...globals.jquery, | ||
}, | ||
ecmaVersion: "latest", | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
"experimentalObjectRestSpread": true, | ||
}, | ||
}, | ||
}, | ||
plugins: { | ||
jest: pluginJest, | ||
"react-hooks": hooksPlugin, | ||
}, | ||
rules: { | ||
"no-restricted-syntax": ["error", "TemplateLiteral"], | ||
"jsx-a11y/no-onchange": "off", | ||
"@stylistic/jsx-quotes": [2, "prefer-double"], | ||
...hooksPlugin.configs.recommended.rules, | ||
}, | ||
settings: { | ||
"import/core-modules": ["django"], | ||
"import/resolver": { | ||
node: { | ||
extensions: [".js", ".jsx"], | ||
}, | ||
}, | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters