vuejs / eslint-config-airbnb

ESLint Shareable Configs for Airbnb JavaScript Style Guide in Vue.js Projects
MIT License
72 stars 20 forks source link

ESLint hangs because of `import/resolver` setting #20

Closed MatanYadaev closed 2 years ago

MatanYadaev commented 3 years ago

ESLint hangs after it finishes the lint successfully:

$ vue-cli-service lint
 DONE  No lint errors found!

I copied the config file into my .eslint.config.js file and tried to comment lines in order to find what leads to the issue.

I find out that it's these 3 lines: https://github.com/vuejs/eslint-config-airbnb/blob/cfa98d5f95be585d72e092f783178518cf3c0aa5/index.js#L9-L11

This is my config file:

module.exports = {
  root: true,
  env: {
    node: true,
  },
  plugins: [
    'import',
  ],
  extends: [
    'plugin:vue/recommended',
    '@vue/airbnb', # if I remove this line, the issue is gone
    'plugin:import/errors',
    'plugin:import/warnings',
  ],
  parserOptions: {
    parser: 'babel-eslint',
  },
  rules: {
    'no-use-before-define': 'off',
    'import/extensions': 'off',
    'no-param-reassign': 'off',
    'prefer-destructuring': 'off',
    radix: 'off',
    'max-len': ['warn', 180, 2, {
      ignoreUrls: true,
      ignoreComments: false,
      ignoreRegExpLiterals: true,
      ignoreStrings: true,
      ignoreTemplateLiterals: true,
    }],
    'import/no-extraneous-dependencies': 'off',
    'no-console': 'off',
    'import/no-unresolved': 'off',
    eqeqeq: 'off',
    'vue/this-in-template': 'off',
    'func-names': 'off',
    camelcase: 'off',
    'vue/require-default-prop': 'off',
    'vue/no-mutating-props': 'off',
    'consistent-return': 'off',
    'vue/no-v-html': 'off',
    'no-plusplus': 'off',
    'default-case': 'off',
    'import/prefer-default-export': 'off',
    'no-return-assign': 'off',
    'no-mixed-operators': 'off',
    'no-restricted-globals': 'off',
    'no-useless-escape': 'off',
    'vue/require-prop-types': 'off',
    'vue/no-parsing-error': 'off',
    'import/no-duplicates': 'off',
    'no-undef': 'off',
    'vue/no-unused-components': 'off',
    'guard-for-in': 'off',
    'no-continue': 'off',
    'vue/no-use-v-if-with-v-for': 'off',
    'no-shadow': 'off',
    'array-callback-return': 'off',
    'no-restricted-syntax': 'off',
    'vue/require-v-for-key': 'off',
    'no-useless-concat': 'off',
    'vue/no-template-shadow': 'off',
    'no-fallthrough': 'off',
    'vue/no-unused-vars': 'off',
    'new-cap': 'off',
    'no-nested-ternary': 'off',
    'vue/require-valid-default-prop': 'off',
    'no-async-promise-executor': 'off',
    'no-empty': 'off',
    'vue/return-in-computed-property': 'off',
    'vue/valid-v-for': 'off',
    'no-unused-expressions': 'off',
    'no-prototype-builtins': 'off',
    'prefer-promise-reject-errors': 'off',
    'no-case-declarations': 'off',
    'import/named': 'off',
    'no-underscore-dangle': 'off',
    'vue/component-tags-order': 'off',
  },
};

Packages:

haoqunjiang commented 2 years ago

Fixed in v7 as we no longer depend on eslint-import-resolver-webpack. It now requires users to explicitly configure aliases: https://github.com/vuejs/eslint-config-airbnb/tree/v7.0.0/packages/eslint-config-airbnb#aliases