Can't get Atom Linter to work

我怕爱的太早我们不能终老 提交于 2021-02-06 09:35:06

问题


I'm new to Atom, the text edit, and I installed many packages, including Linter

https://github.com/AtomLinter/Linter

But it's not showing errors or highlighting code, it's just getting ignored.

Do any of you know what I should do to get this to work?


回答1:


You have to additionally install a linter package for your desired language.

Here is a list: https://atomlinter.github.io/




回答2:


I needed to remove atom config and start from scratch to make linter working

mv ~/.atom ~/.atom.bak



回答3:


Instead of opening atom from the terminal like I normally do, I opened it from the application icon. Then atom asks if it was ok to install linter dependencies and presto it was working.

Hope this helps.




回答4:


When I start Atom up, the small ui panel in bottom left is present, but shows zero values for the 3 severities.

If I then do a ctrl-s/save (even with no changes), it starts working..

In my package settings, I have "Lint on Open" (which doesn't seem to work at all) and "Lint on Change" (which is "only for supported providers" so could be that) ticked.




回答5:


i had to add the path of my project's node_modules dir to the atom's eslint package settings, as well as create an .eslinterc.json file in my project. After doing both those, i had to restart atom (i started it from the command line $ atom .) and it started working. Hope this helps someone.




回答6:


Here is my .eslintrc. Hope it helps.

module.exports = {
  root: true,
  "parserOptions": {
      "ecmaVersion": 7,
      "sourceType": "module",
      "ecmaFeatures": {
          "jsx": true,
      }
  },
  "extends" : "rallycoding",
  "rules": {
    "react/require-extension": "off"
  }
};


来源:https://stackoverflow.com/questions/29712232/cant-get-atom-linter-to-work

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!