diff options
Diffstat (limited to 'packages/tslint-config')
-rw-r--r-- | packages/tslint-config/CHANGELOG.md | 2 | ||||
-rw-r--r-- | packages/tslint-config/package.json | 2 | ||||
-rw-r--r-- | packages/tslint-config/rules/asyncSuffixRule.ts | 2 | ||||
-rw-r--r-- | packages/tslint-config/rules/walkers/async_suffix.ts | 4 | ||||
-rw-r--r-- | packages/tslint-config/tslint.json | 207 |
5 files changed, 104 insertions, 113 deletions
diff --git a/packages/tslint-config/CHANGELOG.md b/packages/tslint-config/CHANGELOG.md index 31f49eef6..daea1975c 100644 --- a/packages/tslint-config/CHANGELOG.md +++ b/packages/tslint-config/CHANGELOG.md @@ -1,6 +1,6 @@ # CHANGELOG -v0.x.x - TBD +v0.4.0 - _December 28, 2017_ ------------------------ * Added custom 'underscore-privates' rule, requiring underscores to be prepended to private variable names * Because our tools can be used in both a TS and JS environment, we want to make the private methods of any public facing interface show up at the bottom of auto-complete lists. Additionally, we wanted to remain consistent with respect to our usage of underscores in order to enforce this rule with a linter rule, rather then manual code reviews. diff --git a/packages/tslint-config/package.json b/packages/tslint-config/package.json index 2f2aa8fa9..0b99332e7 100644 --- a/packages/tslint-config/package.json +++ b/packages/tslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/tslint-config", - "version": "0.3.0", + "version": "0.4.0", "description": "Lint rules related to 0xProject for TSLint", "main": "tslint.json", "scripts": { diff --git a/packages/tslint-config/rules/asyncSuffixRule.ts b/packages/tslint-config/rules/asyncSuffixRule.ts index c6ae5189c..5215c7151 100644 --- a/packages/tslint-config/rules/asyncSuffixRule.ts +++ b/packages/tslint-config/rules/asyncSuffixRule.ts @@ -1,7 +1,7 @@ import * as Lint from 'tslint'; import * as ts from 'typescript'; -import {AsyncSuffixWalker} from './walkers/async_suffix'; +import { AsyncSuffixWalker } from './walkers/async_suffix'; export class Rule extends Lint.Rules.AbstractRule { public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { diff --git a/packages/tslint-config/rules/walkers/async_suffix.ts b/packages/tslint-config/rules/walkers/async_suffix.ts index 7fa7a78b8..eaec9c5f6 100644 --- a/packages/tslint-config/rules/walkers/async_suffix.ts +++ b/packages/tslint-config/rules/walkers/async_suffix.ts @@ -13,7 +13,9 @@ export class AsyncSuffixWalker extends Lint.RuleWalker { const returnTypeName = (node.type as ts.TypeReferenceNode).typeName.getText(); if (returnTypeName === 'Promise' && !methodName.endsWith('Async')) { const failure = this.createFailure( - methodNameNode.getStart(), methodNameNode.getWidth(), AsyncSuffixWalker.FAILURE_STRING, + methodNameNode.getStart(), + methodNameNode.getWidth(), + AsyncSuffixWalker.FAILURE_STRING, ); this.addFailure(failure); } diff --git a/packages/tslint-config/tslint.json b/packages/tslint-config/tslint.json index 49e31b13d..486780de6 100644 --- a/packages/tslint-config/tslint.json +++ b/packages/tslint-config/tslint.json @@ -1,111 +1,100 @@ { - "extends": [ - "tslint:latest", - "tslint-react", - "tslint-eslint-rules" - ], - "rules": { - "adjacent-overload-signatures": true, - "arrow-parens": [true, "ban-single-arg-parens"], - "arrow-return-shorthand": true, - "async-suffix": true, - "await-promise": true, - "binary-expression-operand-order": true, - "callable-types": true, - "class-name": true, - "completed-docs": [ - true, - { - "functions": {"visibilities": ["exported"]}, - "methods": {"locations": "instance", "privacies": ["public", "protected"]} - } - ], - "curly": true, - "eofline": true, - "encoding": true, - "import-spacing": true, - "indent": [true, "spaces", 4], - "interface-name": false, - "interface-over-type-literal": true, - "linebreak-style": [true, "LF"], - "max-classes-per-file": false, - "max-classes-per-file": [true, 1], - "max-file-line-count": [true, 500], - "max-line-length": [true, 120], - "member-access": true, - "member-ordering": [true, - "public-before-private", - "static-before-instance", - "variables-before-functions" - ], - "newline-before-return": false, - "new-parens": true, - "no-angle-bracket-type-assertion": true, - "no-boolean-literal-compare": true, - "no-default-export": true, - "no-empty-interface": false, - "no-floating-promises": true, - "no-non-null-assertion": true, - "no-parameter-reassignment": true, - "no-redundant-jsdoc": true, - "no-return-await": true, - "no-string-throw": true, - "no-submodule-imports": false, - "no-unnecessary-type-assertion": true, - "no-unused-variable": [true, {"ignore-pattern": "^_\\d*"}], - "no-implicit-dependencies": [true, "dev"], - "number-literal-format": true, - "object-curly-spacing": [true, "never"], - "object-literal-sort-keys": false, - "ordered-imports": [ - true, - { - "grouped-imports": true - } - ], - "prefer-const": true, - "prefer-for-of": true, - "prefer-function-over-method": true, - "promise-function-async": true, - "quotemark": [true, "single", "avoid-escape", "jsx-double"], - "semicolon": [true, "always"], - "space-before-function-paren": [ - true, - { - "anonymous": "never", - "named": "never", - "method": "never", - "constructor": "never", - "asyncArrow": "always" - } - ], - "space-within-parens": false, - "type-literal-delimiter": true, - "underscore-privates": true, - "variable-name": [true, - "ban-keywords", - "allow-pascal-case" - ], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-rest-spread", - "check-type", - "check-typecast", - "check-preblock" - ], - "jsx-alignment": true, - "jsx-boolean-value": true, - "jsx-curly-spacing": [true, "never"], - "jsx-no-lambda": true, - "jsx-no-multiline-js": false, - "jsx-no-string-ref": true, - "jsx-self-close": true, - "jsx-wrap-multiline": false, - "jsx-no-bind": false - }, - "rulesDirectory": "lib" + "extends": ["tslint:latest", "tslint-react", "tslint-eslint-rules"], + "rules": { + "adjacent-overload-signatures": true, + "arrow-parens": [true, "ban-single-arg-parens"], + "arrow-return-shorthand": true, + "async-suffix": true, + "await-promise": true, + "binary-expression-operand-order": true, + "callable-types": true, + "class-name": true, + "completed-docs": [ + true, + { + "functions": { "visibilities": ["exported"] }, + "methods": { "locations": "instance", "privacies": ["public", "protected"] } + } + ], + "curly": true, + "eofline": true, + "encoding": true, + "import-spacing": true, + "indent": [true, "spaces", 4], + "interface-name": false, + "interface-over-type-literal": true, + "linebreak-style": [true, "LF"], + "max-classes-per-file": false, + "max-classes-per-file": [true, 1], + "max-line-length": false, + "max-file-line-count": [true, 500], + "member-access": true, + "member-ordering": [true, "public-before-private", "static-before-instance", "variables-before-functions"], + "newline-before-return": false, + "new-parens": true, + "no-angle-bracket-type-assertion": true, + "no-boolean-literal-compare": true, + "no-default-export": true, + "no-empty-interface": false, + "no-floating-promises": true, + "no-non-null-assertion": true, + "no-parameter-reassignment": true, + "no-redundant-jsdoc": true, + "no-return-await": true, + "no-string-throw": true, + "no-submodule-imports": false, + "no-unnecessary-type-assertion": true, + "no-unused-variable": [true, { "ignore-pattern": "^_\\d*" }], + "no-implicit-dependencies": [true, "dev"], + "number-literal-format": true, + "object-literal-sort-keys": false, + "object-literal-key-quotes": false, + "ordered-imports": [ + true, + { + "grouped-imports": true + } + ], + "prefer-const": true, + "prefer-for-of": true, + "prefer-function-over-method": true, + "promise-function-async": true, + "quotemark": [true, "single", "avoid-escape", "jsx-double"], + "semicolon": [true, "always"], + "space-before-function-paren": [ + true, + { + "anonymous": "never", + "named": "never", + "method": "never", + "constructor": "never", + "asyncArrow": "always" + } + ], + "space-within-parens": false, + "type-literal-delimiter": true, + "underscore-privates": true, + "variable-name": [true, "ban-keywords", "allow-pascal-case"], + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-rest-spread", + "check-type", + "check-typecast", + "check-preblock" + ], + "jsx-alignment": true, + "jsx-boolean-value": true, + "jsx-curly-spacing": [true, "never"], + "jsx-no-lambda": true, + "jsx-no-multiline-js": false, + "jsx-no-string-ref": true, + "jsx-self-close": true, + "jsx-wrap-multiline": false, + "jsx-no-bind": false + }, + "rulesDirectory": "lib" } |