Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 431054

Summary: ESlint should not report problems on commented-out script blocks
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 5.0   
Target Milestone: 6.0 M2   
Hardware: All   
OS: All   
Whiteboard:

Description Michael Rennie CLA 2014-03-24 14:42:45 EDT
Open the following:

<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>Orion JavaScript Support</title>
	<link rel="stylesheet" type="text/css" href="../../settings/settings.css"/>
	<script src="../../requirejs/require.js"></script>
	<script type="text/javascript">
		/*jslint amd:true require*/
		require({
			baseUrl: "../../",
			paths: {
				text: "requirejs/text",
				esprima: "esprima/esprima",
				estraverse: "estraverse/estraverse",
				escope: "escope/escope"
			},
			packages: [
				{
					name: "eslint",
					location: "eslint/lib",
					main: "eslint"
				},
				{
					name: "eslint/conf",
					main: "eslint/conf"
			}]
		});

		require(["javascriptPlugin.js"]);
	</script>
<!--
	<script>
		/*jslint browser:true*/
		document.addEventListener("DOMContentLoaded", function(e) {
			var checkbox = document.getElementById("useworker");
			var key = "jstools.worker", value = localStorage.getItem(key), defaultState = true;
			checkbox.checked = value ? JSON.parse(value) : defaultState;
			checkbox.onchange = function(event) {
				var newState = !!event.target.checked;
				if (newState === defaultState)
					localStorage.removeItem(key);
				else
					localStorage.setItem(key, JSON.stringify(newState));
			};
		});
	</script>
-->
</head>
<body>
</body>
</html>

Provided you have the option to report statements not in braces, you will see two warnings in the commented out block.
Comment 1 Michael Rennie CLA 2014-05-08 01:26:54 EDT
Pushed fix + tests to:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=68339e9efc35997548aa866d1163ec510371488d

I ended up adding a new Finder function just in case we have need to find HTML comment blocks in the future.