Skip to content

Commit

Permalink
Upgrade needy eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
aeharding committed Oct 7, 2024
1 parent c689fa7 commit abf61b5
Show file tree
Hide file tree
Showing 13 changed files with 419 additions and 348 deletions.
37 changes: 0 additions & 37 deletions .eslintrc

This file was deleted.

74 changes: 74 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
import react from "eslint-plugin-react";
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
...fixupConfigRules(
compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:prettier/recommended",
),
),
{
plugins: {
react: fixupPluginRules(react),
"@typescript-eslint": fixupPluginRules(typescriptEslint),
},

languageOptions: {
parser: tsParser,
ecmaVersion: 2022,
sourceType: "module",

parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},

settings: {
react: {
version: "detect",
},
},

rules: {
"react/react-in-jsx-scope": "off",

"react/no-unknown-property": [
"error",
{
ignore: ["css"],
},
],

"no-constant-condition": "off",

"no-restricted-imports": [
"warn",
{
paths: ["@emotion/styled/macro", "@emotion/react/macro", "lodash"],
},
],

"@typescript-eslint/no-unused-vars": ["error", { caughtErrors: "none" }],
},
},
];
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
},
"devDependencies": {
"@emotion/babel-plugin": "^11.12.0",
"@eslint/compat": "^1.2.0",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.12.0",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
Expand All @@ -98,13 +101,13 @@
"@types/react-transition-group": "^4.4.11",
"@types/smoothscroll-polyfill": "^0.3.4",
"@types/suncalc": "^1.9.2",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"eslint": "^8.57.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.1",
"@typescript-eslint/eslint-plugin": "^8.8.0",
"@typescript-eslint/parser": "^8.8.0",
"eslint": "^9.12.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.1",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-testing-library": "^6.2.2",
"eslint-plugin-testing-library": "^6.3.0",
"happy-dom": "^15.7.4",
"prettier": "^3.3.3",
"pwa-asset-generator": "^6.3.2",
Expand Down
Loading

0 comments on commit abf61b5

Please sign in to comment.