diff --git a/packages/eslint-plugin-typescript/lib/configs/recommended.json b/packages/eslint-plugin-typescript/lib/configs/recommended.json index 58a2568e7ef..44d97034180 100644 --- a/packages/eslint-plugin-typescript/lib/configs/recommended.json +++ b/packages/eslint-plugin-typescript/lib/configs/recommended.json @@ -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", @@ -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", @@ -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", diff --git a/packages/eslint-plugin-typescript/lib/rules/explicit-function-return-type.js b/packages/eslint-plugin-typescript/lib/rules/explicit-function-return-type.js index f3402af23b2..c55def38a9a 100644 --- a/packages/eslint-plugin-typescript/lib/rules/explicit-function-return-type.js +++ b/packages/eslint-plugin-typescript/lib/rules/explicit-function-return-type.js @@ -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: [ { diff --git a/packages/eslint-plugin-typescript/lib/rules/no-explicit-any.js b/packages/eslint-plugin-typescript/lib/rules/no-explicit-any.js index fa7f6b624b7..557b3e85ed7 100644 --- a/packages/eslint-plugin-typescript/lib/rules/no-explicit-any.js +++ b/packages/eslint-plugin-typescript/lib/rules/no-explicit-any.js @@ -19,7 +19,7 @@ module.exports = { extraDescription: [util.tslintRule("no-any")], category: "TypeScript", url: util.metaDocsUrl("no-explicit-any"), - recommended: "warning", + recommended: "warn", }, schema: [], }, diff --git a/packages/eslint-plugin-typescript/lib/rules/no-unused-vars.js b/packages/eslint-plugin-typescript/lib/rules/no-unused-vars.js index a165fed4702..856b7511427 100644 --- a/packages/eslint-plugin-typescript/lib/rules/no-unused-vars.js +++ b/packages/eslint-plugin-typescript/lib/rules/no-unused-vars.js @@ -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, }, diff --git a/packages/eslint-plugin-typescript/tools/update-recommended.js b/packages/eslint-plugin-typescript/tools/update-recommended.js index 8d30d03112a..b80e41e332d 100644 --- a/packages/eslint-plugin-typescript/tools/update-recommended.js +++ b/packages/eslint-plugin-typescript/tools/update-recommended.js @@ -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;