Skip to content

Commit

Permalink
Switch back to simple-import-sort plugin
Browse files Browse the repository at this point in the history
The other once has way too many weird edge cases and doesn't sort within
import destructures. The simple version is what is used in the
TypeScript source repo ESLint config...
  • Loading branch information
rileytomasek committed Mar 3, 2024
1 parent f140ce7 commit 84d1b3d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion config/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
'no-duplicate-case': 'warn',
'no-empty-character-class': 'warn',
'no-empty-pattern': 'warn',
'no-duplicate-imports': 'warn',
'no-duplicate-imports': 'error',
'no-empty': ['warn', { allowEmptyCatch: true }],
'no-eval': 'error',
'no-ex-assign': 'warn',
Expand Down
11 changes: 0 additions & 11 deletions config/import.js

This file was deleted.

14 changes: 12 additions & 2 deletions config/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
module.exports = {
files: ['**/*.{ts,tsx,mts,cts}'],

plugins: ['@typescript-eslint'],
plugins: ['@typescript-eslint', 'simple-import-sort'],

extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/stylistic',
],

rules: {
// @typescript-eslint/eslint-plugin
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',

'@typescript-eslint/naming-convention': [
'error',
{
Expand Down Expand Up @@ -74,6 +76,14 @@ module.exports = {
'error',
{ allowTernary: true },
],
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
disallowTypeAnnotations: true,
fixStyle: 'inline-type-imports',
},
],

// Rules enabled in typescript-eslint configs that are not applicable here
'@typescript-eslint/ban-ts-comment': 'off',
Expand Down
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ module.exports = {

overrides: [
'./config/typescript',
'./config/import',
'./config/react',
'./config/tests',
'./config/prettier',
Expand Down

0 comments on commit 84d1b3d

Please sign in to comment.