From 2081e0cedad83de40863d74b2b8be1f173eeef7d Mon Sep 17 00:00:00 2001 From: hieudoanm Date: Tue, 16 Apr 2024 14:35:56 +0700 Subject: [PATCH] use eslint --- .eslintignore | 43 ------------------------------------------- .eslintrc.json | 16 ---------------- eslint.config.js | 7 +++++++ package.json | 4 ++-- yarn.lock | 9 +++++++++ 5 files changed, 18 insertions(+), 61 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.json create mode 100644 eslint.config.js diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 46b3e77..0000000 --- a/.eslintignore +++ /dev/null @@ -1,43 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# next.js -/.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* -.pnpm-debug.log* - -# local env files -.env -.env*.local - -# vercel -.vercel - -# typescript -*.tsbuildinfo -next-env.d.ts - -# tests -*.test.ts -*.test.tsx -*.stories.ts -*.stories.tsx diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 530aa29..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "env": { - "browser": true, - "es2021": true, - "node": true - }, - "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], - "overrides": [], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "plugins": ["@typescript-eslint"], - "rules": {} -} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..9deb2d9 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,7 @@ +const eslint = require('@eslint/js'); +const tseslint = require('typescript-eslint'); + +module.exports = tseslint.config( + eslint.configs.recommended, + ...tseslint.configs.recommended +); diff --git a/package.json b/package.json index 7f8a169..10c86ea 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,9 @@ "pino": "8.20.0" }, "devDependencies": { + "@eslint/js": "9.0.0", "@types/jest": "29.5.12", "@types/node": "20.12.7", - "@typescript-eslint/eslint-plugin": "7.7.0", - "@typescript-eslint/parser": "7.7.0", "@webpack-cli/generators": "3.0.7", "concurrently": "8.2.2", "eslint": "9.0.0", @@ -41,6 +40,7 @@ "ts-loader": "9.5.1", "ts-node": "10.9.2", "typescript": "5.4.5", + "typescript-eslint": "7.7.0", "webpack": "5.91.0", "webpack-cli": "5.1.4", "webpack-dev-server": "5.0.4" diff --git a/yarn.lock b/yarn.lock index 8dc459f..1a57a6d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6969,6 +6969,15 @@ type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" +typescript-eslint@7.7.0: + version "7.7.0" + resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-7.7.0.tgz#b755e350dad25bb1e5b3826d11daa973dc0970ac" + integrity sha512-wZZ+7mTQJCn4mGAvzdERtL4vwKGM/mF9cMSMeKUllz3Hgbd1Mdd5L60Q+nJmCio9RB4OyMMr0EX4Ry2Q7jiAyw== + dependencies: + "@typescript-eslint/eslint-plugin" "7.7.0" + "@typescript-eslint/parser" "7.7.0" + "@typescript-eslint/utils" "7.7.0" + typescript@5.4.5: version "5.4.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611"