Eslint-plugin-vue: Seems not compatible with eslint-babel parser

Created on 6 Sep 2017  路  1Comment  路  Source: vuejs/eslint-plugin-vue

Tell us about your environment

  • ESLint Version: v4.6.1
  • eslint-plugin-vue Version: v3.13.0
  • Node Version: both node/8.4.0 or 6.11.2 tried

Please show your full configuration:

// http://eslint.org/docs/user-guide/configuring

module.exports = {
  root: true,
  parser: 'babel-eslint',
  parserOptions: {
    sourceType: 'module'
  },
  env: {
    browser: true,
  },
  // https://github.com/standard/standard/blob/master/docs/RULES-en.md
  extends: ['standard', 'plugin:vue/recommended'],
  // required to lint *.vue files
  plugins: [
    'import',
  ],
  // add your custom rules here
  'rules': {
    // allow paren-less arrow functions
    'arrow-parens': 0,
    // allow async-await
    'generator-star-spacing': 0,
    // allow debugger during development
    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
    'comma-dangle': 0
  }
}

I use this config and throw a error:

Error while loading rule 'vue/no-confusing-v-for-v-if': Cannot convert undefined or null to object

but when remove parser: 'babel-eslint', it doesn't throw error.

What did you expect to happen?
Works normally with babel-eslint parser.

Most helpful comment

@xekri you should try

- "parser": "babel-eslint",
  "parserOptions": {
+     "parser": "babel-eslint",
      "sourceType": "module"
  }

https://github.com/vuejs/eslint-plugin-vue#couple-faq

>All comments

@xekri you should try

- "parser": "babel-eslint",
  "parserOptions": {
+     "parser": "babel-eslint",
      "sourceType": "module"
  }

https://github.com/vuejs/eslint-plugin-vue#couple-faq

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rodrigoabb picture rodrigoabb  路  3Comments

maple-leaf picture maple-leaf  路  3Comments

casprwang picture casprwang  路  4Comments

mitar picture mitar  路  3Comments

filipalacerda picture filipalacerda  路  4Comments