From b53b36085df9bc9281cdf10094395f7b0a556018 Mon Sep 17 00:00:00 2001 From: Brett Cutting Date: Fri, 22 May 2026 09:14:24 +1000 Subject: [PATCH] TCS-10: Enforce import type via consistent-type-imports Add @typescript-eslint/consistent-type-imports as an error in the base config so type-only imports are written with import type and any mixed runtime/type imports are split (fixStyle: 'separate-type-imports'). Inline import('...').Foo type annotations are disallowed. The rule is placed in its own config object scoped to **/*.{ts,tsx,js,jsx,mjs,cjs} so it doesn't load for non-JS/TS files (e.g. GraphQL virtual documents extracted by @graphql-eslint/parser), which lack the parser services this rule requires. --- src/index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/index.js b/src/index.js index 1b98fe7..2e53c80 100644 --- a/src/index.js +++ b/src/index.js @@ -44,6 +44,19 @@ const base = [ ], }, }, + { + files: ['**/*.{ts,tsx,js,jsx,mjs,cjs}'], + rules: { + '@typescript-eslint/consistent-type-imports': [ + 'error', + { + prefer: 'type-imports', + fixStyle: 'separate-type-imports', + disallowTypeAnnotations: true, + }, + ], + }, + }, ]; const react = [