From 5f05cfcfd6523fd5802282aef65ec9c32c01014b Mon Sep 17 00:00:00 2001 From: CondorHero <47056890+condorheroblog@users.noreply.github.com> Date: Thu, 31 Mar 2022 22:19:07 +0800 Subject: [PATCH] fix: eslint-plugin-import support TypeScript (#77) Co-authored-by: CondorHero --- packages/basic/index.js | 2 +- packages/typescript/index.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/basic/index.js b/packages/basic/index.js index 2063587..94ac3e2 100644 --- a/packages/basic/index.js +++ b/packages/basic/index.js @@ -35,7 +35,7 @@ module.exports = { ], settings: { 'import/resolver': { - node: { extensions: ['.js', '.mjs', '.ts', '.d.ts'] }, + node: { extensions: ['.js', '.mjs'] }, }, }, overrides: [ diff --git a/packages/typescript/index.js b/packages/typescript/index.js index ecd5f0e..474a02a 100644 --- a/packages/typescript/index.js +++ b/packages/typescript/index.js @@ -4,8 +4,14 @@ const basic = require('@antfu/eslint-config-basic') module.exports = { extends: [ '@antfu/eslint-config-basic', + 'plugin:import/typescript', 'plugin:@typescript-eslint/recommended', ], + settings: { + 'import/resolver': { + node: { extensions: ['.js', '.jsx', '.mjs', '.ts', '.tsx', '.d.ts'] }, + }, + }, overrides: basic.overrides, rules: { 'import/named': 'off',