Skip to content

Commit

Permalink
Fix for type imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ofk committed Aug 21, 2023
1 parent a872b93 commit 76ace0a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions best-practices.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module.exports = {
'error',
{
prefer: 'type-imports',
fixStyle: 'separate-type-imports',
disallowTypeAnnotations: true,
},
],
Expand All @@ -51,6 +52,9 @@ module.exports = {
allowSingleExtends: true,
},
],
// Disallow type imports with side effects.
// https://typescript-eslint.io/rules/no-import-type-side-effects/
'@typescript-eslint/no-import-type-side-effects': 'error',
// Prevents unnecessary condition instead of no-constant-condition.
// https://typescript-eslint.io/rules/no-unnecessary-condition/
'no-constant-condition': 'off',
Expand Down Expand Up @@ -87,6 +91,9 @@ module.exports = {
'react/require-default-props': 'off',
}
: {}),
// Disallow inline type imports.
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/consistent-type-specifier-style.md
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
},
},
],
Expand Down

0 comments on commit 76ace0a

Please sign in to comment.