Skip to content

Commit

Permalink
Enable @typescript-eslint/consistent-type-imports
Browse files Browse the repository at this point in the history
This is a valuable rule to make it clear when a token being imported is used strictly for the type system vs a value at runtime.

https://typescript-eslint.io/rules/consistent-type-imports/

The rule is auto-fixable
  • Loading branch information
tizmagik committed Jun 2, 2023
1 parent 5ab0fcf commit cef9e49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/fluffy-spoons-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/eslint-plugin': minor
---

Enable @typescript-eslint/consistent-type-imports to error
2 changes: 2 additions & 0 deletions packages/eslint-plugin/lib/config/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ module.exports = {
'@typescript-eslint/ban-ts-comment': 'error',
// Enforce consistent brace style for blocks
'@typescript-eslint/brace-style': 'error',
// Enforce consistent type imports when importing a token as strictly a type vs as a runtime value
'@typescript-eslint/consistent-type-imports': 'error',
// Enforces consistent usage of type assertions.
'@typescript-eslint/consistent-type-assertions': [
'error',
Expand Down

0 comments on commit cef9e49

Please sign in to comment.