Skip to content

Commit 2ca2f19

Browse files
postamaJosh Goldberg
authored and
Josh Goldberg
committed
fix identifer to identifier typo - note missing (i) (palantir#4657)
1 parent 35db430 commit 2ca2f19

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

docs/develop/custom-rules/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ permalink: "/develop/custom-rules/"
66

77
TSLint ships with a set of core rules that can be configured. However, users are also allowed to write their own rules, which allows them to enforce specific behavior not covered by the core of TSLint. TSLint's internal rules are itself written to be pluggable, so adding a new rule is as simple as creating a new rule file named by convention. New rules can be written in either TypeScript or JavaScript; if written in TypeScript, the code must be compiled to JavaScript before invoking TSLint.
88

9-
Let us take the example of how to write a new rule to forbid all import statements (you know, *for science*). Let us name the rule file `noImportsRule.ts`. Rules are referenced in `tslint.json` with their kebab-cased identifer, so `"no-imports": true` would configure the rule.
9+
Let us take the example of how to write a new rule to forbid all import statements (you know, *for science*). Let us name the rule file `noImportsRule.ts`. Rules are referenced in `tslint.json` with their kebab-cased identifier, so `"no-imports": true` would configure the rule.
1010

1111
__Important conventions__:
1212

src/rules/radixRule.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -59,25 +59,25 @@ function isPropertyAccessParseInt(
5959

6060
function isPropertyAccessOfIdentifier(
6161
expression: ts.LeftHandSideExpression,
62-
identifers: string[],
62+
identifiers: string[],
6363
): expression is ts.PropertyAccessExpression {
6464
return (
6565
isPropertyAccessExpression(expression) &&
6666
isIdentifier(expression.expression) &&
67-
identifers.some(identifer => (expression.expression as ts.Identifier).text === identifer)
67+
identifiers.some(identifier => (expression.expression as ts.Identifier).text === identifier)
6868
);
6969
}
7070

7171
function isPropertyAccessOfProperty(
7272
expression: ts.LeftHandSideExpression,
73-
identifers: string[],
73+
identifiers: string[],
7474
): expression is ts.PropertyAccessExpression {
7575
return (
7676
isPropertyAccessExpression(expression) &&
7777
isPropertyAccessExpression(expression.expression) &&
78-
identifers.some(
79-
identifer =>
80-
(expression.expression as ts.PropertyAccessExpression).name.text === identifer,
78+
identifiers.some(
79+
identifier =>
80+
(expression.expression as ts.PropertyAccessExpression).name.text === identifier,
8181
)
8282
);
8383
}

0 commit comments

Comments
 (0)