aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Rennie2013-12-18 11:09:37 (EST)
committerGerrit Code Review @ Eclipse.org2013-12-18 13:43:07 (EST)
commit3c47a6fcec019aeaef128b9563891003b791394f (patch)
treec471857111ee3a8405eda8a065552b356b273365
parenta06fed364882f1ef7addb255f4a28ed7b4cda232 (diff)
downloadorg.eclipse.orion.client-3c47a6fcec019aeaef128b9563891003b791394f.zip
org.eclipse.orion.client-3c47a6fcec019aeaef128b9563891003b791394f.tar.gz
org.eclipse.orion.client-3c47a6fcec019aeaef128b9563891003b791394f.tar.bz2
Bug 424268 - provide configurable severities for eslint rulesrefs/changes/91/19991/2
Change-Id: I276892b8af2303296bce891b7d2aec6ef4cb1692 Signed-off-by: Mike Rennie <Michael_Rennie@ca.ibm.com>
-rw-r--r--bundles/org.eclipse.orion.client.javascript/web/javascript/eslint/validator.js18
-rw-r--r--bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/javascriptPlugin.js62
2 files changed, 79 insertions, 1 deletions
diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/eslint/validator.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/eslint/validator.js
index 96ae235..7c16b7a 100644
--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/eslint/validator.js
+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/eslint/validator.js
@@ -127,6 +127,24 @@ define([
if (typeof properties.active === "boolean") { //$NON-NLS-0$
this.active = properties.active;
}
+ if(typeof properties.validate_eqeqeq === "number") {
+ config.rules["eqeqeq"] = properties.validate_eqeqeq;
+ }
+ if(typeof properties.validate_no_redeclare === "number") {
+ config.rules["no-redeclare"] = properties.validate_no_redeclare;
+ }
+ if(typeof properties.validate_no_undef === "number") {
+ config.rules["no-undef"] = properties.validate_no_undef;
+ }
+ if(typeof properties.validate_no_unused_vars === "number") {
+ config.rules["no-unused-vars"] = properties.validate_no_unused_vars;
+ }
+ if(typeof properties.validate_missing_semi === "number") {
+ config.rules["semi"] = properties.validate_missing_semi;
+ }
+ if(typeof properties.validate_use_before_define === "number") {
+ config.rules["semi"] = properties.validate_use_before_define;
+ }
}
});
/**
diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/javascriptPlugin.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/javascriptPlugin.js
index fba2862..2397867 100644
--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/javascriptPlugin.js
+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/javascriptPlugin.js
@@ -112,6 +112,66 @@ define([
name: "Use ESLint to validate JavaScript files",
type: "boolean",
defaultValue: true
+ },
+ { id: "validate_eqeqeq",
+ name: "Discouraged '==' use",
+ type: "number",
+ defaultValue: 1,
+ options: [
+ {label: "Ignore", value:0},
+ {label: "Warning", value:1},
+ {label: "Error", value:2}
+ ]
+ },
+ { id: "validate_use_before_define",
+ name: "Member used before definition",
+ type: "number",
+ defaultValue: 1,
+ options: [
+ {label: "Ignore", value:0},
+ {label: "Warning", value:1},
+ {label: "Error", value:2}
+ ]
+ },
+ { id: "validate_missing_semi",
+ name: "Missing semicolons",
+ type: "number",
+ defaultValue: 1,
+ options: [
+ {label: "Ignore", value:0},
+ {label: "Warning", value:1},
+ {label: "Error", value:2}
+ ]
+ },
+ { id: "validate_no_undef",
+ name: "Undefined member use",
+ type: "number",
+ defaultValue: 2,
+ options: [
+ {label: "Ignore", value:0},
+ {label: "Warning", value:1},
+ {label: "Error", value:2}
+ ]
+ },
+ { id: "validate_no_unused_vars",
+ name: "Unused variables",
+ type: "number",
+ defaultValue: 1,
+ options: [
+ {label: "Ignore", value:0},
+ {label: "Warning", value:1},
+ {label: "Error", value:2}
+ ]
+ },
+ { id: "validate_no_redeclare",
+ name: "Variable re-declarations",
+ type: "number",
+ defaultValue: 1,
+ options: [
+ {label: "Ignore", value:0},
+ {label: "Warning", value:1},
+ {label: "Error", value:2}
+ ]
}
]
}
@@ -119,4 +179,4 @@ define([
});
provider.connect();
-}); \ No newline at end of file
+});