Skip to content

vue/no-parsing-error not reporting when using eslint-loader + webpack #537

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

Closed
OliverJEvans opened this issue Jul 25, 2018 · 2 comments
Closed

Comments

@OliverJEvans
Copy link

OliverJEvans commented Jul 25, 2018

Tell us about your environment

  • ESLint Version: 5.2.0 (although also happens on 4.19.1)
  • eslint-plugin-vue Version: 5.0.0-beta.0 (although also happens on 4.2.2)
  • Node Version: 8.11.2
  • eslint-loader Version: 2.1.0
  • webpack Version: 3.12.0

Please show your full configuration:

.eslintrc.json

{
    "extends": [
        "plugin:vue/essential"
    ]
}

webpack config - module rules

{
    enforce: 'pre',
    test: /\.(js|vue)$/,
    exclude: /node_modules/,
    loader: 'eslint-loader',
    options: {
        cache: false,
        configFile: path.join(process.cwd(), '.eslintrc.json')
    },
}

What did you expect to happen?

When using eslint cli, vue/no-parsing-error errors as expected when there's empty braces in a vue app {{}}. But when using eslint-loader for webpack the error does not appear.

Unsure if this is the only rule that is affected but so far it appears to be the only one.

Also unsure if this is an issue with eslint-loader or the rule itself but hopefully we can figure out where to point fingers.

I can recreate this by:

  • Creating a new vue cli project using the webpack-simple template (vue init webpack-simple)
  • Installing eslint-plugin-vue, eslint and the eslint-loader
  • Add the webpack config above to the default config
  • Add the .eslintrc.json file.
  • Put some empty braces in the App.vue file
  • Run eslint cli & webpack
  • Compare results
@mysticatea
Copy link
Member

Thank you for this issue.

The result of no-parsing-error rule depends on only source code text.
So if you see different behavior between eslint and eslint-loader, it can be an issue of eslint-loader.

And please note that the latest vue-eslint-parser changed the behavior around empty mustaches to fix #398. The vue/no-parsing-error rule no longer reports empty mustaches on the latest version (https://github.com/mysticatea/vue-eslint-parser/releases/tag/v3.2.0).

@soddygo
Copy link

soddygo commented Jan 10, 2019

it help me to solver this problem

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

3 participants