import-js/eslint-plugin-import

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

Open

#2,752 opened on Mar 30, 2023

View on GitHub
 (4 comments) (1 reaction) (0 assignees)JavaScript (1,540 forks)batch import
help wantedtypescript

Repository metrics

Stars
 (4,946 stars)
PR merge metrics
 (Avg merge 138d 22h) (3 merged PRs in 30d)

Description

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.

Contributor guide