Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit

Permalink
[FIX] Correct recommended warning rules (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-f1 authored and bradzacher committed Dec 23, 2018
1 parent 7765028 commit 4d85404
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/configs/recommended.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"camelcase": "off",
"typescript/camelcase": "error",
"typescript/class-name-casing": "error",
"typescript/explicit-function-return-type": "warning",
"typescript/explicit-function-return-type": "warn",
"typescript/explicit-member-accessibility": "error",
"indent": "off",
"typescript/indent": "error",
Expand All @@ -23,7 +23,7 @@
"no-array-constructor": "off",
"typescript/no-array-constructor": "error",
"typescript/no-empty-interface": "error",
"typescript/no-explicit-any": "warning",
"typescript/no-explicit-any": "warn",
"typescript/no-inferrable-types": "error",
"typescript/no-misused-new": "error",
"typescript/no-namespace": "error",
Expand All @@ -32,7 +32,7 @@
"typescript/no-parameter-properties": "error",
"typescript/no-triple-slash-reference": "error",
"no-unused-vars": "off",
"typescript/no-unused-vars": "warning",
"typescript/no-unused-vars": "warn",
"typescript/no-use-before-define": "error",
"typescript/no-var-requires": "error",
"typescript/prefer-interface": "error",
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/explicit-function-return-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = {
"Require explicit return types on functions and class methods",
category: "TypeScript",
url: util.metaDocsUrl("explicit-function-return-type"),
recommended: "warning",
recommended: "warn",
},
schema: [
{
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-explicit-any.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
extraDescription: [util.tslintRule("no-any")],
category: "TypeScript",
url: util.metaDocsUrl("no-explicit-any"),
recommended: "warning",
recommended: "warn",
},
schema: [],
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-unused-vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = Object.assign({}, baseRule, {
extraDescription: [util.tslintRule("no-unused-variable")],
category: "Variables",
url: util.metaDocsUrl("no-unused-vars"),
recommended: "warning",
recommended: "warn",
},
schema: baseRule.meta.schema,
},
Expand Down
7 changes: 7 additions & 0 deletions tools/update-recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ function generate() {
const ruleName = `typescript/${key}`;
const setting = allRules[key].meta.docs.recommended;

if (!["error", "warn"].includes(setting)) {
console.log(`ERR! Invalid level for rule ${key}: "${setting}"`);
// Don't want to throw an error since ^ explains what happened.
// eslint-disable-next-line no-process-exit
process.exit(1);
}

console.log(ruleName.padEnd(MAX_RULE_NAME_LENGTH), "=", setting);
config[ruleName] = setting;

Expand Down

0 comments on commit 4d85404

Please sign in to comment.