Skip to content

Commit

Permalink
Enable new rules
Browse files Browse the repository at this point in the history
* Add `checkLoops: false` to `no-constant-condition` check
* Enable `no-ex-assign` now the issues are reported to be fixed
* Enable `handle-callback-err` now the issues reported to be fixed
  • Loading branch information
blakeembrey committed Sep 30, 2016
1 parent fd03aca commit 10243d9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
10 changes: 10 additions & 0 deletions test/rules/no-constant-condition.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
if (true) {
console.log('test')
}

while (true) {
if (check()) {
break
}
}

function check () {
return true
}
2 changes: 2 additions & 0 deletions test/rules/no-multi-spaces.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
no-multi-spaces.ts[1, 7]: Unused variable: 'test'
no-multi-spaces.ts[1, 15]: Multiple spaces found before 'true'.
1 change: 1 addition & 0 deletions test/rules/no-multi-spaces.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const test = true
19 changes: 12 additions & 7 deletions tslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ module.exports = {
'no-duplicate-variable': true,
'no-empty': true,
'no-eval': true,
// 'no-string-literal': true,
'no-switch-case-fall-through': true,
'no-unreachable': true,
'no-unused-expression': true,
Expand Down Expand Up @@ -130,11 +129,16 @@ module.exports = {
'check-typecast'
],
// TSLint ESLint rules.
'no-constant-condition': true,
'no-constant-condition': [
true,
{
checkLoops: false
}
],
'no-control-regex': true,
'no-duplicate-case': true,
'no-empty-character-class': true,
// 'no-ex-assign': true,
'no-ex-assign': true,
'no-extra-boolean-cast': true,
'no-inner-declarations': [
true,
Expand Down Expand Up @@ -179,6 +183,7 @@ module.exports = {
// true,
// 'except-parens'
// ],
// 'no-self-assign': true,
// 'no-self-compare': true,
// 'no-sequences': true,
// 'no-throw-literal': true,
Expand All @@ -197,10 +202,10 @@ module.exports = {
// 'no-label-var': true,
// 'no-shadow-restricted-names': true,
// 'no-undef-init': true,
// 'handle-callback-err': [
// true,
// '^(err|error)$'
// ],
'handle-callback-err': [
true,
'^(err|error)$'
],
// 'no-new-require': true,
// 'no-path-concat': true,
'block-spacing': [
Expand Down

0 comments on commit 10243d9

Please sign in to comment.