Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Commit

Permalink
fix identifer to identifier typo - note missing (i) (#4657)
Browse files Browse the repository at this point in the history
  • Loading branch information
postama authored and Josh Goldberg committed Apr 13, 2019
1 parent 35db430 commit 2ca2f19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/develop/custom-rules/index.md
Expand Up @@ -6,7 +6,7 @@ permalink: "/develop/custom-rules/"

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.

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.
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.

__Important conventions__:

Expand Down
12 changes: 6 additions & 6 deletions src/rules/radixRule.ts
Expand Up @@ -59,25 +59,25 @@ function isPropertyAccessParseInt(

function isPropertyAccessOfIdentifier(
expression: ts.LeftHandSideExpression,
identifers: string[],
identifiers: string[],
): expression is ts.PropertyAccessExpression {
return (
isPropertyAccessExpression(expression) &&
isIdentifier(expression.expression) &&
identifers.some(identifer => (expression.expression as ts.Identifier).text === identifer)
identifiers.some(identifier => (expression.expression as ts.Identifier).text === identifier)
);
}

function isPropertyAccessOfProperty(
expression: ts.LeftHandSideExpression,
identifers: string[],
identifiers: string[],
): expression is ts.PropertyAccessExpression {
return (
isPropertyAccessExpression(expression) &&
isPropertyAccessExpression(expression.expression) &&
identifers.some(
identifer =>
(expression.expression as ts.PropertyAccessExpression).name.text === identifer,
identifiers.some(
identifier =>
(expression.expression as ts.PropertyAccessExpression).name.text === identifier,
)
);
}
Expand Down

0 comments on commit 2ca2f19

Please sign in to comment.