[Deps] allow eslint v3 or v4; update eslint-plugin-import

Part of #1447.
This commit is contained in:
Jordan Harband
2017-07-23 11:35:51 -07:00
parent 399420f46f
commit 811392725e
7 changed files with 73 additions and 12 deletions

View File

@@ -19,6 +19,7 @@ env:
matrix:
- 'TEST=true ESLINT=3 PACKAGE=eslint-config-airbnb'
- 'TEST=true ESLINT=3 PACKAGE=eslint-config-airbnb-base'
- 'TEST=true ESLINT=4 PACKAGE=eslint-config-airbnb-base'
matrix:
fast_finish: true
include:
@@ -26,8 +27,11 @@ matrix:
env: PREPUBLISH=true ESLINT=3 PACKAGE=eslint-config-airbnb
- node_js: "node"
env: PREPUBLISH=true ESLINT=3 PACKAGE=eslint-config-airbnb-base
- node_js: "node"
env: PREPUBLISH=true ESLINT=4 PACKAGE=eslint-config-airbnb-base
allow_failures:
- node_js: "7"
- node_js: "5"
- env: PREPUBLISH=true ESLINT=3 PACKAGE=eslint-config-airbnb
- env: PREPUBLISH=true ESLINT=3 PACKAGE=eslint-config-airbnb-base
- env: PREPUBLISH=true ESLINT=4 PACKAGE=eslint-config-airbnb-base

View File

@@ -53,14 +53,14 @@
"editorconfig-tools": "^0.1.1",
"eslint": "^4.3.0",
"eslint-find-rules": "^3.1.1",
"eslint-plugin-import": "^2.6.1",
"eslint-plugin-import": "^2.7.0",
"in-publish": "^2.0.0",
"safe-publish-latest": "^1.1.1",
"tape": "^4.7.0"
},
"peerDependencies": {
"eslint": "^3.19.0",
"eslint-plugin-import": "^2.6.1"
"eslint": "^3.19.0 || ^4.3.0",
"eslint-plugin-import": "^2.7.0"
},
"engines": {
"node": ">= 4"

View File

@@ -142,7 +142,9 @@ module.exports = {
}],
// disallow use of multiple spaces
'no-multi-spaces': 'error',
'no-multi-spaces': ['error', {
// ignoreEOLComments: false, // TODO: uncomment once v3 is dropped
}],
// disallow use of multiline strings
'no-multi-str': 'error',

View File

@@ -9,6 +9,16 @@ module.exports = {
functions: 'always-multiline',
}],
// Enforce “for” loop update clause moving the counter in the right direction
// http://eslint.org/docs/rules/for-direction
// TODO: enable, semver-major until v3 is dropped; semver-minor otherwise
'for-direction': 'off',
// Enforces that a return statement is present in property getters
// http://eslint.org/docs/rules/getter-return
// TODO: enable, semver-major when v3 is dropped
'getter-return': ['off', { allowImplicit: true }],
// Disallow await inside of loops
// http://eslint.org/docs/rules/no-await-in-loop
'no-await-in-loop': 'error',
@@ -61,6 +71,8 @@ module.exports = {
conditionalAssign: true,
nestedBinaryExpressions: false,
returnAssign: false,
ignoreJSX: 'all', // delegate to eslint-plugin-react
enforceForArrowConditionals: false,
}],
// disallow unnecessary semicolons

View File

