-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test elias rules #222
Merged
Merged
test elias rules #222
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fa40824
test elias rules
SimonLab 88a7427
add some rules from elias issues
SimonLab 0e4d9ce
add more rules
SimonLab a980d5d
more rules!
SimonLab 46b50c5
first version of elias rules
SimonLab b62dd31
merge with master
SimonLab 22500ff
update comment related issue
SimonLab File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
module.exports = { | ||
"no-sync": "off", // https://github.com/dwyl/goodparts/issues/144 | ||
"no-restricted-properties": "off", // https://github.com/dwyl/goodparts/issues/143 | ||
"no-restricted-modules": "off", // https://github.com/dwyl/goodparts/issues/139 | ||
"no-process-exit": "error", // https://github.com/dwyl/goodparts/issues/136 | ||
"no-process-env": "off", // https://github.com/dwyl/goodparts/issues/134 | ||
"no-path-concat": "error", // https://github.com/dwyl/goodparts/issues/132 | ||
"no-new-require": "error", // https://github.com/dwyl/goodparts/issues/129 | ||
"no-mixed-requires": ["error", { "grouping": true, "allowCall": false }], // https://github.com/dwyl/goodparts/issues/126 | ||
"handle-callback-err": ["error", "^(error|err\d*)$"], // https://github.com/dwyl/goodparts/issues/121 | ||
"global-require": "error", // https://github.com/dwyl/goodparts/issues/119 | ||
"callback-return": ["error", ["done", "next", "callback", "cb"]], // https://github.com/dwyl/goodparts/issues/112 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
module.exports = { | ||
"no-use-before-define": "error", // https://github.com/dwyl/goodparts/issues/153 | ||
"no-undefined": "error", // https://github.com/dwyl/goodparts/issues/152 | ||
"no-undef-init": "error", // https://github.com/dwyl/goodparts/issues/151 | ||
"no-shadow-restricted-names": "error", // https://github.com/dwyl/goodparts/issues/150 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
if (foo) { | ||
bar(); | ||
} | ||
else { | ||
baz(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if (foo) { | ||
bar(); | ||
} else { | ||
baz(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function foo(err, callback) { | ||
if (err) { | ||
callback(err); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function foo(err, callback) { | ||
if (err) { | ||
return callback(err); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
var foo = 1 | ||
, bar = 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
var foo = 1, | ||
bar = 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function doSmth() { | ||
var foo = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function doSmth() { | ||
var foo = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function foo() { | ||
if (condition) { | ||
var fs = require("fs"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function loadData (err, data) { | ||
doSomething(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
function loadData (err, data) { | ||
if (err) { | ||
console.log(err.stack); | ||
} | ||
doSomething(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
if (a) { | ||
b=c; | ||
function foo(d) { | ||
e=f; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
if (a) { | ||
b=c; | ||
function foo(d) { | ||
e=f; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
var fs = require('fs'), | ||
async = require('async'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
alert(a); | ||
var a = 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
var a = 10; | ||
alert(a); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,31 @@ | ||
var read = require('../read.js'); | ||
|
||
module.exports = {}; | ||
module.exports = { | ||
'no-sync': null, | ||
'no-restricted-properties': null, | ||
'no-restricted-modules': null, | ||
'no-process-exit': { | ||
fail: ['process.exit(1);'] | ||
}, | ||
'no-process-env': null, | ||
'no-path-concat': { | ||
fail: ['var fullPath = __dirname + "/foo.js";'] | ||
}, | ||
'no-new-require': { | ||
fail: ['var mod = new require("mod");'] | ||
}, | ||
'no-mixed-requires': { | ||
fail: [read('no-mixed-requires.fail')], | ||
}, | ||
'handle-callback-err': { | ||
fail: [read('handle-callback-err.fail')], | ||
pass: [read('handle-callback-err.pass')] | ||
}, | ||
'global-require': { | ||
fail: [read('global-require.fail')] | ||
}, | ||
'callback-return': { | ||
fail: [read('callback-return.fail')], | ||
pass: [read('callback-return.pass')] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if (a) { | ||
|
||
b(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
if (a) { | ||
b(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
var object = { | ||
"foo": 'bar', | ||
baz: 42 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
var object = { | ||
foo: 'bar', | ||
baz: 42 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
var double = "double"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
var nodouble = 'double'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
var read = require('../read.js'); | ||
|
||
module.exports = {}; | ||
module.exports = { | ||
'no-use-before-define': { | ||
fail: [read('no-use-before-define.fail')], | ||
pass: [read('no-use-before-define.pass')] | ||
}, | ||
'no-undefined': { | ||
fail: ['var undefined = "bob";'] | ||
}, | ||
'no-undef-init': { | ||
fail: ['var a = undefined;'], | ||
pass: ['var a;'] | ||
}, | ||
'no-shadow-restricted-names': { | ||
fail: ['function NaN(){};'] | ||
} | ||
}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate max-len
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this one as other is more exact