diff --git a/packages/eslint-plugin-antfu/src/rules/prefer-inline-type-import.ts b/packages/eslint-plugin-antfu/src/rules/prefer-inline-type-import.ts index 072e906..11e55be 100644 --- a/packages/eslint-plugin-antfu/src/rules/prefer-inline-type-import.ts +++ b/packages/eslint-plugin-antfu/src/rules/prefer-inline-type-import.ts @@ -1,6 +1,7 @@ // Ported from https://github.com/gajus/eslint-plugin-canonical/blob/master/src/rules/preferInlineTypeImport.js // by Gajus Kuizinas https://github.com/gajus - +import type { TSESTree } from '@typescript-eslint/utils' +import type { RuleFixer, SourceCode } from '@typescript-eslint/utils/dist/ts-eslint' import { createEslintRule } from '../utils' export const RULE_NAME = 'prefer-inline-type-import' @@ -47,7 +48,7 @@ export default createEslintRule({ }, }) -function *removeTypeSpecifier(fixer, sourceCode, node) { +function * removeTypeSpecifier(fixer: RuleFixer, sourceCode: Readonly, node: TSESTree.ImportDeclaration) { const importKeyword = sourceCode.getFirstToken(node) const typeIdentifier = sourceCode.getTokenAfter(importKeyword) diff --git a/packages/typescript/index.js b/packages/typescript/index.js index d9461aa..14408de 100644 --- a/packages/typescript/index.js +++ b/packages/typescript/index.js @@ -24,6 +24,7 @@ module.exports = { parser: '@typescript-eslint/parser', excludedFiles: ['**/*.md/*.*'], files: ['*.ts', '*.tsx', '*.mts', '*.cts'], + // https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended-requiring-type-checking.ts rules: { 'no-throw-literal': 'off', '@typescript-eslint/no-throw-literal': 'error', @@ -34,6 +35,19 @@ module.exports = { 'no-void': ['error', { allowAsStatement: true }], '@typescript-eslint/no-floating-promises': 'error', '@typescript-eslint/no-misused-promises': 'error', + '@typescript-eslint/await-thenable': 'error', + '@typescript-eslint/no-for-in-array': 'error', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', + '@typescript-eslint/no-unsafe-argument': 'error', + '@typescript-eslint/no-unsafe-assignment': 'error', + '@typescript-eslint/no-unsafe-call': 'error', + '@typescript-eslint/no-unsafe-member-access': 'error', + '@typescript-eslint/no-unsafe-return': 'error', + 'require-await': 'off', + '@typescript-eslint/require-await': 'error', + '@typescript-eslint/restrict-plus-operands': 'error', + '@typescript-eslint/restrict-template-expressions': 'error', + '@typescript-eslint/unbound-method': 'error', }, }], ),