using tseslint.config in eslint config (for types)

This commit is contained in:
Mose Müller 2024-07-08 08:58:04 +02:00
parent b856ed3a12
commit a5a957d290
3 changed files with 3 additions and 6 deletions

View File

@ -2,9 +2,8 @@ import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import reactRecommended from "eslint-plugin-react/configs/recommended.js";
import tsParser from "@typescript-eslint/parser";
export default [
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
@ -12,7 +11,7 @@ export default [
files: ["**/*.{js,jsx,ts,tsx}"],
...reactRecommended,
languageOptions: {
parser: tsParser,
parser: tseslint.parser,
},
rules: {
"prettier/prettier": "error",
@ -22,4 +21,4 @@ export default [
},
},
eslintPluginPrettierRecommended,
];
);

View File

@ -23,7 +23,6 @@
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",

View File

@ -25,7 +25,6 @@
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",