Skip to content

Commit

Permalink
chore: Remove the need for @eslint/compat now that eslint-plugin-impo…
Browse files Browse the repository at this point in the history
…rt is flat config compatible.
  • Loading branch information
Standard8 committed Oct 22, 2024
1 parent 7f56a8b commit a361916
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 37 deletions.
21 changes: 4 additions & 17 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import globals from "globals";
import jsdoc from "eslint-plugin-jsdoc";
import json from "eslint-plugin-json";
import react from "eslint-plugin-react";
import imports from "eslint-plugin-import";
import importPlugin from "eslint-plugin-import";
import mozilla from "eslint-plugin-mozilla";
import { fixupPluginRules } from "@eslint/compat";
import eslintConfigPrettier from "eslint-config-prettier";

export default [
Expand All @@ -29,17 +28,15 @@ export default [
},
{
files: ["**/*.mjs", "**/*.js"],
...importPlugin.flatConfigs.recommended,
languageOptions: {
parserOptions: {
...importPlugin.flatConfigs.recommended.languageOptions.parserOptions,
sourceType: "module",
},
},
plugins: { import: fixupPluginRules(imports) },
rules: {
"import/default": "error",
"import/export": "error",
"import/named": "error",
"import/namespace": "error",
...importPlugin.flatConfigs.recommended.rules,
"import/newline-after-import": "error",
"import/no-duplicates": "error",
"import/no-absolute-path": "error",
Expand All @@ -48,20 +45,10 @@ export default [
"import/no-named-as-default-member": "error",
"import/no-self-import": "error",
"import/no-unassigned-import": "error",
"import/no-unresolved": "error",
"import/no-useless-path-segments": "error",
},
settings: {
"import/extensions": [".mjs"],
// To work around the flat configuration not working yet in
// eslint-plugin-import.
// https://github.com/import-js/eslint-plugin-import/issues/2556
"import/parsers": {
espree: [".mjs"],
},
"import/resolver": {
node: true,
},
},
},
{
Expand Down
19 changes: 0 additions & 19 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"redux": "5.0.1"
},
"devDependencies": {
"@eslint/compat": "1.2.1",
"@microsoft/eslint-plugin-sdl": "1.0.0",
"@testing-library/react": "16.0.1",
"eslint": "9.13.0",
Expand Down

0 comments on commit a361916

Please sign in to comment.