You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat!: define rules for consistent type import style (#263)
Prefer:
```ts
import type { Foo } from 'bar'
```
over
```ts
import { type Foo } from 'bar'
```
After compilation it doesn't make any difference but it would be good to settle on one style or the other.
BREAKING CHANGE: type import style is now specified, re-run linting with `--fix` to patch up any rule violations
Copy file name to clipboardExpand all lines: src/ts.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,7 @@ module.exports = {
30
30
'@typescript-eslint/return-await': ['error','in-try-catch'],// require awaiting thenables returned from try/catch
31
31
'jsdoc/require-param': 'off',// do not require jsdoc for params
32
32
'jsdoc/require-param-type': 'off',// allow compiler to derive param type
33
-
'no-undef': 'off'// typescript already checks for undefined variables so this is redundant - https://typescript-eslint.io/troubleshooting/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
33
+
'no-undef': 'off',// typescript already checks for undefined variables so this is redundant - https://typescript-eslint.io/troubleshooting/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
34
+
'import/consistent-type-specifier-style': ['error','prefer-top-level']// prefer `import type { Foo }` over `import { type Foo }`
0 commit comments