mirror of
https://github.com/airbnb/javascript.git
synced 2026-04-25 03:00:19 -04:00
[eslint config] [base] [deps] update eslint, eslint-find-rules
Adds disabled rules: `max-lines`, `no-mixed-operators`, `rest-spread-spacing`, `object-curly-newline`
This commit is contained in:
@@ -46,14 +46,14 @@
|
||||
"homepage": "https://github.com/airbnb/javascript",
|
||||
"devDependencies": {
|
||||
"babel-tape-runner": "^1.3.1",
|
||||
"eslint": "^2.11.1",
|
||||
"eslint-find-rules": "^1.9.2",
|
||||
"eslint": "^2.12.0",
|
||||
"eslint-find-rules": "^1.10.0",
|
||||
"eslint-plugin-import": "^1.8.1",
|
||||
"tape": "^4.5.1",
|
||||
"in-publish": "^2.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": "^2.11.1",
|
||||
"eslint": "^2.12.0",
|
||||
"eslint-plugin-import": "^1.8.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,6 +117,10 @@ module.exports = {
|
||||
// disallow generator functions that do not have yield
|
||||
'require-yield': 0,
|
||||
|
||||
// enforce spacing between object rest-spread
|
||||
// http://eslint.org/docs/rules/rest-spread-spacing
|
||||
'rest-spread-spacing': [0, 'never'],
|
||||
|
||||
// import sorting
|
||||
// http://eslint.org/docs/rules/sort-imports
|
||||
'sort-imports': 0,
|
||||
|
||||
@@ -83,6 +83,14 @@ module.exports = {
|
||||
ignoreComments: false
|
||||
}],
|
||||
|
||||
// specify the max number of lines in a file
|
||||
// http://eslint.org/docs/rules/max-lines
|
||||
'max-lines': [0, {
|
||||
max: 300,
|
||||
skipBlankLines: true,
|
||||
skipComments: true
|
||||
}],
|
||||
|
||||
// specify the maximum depth callbacks can be nested
|
||||
'max-nested-callbacks': 0,
|
||||
|
||||
@@ -128,6 +136,20 @@ module.exports = {
|
||||
// disallow if as the only statement in an else block
|
||||
'no-lonely-if': 0,
|
||||
|
||||
// disallow un-paren'd mixes of different operators
|
||||
// http://eslint.org/docs/rules/no-mixed-operators
|
||||
// TODO: enable
|
||||
'no-mixed-operators': [0, {
|
||||
groups: [
|
||||
['+', '-', '*', '/', '%', '**'],
|
||||
['&', '|', '^', '~', '<<', '>>', '>>>'],
|
||||
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
|
||||
['&&', '||'],
|
||||
['in', 'instanceof']
|
||||
],
|
||||
allowSamePrecedence: false
|
||||
}],
|
||||
|
||||
// disallow mixed spaces and tabs for indentation
|
||||
'no-mixed-spaces-and-tabs': 2,
|
||||
|
||||
@@ -181,6 +203,13 @@ module.exports = {
|
||||
// require padding inside curly braces
|
||||
'object-curly-spacing': [2, 'always'],
|
||||
|
||||
// enforce line breaks between braces
|
||||
// http://eslint.org/docs/rules/object-curly-newline
|
||||
'object-curly-newline': [0, {
|
||||
ObjectExpression: { minProperties: 0, multiline: true },
|
||||
ObjectPattern: { minProperties: 0, multiline: true }
|
||||
}],
|
||||
|
||||
// enforce "same line" or "multiple line" on object properties.
|
||||
// http://eslint.org/docs/rules/object-property-newline
|
||||
// TODO: enable when https://github.com/eslint/eslint/issues/5667#issuecomment-219334864 is resolved
|
||||
|
||||
Reference in New Issue
Block a user