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

fix identifer to identifier typo - note missing (i) #4657

Merged
merged 1 commit into from
Apr 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/develop/custom-rules/index.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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