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 261907 Details for
Bug 493838
[es6] Warn user when es_modules is disabled when import/export is used
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]
Proposed patch
493838.patch (text/plain), 3.08 KB, created by
Olivier Thomann
on 2016-05-20 13:53:35 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2016-05-20 13:53:35 EDT
Size:
3.08 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/load-rules-async.js b/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/load-rules-async.js >index e7d89d6..3e0882c 100644 >--- a/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/load-rules-async.js >+++ b/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/load-rules-async.js >@@ -15,7 +15,6 @@ > */ > define([ > './util', >-'javascript/logger', > 'javascript/finder', > 'i18n!javascript/nls/problems', > 'estraverse/estraverse', >@@ -34,7 +33,7 @@ define([ > './rules/no-obj-calls', > './rules/no-self-compare', > './rules/no-irregular-whitespace', >-], function(util, Logger, Finder, ProblemMessages, Estraverse, JsSyntax, >+], function(util, Finder, ProblemMessages, Estraverse, JsSyntax, > accessorPairs, noControlRegex, noDuplicateCase, noElseReturn, noEmptyCharClasses, > noEmptyLabel, noEqNull, noExtraBoolCast, noExtraParens, noInvalidRegExp, noNegatedInLhs, noObjCalls, noSelfCompare, noIrregularWhitespace) { > >@@ -1913,12 +1912,24 @@ define([ > context.report(node, ProblemMessages['unknown-require-missing-env'], {0: _name, pid: 'unknown-require-missing-env', nls: 'unknown-require-missing-env', data: _name}); > } > } >+ function checkImportExport(node) { >+ var tern = context.getTern(); >+ if(!tern.pluginRunning("es_modules")) { >+ // create a location object to flag only the 'import' keyword >+ var token = context.getFirstToken(node); >+ context.report(node, ProblemMessages['esmodules-not-running'], {pid: 'unknown-require-not-running', nls: 'unknown-require-not-running', data: "es_modules"}, token); >+ } >+ } > return { > "Program": function(node) { > directive = Finder.findDirective(node, 'eslint-env'); > }, >- "CallExpression": function(node) { >- if(node.callee.name === "require") { >+ "ImportDeclaration" : checkImportExport, >+ "ExportAllDeclaration" : checkImportExport, >+ "ExportDefaultDeclaration" : checkImportExport, >+ "ExportNamedDeclaration" : checkImportExport, >+ "CallExpression": function(node) { >+ if(node.callee.name === "require") { > var args = node.arguments; > if(args.length === 1) { > var lib = args[0]; >diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/nls/root/problems.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/nls/root/problems.js >index eaef40c..72f0c62 100644 >--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/nls/root/problems.js >+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/nls/root/problems.js >@@ -112,6 +112,7 @@ define({ > 'valid-typeof' : 'Invalid typeof comparison.', > 'valid-typeof-description': 'Warn when incorrectly comparing the result of a typeof expression.', > 'noErrorDetailed' : 'No error\'s message', >+ 'esmodules-not-running' : 'import/export declarations cannot be used without having \'esmodules\' plug-in to be running.', > > // Rules consumed from ESLint > 'accessor-pairs-description' : "Report when accessors don't come in pairs (getter, setter)",
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 493838
: 261907