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

Linter doesn't work #16

Closed
sunabozu opened this issue Jan 29, 2016 · 11 comments
Closed

Linter doesn't work #16

sunabozu opened this issue Jan 29, 2016 · 11 comments
Labels

Comments

@sunabozu
Copy link

Hi.

Today I noticed eslint stopped working in tabs with opened .vue files. I'm pretty sure it worked before, and it still works for regular .jsfiles. Perhaps it has something to do with 1.4.1 update, although I'm not sure what packages this problem related to.

@aidistan
Copy link
Contributor

@sunabozu Compared to Atom's eslint interface packages, this repo is relative stable. I don't think here is the right place for your issue.

And if you really want us to help you, please provide more information about your environment, like:

  • the version of your Atom
  • the version of the eslint you currently use
  • the eslint interface package you use and its version (most important)

@sunabozu
Copy link
Author

As I mentioned above, eslint still works with plain js files, the problem occurs only with vue components. So I thought it has something to do with this package.

I have the latest versions of the mentioned packages: Atom 1.4.1, linter-eslint 6.0.0, base linter 1.11.3. Plus babel-eslint@4.1.6 (via npm).

I'm not quite sure what you mean by the interface package.

@aidistan
Copy link
Contributor

@sunabozu

  1. I said "this package is relative stable", which means the issue you complained about (it worked before, it works in .js but failed in .vue) is more likely caused by the eslint interface package rather than language-vue. And the suggestion I gave only aims at helping you solve the issue ASAP.
  2. linter-eslint you currently use is the interface package, which means it works as a bridge between Atom and eslint

This issue is most likely caused by following lines in linter-eslint/main.js :

const embeddedScope = 'source.js.embedded.html'
this.subscriptions.add(atom.config.observe('linter-eslint.lintHtmlFiles', lintHtmlFiles => {
  if (lintHtmlFiles) {
    this.scopes.push(embeddedScope)
  } else {
    if (this.scopes.indexOf(embeddedScope) !== -1) {
      this.scopes.splice(this.scopes.indexOf(embeddedScope), 1)
    }
  }
}))

The solution is to enable "Linter HTML Files" in the settings of linter-eslint and install eslint-plugin-html. (This works for me)


I had never used ESLint before and now I find it's awesome. Thx!

@sunabozu
Copy link
Author

Your solution works for me too. Thanks!

I guess, the problem is solved now.

@mixn
Copy link

mixn commented Sep 4, 2017

Since eslint-plugin-vue has now moved away from https://github.com/BenoitZugmeyer/eslint-plugin-html, I wonder what the best/right way is, to get linting feedback for .vue files inside Atom…? 🤔

@aidistan
Copy link
Contributor

aidistan commented Sep 4, 2017

Guess eslint-plugin-vue written by the vuejs community is a better choice.

@mikestopcontinues
Copy link

This topic merits reopening as this solution doesn't work with the eslint-plugin-vue, described by @mixn.

@jormar
Copy link

jormar commented Jan 22, 2018

Hi. I'm having this problem. The previous solution did not work for me

@ianpaschal
Copy link

Indeed, this solution no longer works.

@LiamKlyneker
Copy link

hi! is any solution like this for Sublime Text 3? :'(

@aldencolerain
Copy link

aldencolerain commented Sep 13, 2018

Following these instructions got Atom linting .vue files for me:
vuejs/eslint-plugin-vue#371 (comment)

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

No branches or pull requests

8 participants