Skip to content

Commit

Permalink
Merge pull request #52 from ofk/fix-for-type-imports
Browse files Browse the repository at this point in the history
Fix for type imports
  • Loading branch information
ofk authored Sep 7, 2023
2 parents a872b93 + 115bd44 commit 89ee993
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 All @@ -74,6 +78,9 @@ module.exports = {
// cf. https://github.com/airbnb/javascript/issues/1122
// https://typescript-eslint.io/rules/prefer-for-of/
'@typescript-eslint/prefer-for-of': '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'],
...(isInstalled('react')
? {
// Allow JSX props spreading in the tsx file.
Expand Down

0 comments on commit 89ee993

Please sign in to comment.