question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ESLint is ignoring .vue files

See original GitHub issue

Hello and thank you for this wonderful plugin. Tell us about your environment

  • ESLint Version:. 4.12.1
  • eslint-plugin-vue Version: 4.0.1
  • Node Version: 8.9.3

Please show your full configuration:

module.exports = {
  root: true,
  extends: 'standard',
  // extends: [
  //   'eslint:standard',
  //   'plugin:vue/essential'
  // ],
  parserOptions: {
    sourceType: 'module',
  },
  plugins: [
    'vue'
  ],
  env: {
    browser: true,
    commonjs: true,
    es6: true,
    jest: true,
    node: true
  },
  rules: {
    'no-console': 0,
    'no-undef': 0,
    'semi': [2, 'always'],
    'space-before-function-paren': 0,
    'object-property-newline': 0
  }
}

What did you expect to happen? With this config, ESLint is linting only .js files on every save and that’s my wanted behavior but also with .vue files in the src folder. When I try uncommenting the extends array, it does not work.

What actually happened? Please include the actual, raw output from ESLint. ESLint is throwing the classic ELIFECYCLE error with the current config. It was linting .js files in the root folder, but I can’t manage to make it work with .vue files. Also tried eslint-plugin-html, but the documentation said it can have onflicts with this plugin so I kicked it out of the project.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

55reactions
mysticateacommented, Jan 6, 2018

Our README.md mentions eslint:recommended embedded preset. On the other hand, standard is a shorthand of eslint-config-standard, and eslint:standard doesn’t exist.

The .eslintrc file does not control target files. Target files are decided by how eslint runs. For example, the CLI ./node_modules/.bin/eslint "src/**/*.{js,vue}" will lint .js and .vue files in src folder. If you use editor integrations, I think there is an editor setting to run ESLint on .vue files. For example, vscode needs the following setting:

{
    "eslint.validate": [
        "javascript",
        "javascriptreact",
        {"language": "vue", "autoFix": true}
    ]
}
16reactions
michalsnikcommented, Jan 6, 2018

Also you can use --ext flag while running eslint command:

eslint src --ext .js,.vue
Read more comments on GitHub >

github_iconTop Results From Across the Web

User Guide | eslint-plugin-vue
Turning off the rule in the ESLint configuration file does not ignore the warning. Using the <!-- eslint-disable --> comment does not suppress ......
Read more >
vue.js - How disable eslint warning for a specific line in a ...
I would like to dismiss this error on my vue file. I am trying to add this processor line
Read more >
ESLint: linting is not enabled in .vue files : WEB-27868
I see. Currently, we run eslint in vue files only if user specified vue plugin in eslint config file (in json format), or...
Read more >
Setting Up ESLint & Prettier In A Vue.js Project - Redberry
Since Prettier is a very opinionated tool, we can leave the file content blank. Now, let's discuss the cases when we create a...
Read more >
ESLint - Quasar Framework
Two dot files will be created: .eslintrc.js – ESLint configuration, including rules .eslintignore – what ESLint should ignore when linting. Further extension of ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found