aboutsummaryrefslogtreecommitdiffstats
path: root/packages/tslint-config/rules
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-01-31 06:02:13 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-01-31 06:02:13 +0800
commit4d0ff0dce4bdef031f19a2ec8891ae58f98616ee (patch)
tree94144a4ac1d367c7a20ca0a0f899c1e0308347fa /packages/tslint-config/rules
parent8aac6e46d4f23fe8eee6116aeb9570945dc9df23 (diff)
downloaddexon-sol-tools-4d0ff0dce4bdef031f19a2ec8891ae58f98616ee.tar
dexon-sol-tools-4d0ff0dce4bdef031f19a2ec8891ae58f98616ee.tar.gz
dexon-sol-tools-4d0ff0dce4bdef031f19a2ec8891ae58f98616ee.tar.bz2
dexon-sol-tools-4d0ff0dce4bdef031f19a2ec8891ae58f98616ee.tar.lz
dexon-sol-tools-4d0ff0dce4bdef031f19a2ec8891ae58f98616ee.tar.xz
dexon-sol-tools-4d0ff0dce4bdef031f19a2ec8891ae58f98616ee.tar.zst
dexon-sol-tools-4d0ff0dce4bdef031f19a2ec8891ae58f98616ee.zip
Add protected keyword to underscore lint rule
Diffstat (limited to 'packages/tslint-config/rules')
-rw-r--r--packages/tslint-config/rules/underscorePrivateAndProtectedRule.ts (renamed from packages/tslint-config/rules/underscorePrivatesRule.ts)4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/tslint-config/rules/underscorePrivatesRule.ts b/packages/tslint-config/rules/underscorePrivateAndProtectedRule.ts
index 472ea09ff..2f05b0c18 100644
--- a/packages/tslint-config/rules/underscorePrivatesRule.ts
+++ b/packages/tslint-config/rules/underscorePrivateAndProtectedRule.ts
@@ -12,7 +12,7 @@ type RelevantClassMember =
// Copied from: https://github.com/DanielRosenwasser/underscore-privates-tslint-rule
// The version on github is not published on npm
export class Rule extends Lint.Rules.AbstractRule {
- public static FAILURE_STRING = 'private members must be prefixed with an underscore';
+ public static FAILURE_STRING = 'private and protected members must be prefixed with an underscore';
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
return this.applyWithFunction(sourceFile, walk);
@@ -54,7 +54,7 @@ function nameStartsWithUnderscore(text: string) {
return text.charCodeAt(0) === UNDERSCORE.charCodeAt(0);
}
function memberIsPrivate(node: ts.Declaration) {
- return Lint.hasModifier(node.modifiers, ts.SyntaxKind.PrivateKeyword);
+ return Lint.hasModifier(node.modifiers, ts.SyntaxKind.PrivateKeyword, ts.SyntaxKind.ProtectedKeyword);
}
function nameIsIdentifier(node: ts.Node): node is ts.Identifier {
return node.kind === ts.SyntaxKind.Identifier;