From 3ace79357866a6f5aa31c64da8ece20d17fd3d91 Mon Sep 17 00:00:00 2001 From: maxime Date: Tue, 16 Jan 2024 22:49:25 +0100 Subject: [PATCH] add eslint --- .eslintrc.js | 21 +++++++++++++++++++++ package.json | 13 ++++++------- 2 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..aa4a8bc --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,21 @@ +module.exports = { + root: true, + parser: '@typescript-eslint/parser', + plugins: [ + '@typescript-eslint', + 'react', + 'react-hooks' + ], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:react/recommended', + 'plugin:react/jsx-runtime', + 'plugin:react-hooks/recommended' + ], + settings: { + react: { + version: 'detect' + } + } +}; \ No newline at end of file diff --git a/package.json b/package.json index 1380d59..966a0e9 100644 --- a/package.json +++ b/package.json @@ -24,16 +24,15 @@ "format": "prettier --config .prettierrc 'front' --write", "tsc": "tsc" }, - "eslintConfig": { - "extends": [ - "react-app", - "react-app/jest" - ] - }, "devDependencies": { "@vitejs/plugin-react": "^4.1.0", "prettier": "^3.1.0", "typescript": "^5.2.2", - "vite-plugin-svgr": "^4.1.0" + "vite-plugin-svgr": "^4.1.0", + "@typescript-eslint/eslint-plugin": "^6.11.0", + "@typescript-eslint/parser": "^6.11.0", + "eslint": "^8.53.0", + "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react-hooks": "^4.6.0" } }