Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1052 from mozilla/eslint
Switch from jshint to eslint, enforce 2-space indent rules, fix linting errors
- Loading branch information
Showing
110 changed files
with
12,450 additions
and
41,878 deletions.
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"presets": [ | ||
["@babel/env", { | ||
"loose": true, | ||
"targets": { | ||
"browsers": ["last 2 versions", "safari >= 7", "ie 9"], | ||
"node": "4" | ||
} | ||
}] | ||
], | ||
"env": { | ||
"test": { | ||
"plugins": ["./scripts/lib/arrow-function-coverage-fix", "istanbul"] | ||
} | ||
}, | ||
"ignore": [ | ||
"scripts/lib/arrow-function-coverage-fix.js" | ||
] | ||
} |
File renamed without changes.
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,52 @@ | ||
module.exports = { | ||
'extends': [ | ||
'airbnb-base/legacy', | ||
], | ||
'parserOptions': { | ||
'sourceType': 'module', | ||
'ecmaVersion': 2017, | ||
}, | ||
'env': { | ||
'node': true, | ||
'es6': true, | ||
}, | ||
"rules": { | ||
// The one assertion of personal preference: no spaces before parentheses | ||
// of anonymous functions | ||
'space-before-function-paren': ['error', { | ||
anonymous: 'never', | ||
named: 'never', | ||
asyncArrow: 'always', | ||
}], | ||
// Temporarily disabled rules | ||
// | ||
// no-use-before-define is a good rule, but it would make the diff for | ||
// linting the code even more inscrutible than it already is. | ||
'no-use-before-define': 'off', | ||
// Relax some rules | ||
'no-cond-assign': ['error', 'except-parens'], | ||
'no-unused-vars': ['error', { | ||
'args': 'none', | ||
}], | ||
// Disable some overly-strict airbnb style rules | ||
'no-underscore-dangle': 'off', | ||
'no-param-reassign': 'off', | ||
'class-methods-use-this': 'off', | ||
'function-paren-newline': 'off', | ||
'no-plusplus': 'off', | ||
'object-curly-spacing': 'off', | ||
'no-multi-assign': 'off', | ||
'no-else-return': 'off', | ||
// While technically useless from the point of view of the regex parser, | ||
// escaping characters inside character classes is more consistent. I | ||
// would say that they make the regular expression more readable, if the | ||
// idea of readable regular expressions wasn't absurd on its face. | ||
'no-useless-escape': 'off', | ||
// I'm inclined to reverse this rule to be ['error', 'always'], but not just yet | ||
// IE 8 is a thing of the past and trailing commas are useful. | ||
'comma-dangle': 'off', | ||
}, | ||
'globals': { | ||
'nunjucks': false, | ||
}, | ||
}; |
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,5 +1,8 @@ | ||
node_modules | ||
coverage | ||
.nyc_output | ||
docs | ||
tests | ||
bench | ||
nunjucks | ||
scripts |
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,6 +1,12 @@ | ||
language: node_js | ||
sudo: false | ||
node_js: | ||
- "7" | ||
- "8" | ||
- "6" | ||
- "5" | ||
- "4" | ||
install: | ||
- npm install | ||
- npm install codecov | ||
script: | ||
- npm test | ||
- npm run codecov |
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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.