Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 493838
Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/load-rules-async.js (-4 / +15 lines)
Lines 15-21 Link Here
15
 */
15
 */
16
define([
16
define([
17
'./util',
17
'./util',
18
'javascript/logger',
19
'javascript/finder',
18
'javascript/finder',
20
'i18n!javascript/nls/problems',
19
'i18n!javascript/nls/problems',
21
'estraverse/estraverse',
20
'estraverse/estraverse',
Lines 34-40 define([ Link Here
34
'./rules/no-obj-calls',
33
'./rules/no-obj-calls',
35
'./rules/no-self-compare',
34
'./rules/no-self-compare',
36
'./rules/no-irregular-whitespace',
35
'./rules/no-irregular-whitespace',
37
], function(util, Logger, Finder, ProblemMessages, Estraverse, JsSyntax,
36
], function(util, Finder, ProblemMessages, Estraverse, JsSyntax,
38
		accessorPairs, noControlRegex, noDuplicateCase, noElseReturn, noEmptyCharClasses, 
37
		accessorPairs, noControlRegex, noDuplicateCase, noElseReturn, noEmptyCharClasses, 
39
		noEmptyLabel, noEqNull, noExtraBoolCast, noExtraParens, noInvalidRegExp, noNegatedInLhs, noObjCalls, noSelfCompare, noIrregularWhitespace) {
38
		noEmptyLabel, noEqNull, noExtraBoolCast, noExtraParens, noInvalidRegExp, noNegatedInLhs, noObjCalls, noSelfCompare, noIrregularWhitespace) {
40
	
39
	
Lines 1913-1924 define([ Link Here
1913
        			context.report(node, ProblemMessages['unknown-require-missing-env'], {0: _name, pid: 'unknown-require-missing-env', nls: 'unknown-require-missing-env', data: _name});
1912
        			context.report(node, ProblemMessages['unknown-require-missing-env'], {0: _name, pid: 'unknown-require-missing-env', nls: 'unknown-require-missing-env', data: _name});
1914
        		}
1913
        		}
1915
        	}
1914
        	}
1915
			function checkImportExport(node) {
1916
				var tern = context.getTern();
1917
				if(!tern.pluginRunning("es_modules")) {
1918
					// create a location object to flag only the 'import' keyword
1919
					var token = context.getFirstToken(node);
1920
					context.report(node, ProblemMessages['esmodules-not-running'], {pid: 'unknown-require-not-running', nls: 'unknown-require-not-running', data: "es_modules"}, token);
1921
				}
1922
			}
1916
        	return {
1923
        	return {
1917
        		"Program": function(node) {
1924
        		"Program": function(node) {
1918
        			directive = Finder.findDirective(node, 'eslint-env');
1925
        			directive = Finder.findDirective(node, 'eslint-env');
1919
        		},
1926
        		},
1920
        		"CallExpression": function(node) {
1927
				"ImportDeclaration" : checkImportExport,
1921
        			if(node.callee.name === "require") {
1928
				"ExportAllDeclaration" : checkImportExport,
1929
				"ExportDefaultDeclaration" : checkImportExport,
1930
				"ExportNamedDeclaration" : checkImportExport,
1931
				"CallExpression": function(node) {
1932
      				if(node.callee.name === "require") {
1922
        				var args = node.arguments;
1933
        				var args = node.arguments;
1923
        				if(args.length === 1) {
1934
        				if(args.length === 1) {
1924
        					var lib = args[0];
1935
        					var lib = args[0];
(-)a/bundles/org.eclipse.orion.client.javascript/web/javascript/nls/root/problems.js (+1 lines)
Lines 112-117 define({ Link Here
112
	'valid-typeof' : 'Invalid typeof comparison.',
112
	'valid-typeof' : 'Invalid typeof comparison.',
113
	'valid-typeof-description': 'Warn when incorrectly comparing the result of a typeof expression.',
113
	'valid-typeof-description': 'Warn when incorrectly comparing the result of a typeof expression.',
114
	'noErrorDetailed' : 'No error\'s message',
114
	'noErrorDetailed' : 'No error\'s message',
115
	'esmodules-not-running' : 'import/export declarations cannot be used without having \'esmodules\' plug-in to be running.',
115
	
116
	
116
	// Rules consumed from ESLint
117
	// Rules consumed from ESLint
117
	'accessor-pairs-description' : "Report when accessors don't come in pairs (getter, setter)",
118
	'accessor-pairs-description' : "Report when accessors don't come in pairs (getter, setter)",

Return to bug 493838