Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin broken after upgrade to ESLint 6.0.0 #911

Closed
Baune8D opened this issue Jun 22, 2019 · 5 comments
Closed

Plugin broken after upgrade to ESLint 6.0.0 #911

Baune8D opened this issue Jun 22, 2019 · 5 comments

Comments

@Baune8D
Copy link

Baune8D commented Jun 22, 2019

Tell us about your environment

  • ESLint version: 6.0.0
  • eslint-plugin-vue version: 5.2.2
  • Node version: 10.15.3

Please show your full configuration:

module.exports = {
  env: {
    browser: true,
    commonjs: true,
    es6: true,
    node: true,
    jquery: true,
  },
  extends: [
    'eslint:recommended',
    'airbnb-base',
    'plugin:vue/recommended',
    'plugin:prettier/recommended',
    'prettier/vue',
  ],
  parser: 'vue-eslint-parser',
  parserOptions: {
    parser: 'babel-eslint',
    babelOptions: {
      configFile: require.resolve(
        `@<package>/build/configs/babel.config.vue.js`,
      ),
    },
  },
  overrides: [
    {
      files: ['**/*.ts', '**/*.vue'],
      extends: [
        'eslint:recommended',
        'airbnb-base',
        'plugin:@typescript-eslint/eslint-recommended',
        'plugin:@typescript-eslint/recommended',
        'plugin:vue/recommended',
        'plugin:prettier/recommended',
        'prettier/@typescript-eslint',
        'prettier/vue',
      ],
      parser: 'vue-eslint-parser',
      parserOptions: {
        parser: '@typescript-eslint/parser',
        project: path.resolve(<tsconfigPath>, 'tsconfig.json'),
        extraFileExtensions: ['.vue'],
      },
    },
  ],
  settings: {
    'import/resolver': {
      typescript: {
        directory: <tsconfigPath>,
      },
      webpack: {
        config: {
          resolve: {
            alias: <aliases>,
            extensions: ['.js', '.ts, '.vue'],
          },
        },
      },
    },
  },
};

What did you do?
Upgrade ESLint to 6.0.0.

Problem occurs here:

const Traverser = require('eslint/lib/util/traverser')

This seems to be the same basic issue as here:
typescript-eslint/typescript-eslint#563

Comment

traverser.js has been moved from lib/util/traverser.js to lib/shared/traverser.js
in commit eslint#219aecb PR eslint#11555

What did you expect to happen?
Lint successfully

What actually happened?
Error: Failed to load plugin 'vue' declared in 'Assets/.eslintrc.js': Cannot find module 'eslint/lib/util/traverser'
Referenced from: /<path>/Assets/.eslintrc.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (/<path>/node_modules/eslint-plugin-vue/lib/rules/order-in-components.js:8:19)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)

@Baune8D
Copy link
Author

Baune8D commented Jun 22, 2019

There seems to be a PR regarding this issue here: #910

@yi-ge
Copy link

yi-ge commented Jun 23, 2019

I have the same problem.

@guastallaigor
Copy link

Same problem here, any workaround is appreciated.

@shlima
Copy link

shlima commented Jun 25, 2019

+1

@Baune8D
Copy link
Author

Baune8D commented Jun 25, 2019

This issue seems to be resolved in v5.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants