import-js/eslint-plugin-import

'import/parsers' setting breaks my editor linter (VS Code)

Open

#2,752 创建于 2023年3月30日

在 GitHub 查看
 (4 评论) (1 反应) (0 负责人)JavaScript (1,540 fork)batch import
help wantedtypescript

仓库指标

Star
 (4,946 star)
PR 合并指标
 (平均合并 138天 22小时) (30 天内合并 3 个 PR)

描述

Hi Friends,

I am trying to use the rule 'import/no-unused-modules': [2, { unusedExports: true }] which, from research, requires the following eslintrc config:

  settings: {
    'import/parsers': {
      '@typescript-eslint/parser': ['.ts', '.tsx'],
    },
    'import/resolver': {
      node: true,
      typescript: true,
    },
  },

However, when I add the 'import/parsers' setting, the editor lint plugin seems to stops reporting anything. Does anyone know what the cause for this is, and how to resolve it? This is the lint plugin log:

[Info  - 15:46:02] ESLint server is starting.
[Info  - 15:46:02] ESLint server running in node v16.14.2
[Info  - 15:46:02] ESLint server is running.
[Info  - 15:46:03] ESLint library loaded from: [...]/src/ui/node_modules/.pnpm/eslint@7.32.0/node_modules/eslint/lib/api.js
[Warn  - 15:46:04] 
No ESLint configuration (e.g .eslintrc) found for file: [...]/src/ui/apps/webtrader/.eslintrc.js
File will not be validated. Consider running 'eslint --init' in the workspace folder ui
Alternatively you can disable ESLint by executing the 'Disable ESLint' command.

贡献者指南