Почему ESlint не игнорирует каталоги, которым я приказываю

ESlint, запускаемый из корня папки, не игнорирует файлы и папки, которые я упомянул в файле .eslintignore:

.eslintignore

          .git
    .vscode
    node_modules
    dist
    typedoc
    __tests__/coverage

.eslintrc.cjs

          module.exports = {
      root: true,
      env: {
        node: true,
        es2020: true
      },
      extends: [
        'eslint:recommended',
        'plugin:@typescript-eslint/recommended'
      ],
      parser: '@typescript-eslint/parser',
      rules: {
        '@typescript-eslint/no-var-requires': ["off"],
        "@typescript-eslint/no-explicit-any": ["off"],
        'array-bracket-spacing': ['error', 'never'],
        '@typescript-eslint/consistent-type-imports': ['error', {
          'prefer': 'type-imports'
        }]
        // new rules goes here
      }
    }

я бегу

eslint . -c .eslintrc.cjs --ext js,jsx,ts,tsx --max-warnings 0

Выход

          typedocs/assets/main.js:2:2271
      ✖  2:2271   Unexpected aliasing of this to local variable.  @typescript-eslint/no-this-alias
      ✖  2:2288   Unexpected aliasing of this to local variable.  @typescript-eslint/no-this-alias
      ✖  2:3495   Unnecessary escape character: \-.               no-useless-escape
      ✖  3:4165   E is already defined.                           no-redeclare
      ✖  3:4312   E is already defined.                           no-redeclare
      ✖  3:4361   E is already defined.                           no-redeclare
    ...
      ✖  5:2943   document is not defined.                        no-undef
      ✖  5:3096   document is not defined.                        no-undef
      ✖  5:3179   window is not defined.                          no-undef

      typedocs/assets/navigation.js:1:1
      ✖  1:1      window is not defined.                          no-undef

      typedocs/assets/search.js:1:1
      ✖  1:1      window is not defined.                          no-undef

      102 errors

Я ПЫТАЛСЯ

  • если удалить эти папки (dist/ и typedoc/) то проблем нет
  • НЕТ файла .eslintcache, нет кеша (все чисто)
  • использование шаблонов glob для .eslintignore, напримерtypedoc/**не работает
  • эти папки также находятся в файле .gitignore...

ОЖИДАЕМОЕ ПОВЕДЕНИЕ

Я хочу, чтобы ESlint игнорировал упомянутые мной папки и файлы. Я не хочу удалять эти папки каждый раз, когда вызываю сценарий eslint...

Любая помощь и советы приветствуются!

0 ответов

Другие вопросы по тегам