| Summary: | .eslintrc file not found consistently | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Mark Macdonald <mamacdon> | ||||||||
| Component: | JS Tools | Assignee: | Michael Rennie <Michael_Rennie> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P2 | CC: | curtis.windatt.public, steve_northover | ||||||||
| Version: | unspecified | ||||||||||
| Target Milestone: | 14.0 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Mac OS X | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Mark Macdonald
I was running this build of the Orion electron app
> Build ID: 2017-01-31_14-51-08
This is the result of a timing issue. With the new support to sniff around to find a project context, it can happen that we are still trying to figure out the project when the call to perform the linting happens - which has no project context yet, and therefore does not read the .eslintrc file correctly. Created attachment 266572 [details]
Fix
Here is the fix. Curtis, can you sanity-check this before I push it? I removed one layer of promise from the project resolution code, and cleaned up the lint file reading code.
Created attachment 266573 [details]
updated fix
Updated patch
Created attachment 266574 [details]
better fix
Here is a better fix that properly rejects the next chained promise while reducing. Also adds support that if we "sniffed" and came up empty, we just assume the project context is "/file/"
To reproduce I had to insert a timeout in the project file read, otherwise my first lint operation always took long than the read. Once I forced the setup, testing the fix is relatively straight forward and it works as designed. There are some lint warnings in the code that should be fixed. +1 |