Skip to content

Commit

Permalink
feat: add vite import massager plugin
Browse files Browse the repository at this point in the history
This should improve eslint performance for negligable vite performance as the straight string transforms are faster than the TS parsing needed for the eslint-plugin rule

BREAKING CHANGE: eslint-plugin has ‘forbidden imports’ replaced with vite plugin
  • Loading branch information
SimeonC committed Sep 12, 2024
1 parent 102dd97 commit 6c0c2f9
Show file tree
Hide file tree
Showing 22 changed files with 688 additions and 324 deletions.
72 changes: 53 additions & 19 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"storybook": "^6.5.16",
"type-fest": "4.4.0",
"typescript": "5.4.5",
"vite": "5.3.1",
"vite": "5.3.5",
"vite-plugin-eslint": "^1.8.1",
"vite-tsconfig-paths": "4.3.2",
"vitest": "1.6.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
},
"devDependencies": {
"eslint": "^8",
"vite": "5.3.1",
"vite": "5.3.5",
"vite-tsconfig-paths": "4.3.2"
},
"engines": {
Expand Down
1 change: 0 additions & 1 deletion packages/eslint-config/src/rules/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,5 @@ export const generalRules: Linter.RulesRecord = {
},
],
'no-unused-vars': 'error',
'@tablecheck/forbidden-imports': 'error',
'@nx/enforce-module-boundaries': 'error',
};
9 changes: 4 additions & 5 deletions packages/eslint-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ npm install --save-dev @tablecheck/eslint-plugin
🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\
💭 Requires type information.

| Name                    | Description | 🔧 | 💭 |
| :--------------------------------------------------------------- | :------------------------------------------------------------------------------------------ | :-- | :-- |
| [consistent-react-import](docs/rules/consistent-react-import.md) | Ensure that react is always imported and used consistently | 🔧 | |
| [forbidden-imports](docs/rules/forbidden-imports.md) | Ensure that certain packages are using specific imports instead of using the default import | 🔧 | |
| [prefer-shortest-import](docs/rules/prefer-shortest-import.md) | Enforce the consistent use of preferred import paths | 🔧 | 💭 |
| Name | Description | 🔧 | 💭 |
| :--------------------------------------------------------------- | :--------------------------------------------------------- | :-- | :-- |
| [consistent-react-import](docs/rules/consistent-react-import.md) | Ensure that react is always imported and used consistently | 🔧 | |
| [prefer-shortest-import](docs/rules/prefer-shortest-import.md) | Enforce the consistent use of preferred import paths | 🔧 | 💭 |

<!-- end auto-generated rules list -->
135 changes: 0 additions & 135 deletions packages/eslint-plugin/__tests__/forbiddenImports.test.ts

This file was deleted.

5 changes: 0 additions & 5 deletions packages/eslint-plugin/docs/rules/forbidden-imports.md

This file was deleted.

2 changes: 1 addition & 1 deletion packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"prettier": "3.0.3",
"type-fest": "4.4.0",
"typescript": "5.1.6",
"vite": "5.3.1",
"vite": "5.3.5",
"vite-tsconfig-paths": "4.3.2",
"vitest": "1.6.0"
},
Expand Down
Loading

0 comments on commit 6c0c2f9

Please sign in to comment.