Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 266572 Details for
Bug 511478
.eslintrc file not found consistently
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fix
lint-option-sync.patch (text/plain), 5.48 KB, created by
Michael Rennie
on 2017-02-01 12:33:00 EST
(
hide
)
Description:
Fix
Filename:
MIME Type:
Creator:
Michael Rennie
Created:
2017-02-01 12:33:00 EST
Size:
5.48 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/javascriptProject.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/javascriptProject.js >index 8a539f5..a01c435 100644 >--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/javascriptProject.js >+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/javascriptProject.js >@@ -79,6 +79,7 @@ define([ > this.fileClient = null; > this.handlers = [eslintHandler]; > this.projectFiles = [this.PACKAGE_JSON, this.TERN_PROJECT, this.ESLINTRC, this.ESLINTRC_JS, this.ESLINTRC_JSON, this.ESLINTRC_YAML, this.ESLINTRC_YML]; >+ this.lintFiles = [this.ESLINTRC_JS, this.ESLINTRC_JSON, this.ESLINTRC, this.ESLINTRC_YAML, this.ESLINTRC_YML]; > } > /** > * The .tern-project file name >@@ -307,50 +308,34 @@ define([ > * @see http://eslint.org/docs/user-guide/configuring > */ > JavaScriptProject.prototype.getESlintOptions = function getESlintOptions() { >+ var deferred = new Deferred(); > if(this.map.eslint) { >- return new Deferred().resolve(this.map.eslint); >+ return deferred.resolve(this.map.eslint); > } >- var vals; >- return this.getFile(this.ESLINTRC_JS).then(function(file) { >- vals = readAndMap(this.map, file, "eslint"); >- if(vals) { >- return vals; >- } >- return this.getFile(this.ESLINTRC_JSON).then(function(file) { >- vals = readAndMap(this.map, file, "eslint"); >- if(vals) { >- return vals; >- } >- return this.getFile(this.ESLINTRC).then(function(file) { >- vals = readAndMap(this.map, file, "eslint"); >- if(vals) { >- return vals; >- } >- return this.getFile(this.ESLINTRC_YAML).then(function(file) { >- vals = readAndMap(this.map, file, "eslint"); >- if (vals) { >- return vals; >- } >- return this.getFile(this.ESLINTRC_YML).then(function(file) { >- vals = readAndMap(this.map, file, "eslint"); >- if (vals) { >- return vals; >- } >- return this.getFile(this.PACKAGE_JSON).then(function(file) { >- if(file && file.contents) { >- vals = JSON.parse(file.contents); >- if(vals.eslintConfig !== null && typeof vals.eslintConfig === 'object' && Object.keys(vals.eslintConfig).length > 0) { >- this.map.eslint = vals.eslintConfig; >- return this.map.eslint; >- } >- } >- return null; >- }.bind(this)); >- }.bind(this)); >- }.bind(this)); >- }.bind(this)); >- }.bind(this)); >- }.bind(this)); >+ this.projectPromise.then(function() { >+ this.lintFiles.reduce(function(prev, next) { >+ if(next === this.PACKAGE_JSON) { >+ return this.getFile(next).then(function(file) { >+ if(file && file.contents) { >+ var vals = JSON.parse(file.contents); >+ if(vals.eslintConfig !== null && typeof vals.eslintConfig === 'object' && Object.keys(vals.eslintConfig).length > 0) { >+ this.map.eslint = vals.eslintConfig; >+ deferred.resolve(this.map.eslint); >+ } >+ } >+ return null; >+ }.bind(this)) >+ } >+ return this.getFile(next).then(function(file) { >+ var vals = readAndMap(this.map, file, "eslint"); >+ if(vals) { >+ deferred.resolve(vals); >+ throw new Error("stop"); >+ } >+ }.bind(this)); >+ }.bind(this) , new Deferred().resolve()); >+ }.bind(this)); >+ return deferred; > }; > > /** >@@ -416,6 +401,7 @@ define([ > initialized = true; > var file = evnt.file; > resolveProject.call(this, file).then(function(project) { >+ this.projectPromise.resolve(project); > if (project) { > if(!this.projectMeta || project.Location !== this.projectMeta.Location) { > this.projectMeta = project; >@@ -449,6 +435,7 @@ define([ > */ > function resolveProject(file) { > var deferred = new Deferred(); >+ this.projectPromise = new Deferred(); > if(file) { > if(this.projectMeta && file.Location && file.Location.startsWith(this.projectMeta.Location)) { > deferred.resolve(this.projectMeta); >@@ -463,19 +450,17 @@ define([ > var promises = [], > prnt = parents[parents.length-1]; > this.projectFiles.forEach(function(_f) { >- promises.push(this.getFile(_f, prnt.Location)); >- promises.push(this.getFile(_f, "/file/")); >+ promises.push({f: _f, p: prnt.Location}); >+ promises.push({p: "/file/", f:_f}); > }.bind(this)); > promises.reduce(/* @callback */ function(prev, item) { >- return prev.then(/* @callback */ function(value) { >- return item.then(function(_file) { >- if(_file) { >- deferred.resolve({Location: _file.project}); >- throw new Error("stop"); >- } >- }); >- }); >- }, new Deferred().resolve()); >+ return this.getFile(item.f, item.p).then(function(_file) { >+ if(_file && _file.contents) { >+ deferred.resolve({Location: _file.project}); >+ throw new Error("stop"); >+ } >+ }); >+ }.bind(this), new Deferred().resolve()); > } else { > deferred.resolve(parents[parents.length-1]); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 511478
:
266572
|
266573
|
266574