@@ -112,8 +112,14 @@ module.exports = {
// http://eslint.org/docs/rules/prefer-destructuring
// TODO: enable
'prefer-destructuring': ['off', {
array: true,
object: true,
VariableDeclarator: {
array: false,
object: true,
},
AssignmentExpression: {
array: true,
object: true,
},
}, {
enforceForRenamedProperties: false,
}],

View File

@@ -14,6 +14,11 @@ module.exports = {
// enforces error handling in callbacks (node environment)
'handle-callback-err': 'off',
// disallow use of the Buffer() constructor
// http://eslint.org/docs/rules/no-buffer-constructor
// TODO: enable, semver-major
'no-buffer-constructor': 'off',
// disallow mixing regular variable and require declarations
'no-mixed-requires': ['off', false],

View File

@@ -1,5 +1,15 @@
module.exports = {
rules: {
// enforce line breaks after opening and before closing array brackets
// http://eslint.org/docs/rules/array-bracket-newline
// TODO: enable? semver-major
'array-bracket-newline': ['off', { multiline: true, minItems: 3 }],
// enforce line breaks between array elements
// http://eslint.org/docs/rules/array-element-newline
// TODO: enable? semver-major
'array-element-newline': ['off', { multiline: true, minItems: 3 }],
// enforce spacing inside array brackets
'array-bracket-spacing': ['error', 'never'],
@@ -82,7 +92,7 @@ module.exports = {
outerIIFEBody: 1,
// MemberExpression: null,
// CallExpression: {
// parameters: null,
// parameters: null,
// },
FunctionDeclaration: {
parameters: 1,
@@ -284,10 +294,18 @@ module.exports = {
'no-ternary': 'off',
// disallow trailing whitespace at the end of lines
'no-trailing-spaces': 'error',
'no-trailing-spaces': ['error', {
skipBlankLines: false,
// ignoreComments: false, // TODO: uncomment once v3 is dropped
}],
// disallow dangling underscores in identifiers
'no-underscore-dangle': ['error', { allowAfterThis: false }],
'no-underscore-dangle': ['error', {
allow: [],
allowAfterThis: false,
allowAfterSuper: false,
// enforceInMethodNames: false, // TODO: uncoment and enable, semver-minor once v3 is dropped
}],
// disallow the use of Boolean literals in conditional expressions
// also, prefer `a || b` over `a ? a : b`
@@ -307,10 +325,10 @@ module.exports = {
// enforce line breaks between braces
// http://eslint.org/docs/rules/object-curly-newline
// TODO: enable once https://github.com/eslint/eslint/issues/6488 is resolved
// TODO: enable once https://github.com/eslint/eslint/issues/6488 is resolved and v3 is dropped
'object-curly-newline': ['off', {
ObjectExpression: { minProperties: 0, multiline: true },
ObjectPattern: { minProperties: 0, multiline: true }
ObjectExpression: { minProperties: 3, multiline: true, consistent: true },
ObjectPattern: { minProperties: 3, multiline: true, consistent: true }
}],
// enforce "same line" or "multiple line" on object properties.
@@ -336,6 +354,10 @@ module.exports = {
// enforce padding within blocks
'padded-blocks': ['error', 'never'],
// Require or disallow padding lines between statements
// http://eslint.org/docs/rules/padding-line-between-statements
'padding-line-between-statements': 'off',
// require quotes around object literal property names
// http://eslint.org/docs/rules/quote-props.html
'quote-props': ['error', 'as-needed', { keywords: false, unnecessary: true, numbers: false }],
@@ -353,6 +375,11 @@ module.exports = {
// enforce spacing before and after semicolons
'semi-spacing': ['error', { before: false, after: true }],
// Enforce location of semicolons
// http://eslint.org/docs/rules/semi-style
// TODO: enable, semver-major until v3 is dropped, semver-minor otherwise
'semi-style': ['off', 'last'],
// requires object keys to be sorted
'sort-keys': ['off', 'asc', { caseSensitive: false, natural: true }],
@@ -399,6 +426,11 @@ module.exports = {
}
}],
// Enforce spacing around colons of switch statements
// http://eslint.org/docs/rules/switch-colon-spacing
// TODO: enable, semver-major
'switch-colon-spacing': ['off', { after: true, before: false }],
// Require or disallow spacing between template tags and their literals
// http://eslint.org/docs/rules/template-tag-spacing
// TODO: enable, semver-major