aboutsummaryrefslogtreecommitdiffstats
path: root/packages/tslint-config
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-02-01 07:30:09 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-02-01 07:30:09 +0800
commit03cb7233dc5b8556952b4481f87a292e0fca1acf (patch)
tree4c203211a7ce7b0f44ebc45bb6c40621d4ee5b7e /packages/tslint-config
parent3a1ca32ff172f735e4b69f125fea4237c83643f0 (diff)
parent6682abf89dcdf566f05f8d88cb6af06c4bb1f6a2 (diff)
downloaddexon-sol-tools-03cb7233dc5b8556952b4481f87a292e0fca1acf.tar
dexon-sol-tools-03cb7233dc5b8556952b4481f87a292e0fca1acf.tar.gz
dexon-sol-tools-03cb7233dc5b8556952b4481f87a292e0fca1acf.tar.bz2
dexon-sol-tools-03cb7233dc5b8556952b4481f87a292e0fca1acf.tar.lz
dexon-sol-tools-03cb7233dc5b8556952b4481f87a292e0fca1acf.tar.xz
dexon-sol-tools-03cb7233dc5b8556952b4481f87a292e0fca1acf.tar.zst
dexon-sol-tools-03cb7233dc5b8556952b4481f87a292e0fca1acf.zip
Merge branch 'development' into feature/testnet-faucets/order-dispenser
* development: (49 commits) Prettier Updated contract generation in 0x to new abi-gen CLI Add PR number to changelog Fix lint errors Removed deprecated CLI options Add protected keyword to underscore lint rule Remove unused prop Fix prettier Uppercase Networks enum values Make default gasPrice more readable Fix prettier mess Fix linter errors Shrink img Fix all setState calls after unmounted errors. Decided to create our own flag rather then using a cancellablePromise since there was little to be gained from this alternative Fix bug where we were return undefined instead of the empty object Default the derivation path to that found in the Ledger subprovider Add browser data to dialog info Add Rinkeby support Pass in whether we want the personal message prefix appended and never append it for Ledger. This fixes signing when Ledger is used and the backing node is not Parity Wholesale replace the tokenByAddress and de-dup properly ...
Diffstat (limited to 'packages/tslint-config')
-rw-r--r--packages/tslint-config/CHANGELOG.md4
-rw-r--r--packages/tslint-config/rules/underscorePrivateAndProtectedRule.ts (renamed from packages/tslint-config/rules/underscorePrivatesRule.ts)4
-rw-r--r--packages/tslint-config/tslint.json2
3 files changed, 7 insertions, 3 deletions
diff --git a/packages/tslint-config/CHANGELOG.md b/packages/tslint-config/CHANGELOG.md
index 1d56bca5b..04d705941 100644
--- a/packages/tslint-config/CHANGELOG.md
+++ b/packages/tslint-config/CHANGELOG.md
@@ -1,5 +1,9 @@
# CHANGELOG
+## v0.5.0 - _TBD, 2018_
+
+ * Modified custom 'underscore-privates' rule, changing it to 'underscore-private-and-protected' requiring underscores to be prepended to both private and protected variable names (#354)
+
## v0.4.0 - _December 28, 2017_
* Added custom 'underscore-privates' rule, requiring underscores to be prepended to private variable names
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;
diff --git a/packages/tslint-config/tslint.json b/packages/tslint-config/tslint.json
index 44a8517dc..3266b022f 100644
--- a/packages/tslint-config/tslint.json
+++ b/packages/tslint-config/tslint.json
@@ -73,7 +73,7 @@
],
"space-within-parens": false,
"type-literal-delimiter": true,
- "underscore-privates": true,
+ "underscore-private-and-protected": true,
"variable-name": [true, "ban-keywords", "allow-pascal-case"],
"whitespace": [
true,