diff --git a/packages/typescript/rules-snapshot.json b/packages/typescript/rules-snapshot.json index f0998f5..afb709c 100644 --- a/packages/typescript/rules-snapshot.json +++ b/packages/typescript/rules-snapshot.json @@ -5,7 +5,6 @@ "@typescript-eslint/consistent-type-assertions": "error", "@typescript-eslint/consistent-type-definitions": ["error", "type"], "@typescript-eslint/consistent-type-exports": "error", - "@typescript-eslint/consistent-type-imports": "error", "@typescript-eslint/default-param-last": "error", "@typescript-eslint/explicit-function-return-type": "error", "@typescript-eslint/naming-convention": [ @@ -154,6 +153,7 @@ "constructor-super": "off", "default-param-last": "off", "getter-return": "off", + "import-x/consistent-type-specifier-style": ["error", "prefer-top-level"], "import-x/named": "off", "import-x/no-unresolved": "off", "jsdoc/check-access": "error", diff --git a/packages/typescript/src/index.mjs b/packages/typescript/src/index.mjs index 141a604..3903bd0 100644 --- a/packages/typescript/src/index.mjs +++ b/packages/typescript/src/index.mjs @@ -38,14 +38,10 @@ const config = createConfig({ }, rules: { - // Handled by TypeScript - 'import-x/no-unresolved': 'off', - // Our rules '@typescript-eslint/array-type': 'error', '@typescript-eslint/consistent-type-assertions': 'error', '@typescript-eslint/consistent-type-definitions': ['error', 'type'], - '@typescript-eslint/consistent-type-imports': 'error', '@typescript-eslint/explicit-function-return-type': 'error', '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-namespace': [ @@ -199,6 +195,15 @@ const config = createConfig({ 'no-useless-constructor': 'off', '@typescript-eslint/no-useless-constructor': 'error', + /* import-x plugin rules */ + + // Handled by TypeScript + 'import-x/no-unresolved': 'off', + + // Combined with the "verbatimModuleSyntax" tsconfig option, a better option than + // @typescript-eslint/consistent-type-imports + 'import-x/consistent-type-specifier-style': ['error', 'prefer-top-level'], + /* jsdoc plugin rules */ 'jsdoc/check-syntax': 'error', diff --git a/packages/typescript/tsconfig.json b/packages/typescript/tsconfig.json index 5bb107d..cf964c3 100644 --- a/packages/typescript/tsconfig.json +++ b/packages/typescript/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { - "strictNullChecks": true + "strictNullChecks": true, + "verbatimModuleSyntax": true }, "include": ["src"] } diff --git a/tsconfig.json b/tsconfig.json index 02ff7a3..6534da2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,8 @@ "noUncheckedIndexedAccess": true, "resolveJsonModule": true, "strict": true, - "target": "ES2022" + "target": "ES2022", + "verbatimModuleSyntax": true }, "include": ["**/*.mjs", "**/*.mts"], "exclude": ["./dist", "**/node_modules"]