Skip to content

Commit

Permalink
feat(standard-web-linter): add unused imports plugin (#503)
Browse files Browse the repository at this point in the history
feat: add unused imports plugin
  • Loading branch information
kyleleow authored Dec 9, 2024
1 parent cc94451 commit ba46ecf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/standard-web-linter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
parserOptions: {
project: "./tsconfig.json",
},
plugins: ["simple-import-sort", "prettier"],
plugins: ["simple-import-sort", "prettier", "unused-imports"],
rules: {
// Fix airbnb-typescript/base rule to allow leading underscores for unused vars
"@typescript-eslint/naming-convention": [
Expand All @@ -22,14 +22,16 @@ module.exports = {
format: ["PascalCase"],
},
],
"@typescript-eslint/no-unused-vars": [
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"unused-imports/no-unused-imports": "error",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-filename-extension": [
Expand Down
1 change: 1 addition & 0 deletions packages/standard-web-linter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "5.0.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-unused-imports": "^4.1.4",
"husky": "^9.1.7",
"lint-staged": "^15.2.10",
"next": "^14.2.19",
Expand Down
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit ba46ecf

Please sign in to comment.