Skip to content

Commit

Permalink
Add new rules provided by TSLint
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey committed Oct 27, 2017
1 parent 3429c08 commit 0d59b7c
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 16 deletions.
25 changes: 15 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -45,6 +45,6 @@
"typescript": "^2.3.4"
},
"dependencies": {
"tslint-eslint-rules": "^4.0.0"
"tslint-eslint-rules": "^4.1.1"
}
}
4 changes: 3 additions & 1 deletion test/rules.out
Expand Up @@ -16,6 +16,8 @@ ERROR: /rules/object-destruct-spacing.ts[1, 19]: A space is required before '}'
ERROR: /rules/object-destruct-spacing.ts[1, 26]: A space is required after '{'
ERROR: /rules/object-destruct-spacing.ts[1, 32]: A space is required before '}'
ERROR: /rules/semicolon.ts[1, 24]: Unnecessary semicolon
ERROR: /rules/ter-arrow-spacing.ts[5, 11]: Multiple spaces found before '=>'.
ERROR: /rules/space-within-parens.ts[1, 16]: Whitespace within parentheses is not allowed
ERROR: /rules/space-within-parens.ts[1, 21]: Whitespace within parentheses is not allowed
ERROR: /rules/ter-arrow-spacing.ts[5, 10]: Multiple spaces found before '=>'.
ERROR: /rules/ter-indent.ts[11, 1]: Expected indentation of 2 spaces but found 3.
ERROR: /rules/trailing-comma.ts[3, 7]: Unnecessary trailing comma
3 changes: 3 additions & 0 deletions test/rules/space-within-parens.ts
@@ -0,0 +1,3 @@
function test ( a, b ) {
return a < b
}
2 changes: 1 addition & 1 deletion test/rules/ter-arrow-spacing.ts
Expand Up @@ -2,4 +2,4 @@ export function exec (cb: () => void) {
return cb()
}

exec( () => null)
exec(() => null)
12 changes: 9 additions & 3 deletions tslint.js
Expand Up @@ -2,7 +2,6 @@ module.exports = {
extends: ['tslint-eslint-rules'],
rules: {
// TSLint rules.
'member-access': false,
'member-ordering': [
true,
{
Expand Down Expand Up @@ -46,17 +45,20 @@ module.exports = {
'label-position': true,
'no-arg': true,
'no-conditional-assignment': true,
'no-duplicate-imports': true,
'no-duplicate-variable': true,
'no-empty': true,
'no-eval': true,
'no-reference-import': true,
'no-return-await': true,
'no-switch-case-fall-through': true,
'no-unused-expression': [true, 'allow-fast-null-checks', 'allow-tagged-template'],
'no-unused-variable': [true, { 'ignore-pattern': '^_' }],
'no-use-before-declare': true,
'no-var-keyword': true,
'radix': true,
'return-undefined': true,
'space-within-parens': [true, 0],
'triple-equals': [
true,
'allow-null-check'
Expand Down Expand Up @@ -91,6 +93,7 @@ module.exports = {
'no-misused-new': true,
'no-string-throw': true,
'no-unnecessary-qualifier': true,
'no-unnecessary-type-assertion': true,
'one-line': [
true,
'check-catch',
Expand Down Expand Up @@ -126,8 +129,10 @@ module.exports = {
'check-decl',
'check-operator',
// 'check-module',
'check-rest-spread',
'check-type',
'check-typecast',
'check-type-operator',
'check-preblock'
],
// TSLint ESLint rules.
Expand All @@ -147,9 +152,10 @@ module.exports = {
'functions'
],
'no-invalid-regexp': true,
'no-irregular-whitespace': true,
'ter-no-irregular-whitespace': true,
'no-regex-spaces': true,
'no-sparse-arrays': true,
'ter-no-sparse-arrays': true,
'ter-func-call-spacing': [true, 'never'],
'no-unexpected-multiline': true,
'valid-typeof': true,
'ter-arrow-spacing': [
Expand Down

0 comments on commit 0d59b7c

Please sign in to comment.