diff --git a/docs/_data/rules.json b/docs/_data/rules.json index 664fe34a962..8178fee0058 100644 --- a/docs/_data/rules.json +++ b/docs/_data/rules.json @@ -59,16 +59,16 @@ "ruleName": "arrow-parens", "description": "Requires parentheses around the parameters of arrow function definitions.", "rationale": "Maintains stylistic consistency with other arrow function definitions.", - "optionsDescription": "\nif `avoid-on-single-parameter` is specified, then arrow functions with one parameter \nmust not have parentheses if removing them is allowed by TypeScript.", + "optionsDescription": "\nif `ban-single-arg-parens` is specified, then arrow functions with one parameter \nmust not have parentheses if removing them is allowed by TypeScript.", "options": { "type": "string", "enum": [ - "avoid-on-single-parameter" + "ban-single-arg-parens" ] }, "optionExamples": [ "true", - "[true, avoid-on-single-parameter]" + "[true, ban-single-arg-parens]" ], "type": "style", "typescriptOnly": false @@ -867,6 +867,14 @@ "type": "functionality", "typescriptOnly": false }, + { + "ruleName": "no-string-throw", + "description": "Flags throwing plain strings or concatenations of strings because only Errors produce proper stack traces.", + "options": null, + "optionsDescription": "", + "type": "functionality", + "typescriptOnly": false + }, { "ruleName": "no-switch-case-fall-through", "description": "Disallows falling through case statements.", diff --git a/docs/rules/arrow-parens/index.html b/docs/rules/arrow-parens/index.html index 2ca2e83db42..aa444f4c3e3 100644 --- a/docs/rules/arrow-parens/index.html +++ b/docs/rules/arrow-parens/index.html @@ -4,15 +4,15 @@ rationale: Maintains stylistic consistency with other arrow function definitions. optionsDescription: |- - if `avoid-on-single-parameter` is specified, then arrow functions with one parameter + if `ban-single-arg-parens` is specified, then arrow functions with one parameter must not have parentheses if removing them is allowed by TypeScript. options: type: string enum: - - avoid-on-single-parameter + - ban-single-arg-parens optionExamples: - 'true' - - '[true, avoid-on-single-parameter]' + - '[true, ban-single-arg-parens]' type: style typescriptOnly: false layout: rule @@ -21,7 +21,7 @@ { "type": "string", "enum": [ - "avoid-on-single-parameter" + "ban-single-arg-parens" ] } --- \ No newline at end of file diff --git a/src/rules/arrowParensRule.ts b/src/rules/arrowParensRule.ts index fabe078915e..964cb4bce87 100644 --- a/src/rules/arrowParensRule.ts +++ b/src/rules/arrowParensRule.ts @@ -20,7 +20,7 @@ import * as ts from "typescript"; import * as Lint from "../index"; import { hasModifier } from "../language/utils"; -const AVOID_ON_SINGLE_PARAMETER = "avoid-on-single-parameter"; +const BAN_SINGLE_ARG_PARENS = "ban-single-arg-parens"; export class Rule extends Lint.Rules.AbstractRule { /* tslint:disable:object-literal-sort-keys */ @@ -29,13 +29,13 @@ export class Rule extends Lint.Rules.AbstractRule { description: "Requires parentheses around the parameters of arrow function definitions.", rationale: "Maintains stylistic consistency with other arrow function definitions.", optionsDescription: Lint.Utils.dedent` - if \`${AVOID_ON_SINGLE_PARAMETER}\` is specified, then arrow functions with one parameter + if \`${BAN_SINGLE_ARG_PARENS}\` is specified, then arrow functions with one parameter must not have parentheses if removing them is allowed by TypeScript.`, options: { type: "string", - enum: [AVOID_ON_SINGLE_PARAMETER], + enum: [BAN_SINGLE_ARG_PARENS], }, - optionExamples: [`true`, `[true, ${AVOID_ON_SINGLE_PARAMETER}]`], + optionExamples: [`true`, `[true, ${BAN_SINGLE_ARG_PARENS}]`], type: "style", typescriptOnly: false, }; @@ -55,7 +55,7 @@ class ArrowParensWalker extends Lint.RuleWalker { constructor(sourceFile: ts.SourceFile, options: Lint.IOptions) { super(sourceFile, options); - this.avoidOnSingleParameter = this.hasOption(AVOID_ON_SINGLE_PARAMETER); + this.avoidOnSingleParameter = this.hasOption(BAN_SINGLE_ARG_PARENS); } public visitArrowFunction(node: ts.FunctionLikeDeclaration) { diff --git a/test/rules/arrow-parens/avoid-on-single-parameter/test.js.lint b/test/rules/arrow-parens/ban-single-arg-parens/test.js.lint similarity index 100% rename from test/rules/arrow-parens/avoid-on-single-parameter/test.js.lint rename to test/rules/arrow-parens/ban-single-arg-parens/test.js.lint diff --git a/test/rules/arrow-parens/avoid-on-single-parameter/test.ts.fix b/test/rules/arrow-parens/ban-single-arg-parens/test.ts.fix similarity index 100% rename from test/rules/arrow-parens/avoid-on-single-parameter/test.ts.fix rename to test/rules/arrow-parens/ban-single-arg-parens/test.ts.fix diff --git a/test/rules/arrow-parens/avoid-on-single-parameter/test.ts.lint b/test/rules/arrow-parens/ban-single-arg-parens/test.ts.lint similarity index 100% rename from test/rules/arrow-parens/avoid-on-single-parameter/test.ts.lint rename to test/rules/arrow-parens/ban-single-arg-parens/test.ts.lint diff --git a/test/rules/arrow-parens/avoid-on-single-parameter/tslint.json b/test/rules/arrow-parens/ban-single-arg-parens/tslint.json similarity index 63% rename from test/rules/arrow-parens/avoid-on-single-parameter/tslint.json rename to test/rules/arrow-parens/ban-single-arg-parens/tslint.json index c4aff29932b..feb3c4693a3 100644 --- a/test/rules/arrow-parens/avoid-on-single-parameter/tslint.json +++ b/test/rules/arrow-parens/ban-single-arg-parens/tslint.json @@ -2,13 +2,13 @@ "rules": { "arrow-parens": [ true, - "avoid-on-single-parameter" + "ban-single-arg-parens" ] }, "jsRules": { "arrow-parens": [ true, - "avoid-on-single-parameter" + "ban-single-arg-parens" ] } -} \ No newline at end of file +}