uber-archive / lint-trap

JavaScript linter module for Uber projects
26 stars 2 forks source link

Eliminate duplicate rules #44

Open andrewdeandrade opened 10 years ago

andrewdeandrade commented 10 years ago

Since lint-trap supports 3 linters, there are some duplicate rules. When the same error is thrown by more than one linter, prefer eslint over jscs and jshint and prefer jscs over jshint.

Known duplicates:

eslint.eol-last > jscs.requireLineFeedAtFileEnd
eslint.space-before-blocks > jscs.requireSpacesInFunctionDeclaration
eslint.no-extra-semi > jshint.W032
eslint.no-undef > jshint.W117
eslint.no-trailing-spaces > jscs.disallowTrailingWhitespace
eslint.semi > jshint.W033
eslint.no-multiple-empty-lines > jscs.disallowMultipleLineBreaks
eslint.max-len > jscs.maximumLineLength

If you find duplicate rules, please mention them in comments below.

andrewdeandrade commented 10 years ago

The above duplicates have been resolved in v0.4.0. Will leave this thread open to address additional duplicate rules discovered.

Also, deduping doesn't work properly between jscs and other linters when the file starts with a shell script #!/. This is due to a bug in esprima/jscs. The issue is here: https://github.com/jscs-dev/node-jscs/issues/730

andrewdeandrade commented 9 years ago

jshint.W069 -> eslint.dot-notation jscs.requireDotNotation -> eslint.dot-notation

andrewdeandrade commented 9 years ago

if (condition) { // doFoo }

Produces the following duplicate error:

jscs.requireBlocksOnNewline -> eslint.brace-style

andrewdeandrade commented 9 years ago

jscs.disallowSpacesInFunctionDeclaration -> eslint.space-after-function-name

andrewdeandrade commented 9 years ago

jscs.disallowMultipleLineBreaks -> eslint.no-multiple-empty-lines

Willyham commented 9 years ago
error  eslint    26:12   Strings must use singlequote.  quotes
error  jscs      26:12   Invalid quote mark found       validateQuoteMarks