Skip to content

Commit a4a3cee

Browse files
committed
Add perfectionist to typescript rules
1 parent 486d959 commit a4a3cee

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/config/eslint/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ const defaultConfig: FlatConfig.ConfigArray = tsESLint.config(
198198
files: ['**/*.ts', '**/*.tsx'],
199199
// no need to check our snippets
200200
ignores: ['**/*.md'],
201+
plugins: { perfectionist },
201202
languageOptions: {
202203
parserOptions: {
203204
projectService: true,
@@ -206,7 +207,12 @@ const defaultConfig: FlatConfig.ConfigArray = tsESLint.config(
206207
},
207208
// switching to TypeScript unused var rule (instead of JS rule), so that no error is raised
208209
// on unused param from abstract function arguments
209-
rules: standardTSRules,
210+
rules: {...standardTSRules,
211+
'perfectionist/sort-imports': [
212+
'error',
213+
{ type: 'alphabetical', internalPattern: ['^@/.*'] },
214+
],
215+
},
210216
},
211217
// we have to declare that AFTER the TS specifics, our unit test rules from the JS config are otherwise ignored (when the tests are written in TS)
212218
unitTestsConfig

0 commit comments

Comments
 (0)