Closed novemberborn closed 8 years ago
This might be clashing somewhat with #18. If we don't resolve the linter before we start the worker, we don't know if we're actually going to lint anything.
Maybe the key is to have the atom-part do the checking of package.json - see if there's a compatible linter in devDeps or one mentioned in standard-engine
. If that is the case, we start the lintWorker.
If the lintWorker cannot resolve the module it is most likely because we are in a project in which the user haven't yet run npm install
. We wouldn't want that situation to require a restart of atom to pick up on a post-atom-start installed linter.
When the lintWorker is poked to lint a piece of code, we check if we have a resolved linter - if we haven't we try to resolve it again...
At least this thing should go: https://github.com/gustavnikolaj/linter-js-standard-engine/blob/c3fdd41374118e76ee48606bc17112dd3a716335/lib/findOptions.js#L89-L92
It means that it will continue searching for a package.json file all up to the root, until it finds one that contains a linter dependency - or until it reaches the root and gives up. With the fixtures it means that we will effectively always fallback to the standard
linter used in the project itself.
The above referenced pull request made the change I suggested in my comment above.
@novemberborn could you try to elaborate here? I'm not sure that I understood the issue correctly :-)
It's these lines: https://github.com/gustavnikolaj/linter-js-standard-engine/blob/d55637cdfa406b0ac4e9d8236a9fe7f532164ece/lib/findOptions.js#L38:L40
We should only look at devDependencies
.
@novemberborn Good point! Doesn't make sense to have three different ways of testing for the presence. :-)
Follow-up from https://github.com/gustavnikolaj/linter-js-standard-engine/pull/15#issuecomment-256896370: