0
votes

Update 27.10.17
updating linter-eslint to 8.4.0 did the trick, thanks to @holland's comment.

Original question:
Inside Atom Editor I get The package.json file could not be found. (import/no-extraneous-dependencies) error in all files, first line of code, but yarn lint passes through, meanings the problem is in the configuration of atom itself.

Any ideas?

List of lint packages currently installed:

  • linter 2.2.0
  • linter-csslint 2.0.0
  • linter-eslint 8.4.0
  • linter-flow 5.6.1
  • linter-ui-default 1.2.4

enter image description here

1
This question isn't very well-defined. Where is this error coming from? Is there a package.json file where it should be? The configuration of Atom is not the problem. Atom has no means of understanding code. It's the package you're using that you need to be looking at. - Holland Wilson
@HollandWilson correct, edited question, thanks - goldylucks
In the Settings view, please select Packages and type "lint" into the input box. You should see linter and any linter providers you've installed. Please share that list of packages. - Holland Wilson
updating linter-eslint to 8.4.0 did the trick. closing, thanks @HollandWilson, put your comments as answer if you want me to mark it as accepted :) - goldylucks
I don't feel like I really provided an answer here, so I just spieled about how to deal with unruly linter packages in general (it's come up before). - Holland Wilson

1 Answers

1
votes

By itself, Atom has no means of understanding whether code is good or not. This specific error is being generated by the linter-eslint package, which relies on the external binary eslint. Sometimes linters have arbitrary style requirements, and sometimes they get out of date and need to be updated. The typical process for troubleshooting linters is to take a look at the specific linter's rule set to see if the error is supposed to be thrown in that context. Since linters are intended for enforcing good coding style in addition to highlighting syntax errors, a linter-originating error doesn't necessarily mean that the code is bad and won't run. That's a question that must be answered on a case-by-case basis.

Testing linter packages generally requires a small amount of NPM experience (you can do it without Node, but it's easiest to download them via NPM). All you have to do is install the package globally and then run its command, which is trivially easy for someone who has done it before, but not necessarily easy for someone who doesn't know what the individual steps look like. For anyone reading this question in the future and dealing with a similar situation, I would recommend hopping onto the Atom forum or Slack and asking for a walkthrough.