diff --git a/.travis.yml b/.travis.yml index ee392c7703..b7eb96d7ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ node_js: - "14" - "12" - "10" - - "8" before_install: - 'nvm install-latest-npm' install: @@ -16,6 +15,11 @@ script: sudo: false env: matrix: + - 'TEST=true ESLINT=7 PACKAGE=eslint-config-airbnb-base' + - 'TEST=true ESLINT=7 PACKAGE=eslint-config-airbnb' + - 'TEST=true ESLINT=7 REACT_HOOKS=3 PACKAGE=eslint-config-airbnb' + - 'TEST=true ESLINT=7 REACT_HOOKS=2.3 PACKAGE=eslint-config-airbnb' + - 'TEST=true ESLINT=7 REACT_HOOKS=1.7 PACKAGE=eslint-config-airbnb' - 'TEST=true ESLINT=6 PACKAGE=eslint-config-airbnb-base' - 'TEST=true ESLINT=6 PACKAGE=eslint-config-airbnb' - 'TEST=true ESLINT=6 REACT_HOOKS=3 PACKAGE=eslint-config-airbnb' @@ -29,6 +33,17 @@ env: matrix: fast_finish: true include: + - node_js: "lts/*" + env: PREPUBLISH=true ESLINT=7 PACKAGE=eslint-config-airbnb-base + - node_js: "lts/*" + env: PREPUBLISH=true ESLINT=7 PACKAGE=eslint-config-airbnb + - node_js: "lts/*" + env: PREPUBLISH=true ESLINT=7 REACT_HOOKS=3 PACKAGE=eslint-config-airbnb + - node_js: "lts/*" + env: PREPUBLISH=true ESLINT=7 REACT_HOOKS=2.3 PACKAGE=eslint-config-airbnb + - node_js: "lts/*" + env: PREPUBLISH=true ESLINT=7 REACT_HOOKS=1.7 PACKAGE=eslint-config-airbnb + - node_js: "lts/*" - node_js: "lts/*" env: PREPUBLISH=true ESLINT=6 PACKAGE=eslint-config-airbnb-base - node_js: "lts/*" @@ -55,6 +70,26 @@ matrix: env: LINT=true PACKAGE=eslint-config-airbnb - node_js: "lts/*" env: LINT=true PACKAGE=eslint-config-airbnb-base + - node_js: "8" + env: TEST=true ESLINT=6 PACKAGE=eslint-config-airbnb-base + - node_js: "8" + env: TEST=true ESLINT=6 PACKAGE=eslint-config-airbnb + - node_js: "8" + env: TEST=true ESLINT=6 REACT_HOOKS=3 PACKAGE=eslint-config-airbnb + - node_js: "8" + env: TEST=true ESLINT=6 REACT_HOOKS=2.3 PACKAGE=eslint-config-airbnb + - node_js: "8" + env: TEST=true ESLINT=6 REACT_HOOKS=1.7 PACKAGE=eslint-config-airbnb + - node_js: "8" + env: TEST=true ESLINT=5 PACKAGE=eslint-config-airbnb-base + - node_js: "8" + env: TEST=true ESLINT=5 PACKAGE=eslint-config-airbnb + - node_js: "8" + env: TEST=true ESLINT=5 REACT_HOOKS=3 PACKAGE=eslint-config-airbnb + - node_js: "8" + env: TEST=true ESLINT=5 REACT_HOOKS=2.3 PACKAGE=eslint-config-airbnb + - node_js: "8" + env: TEST=true ESLINT=5 REACT_HOOKS=1.7 PACKAGE=eslint-config-airbnb - node_js: "6" env: TEST=true ESLINT=5 PACKAGE=eslint-config-airbnb-base - node_js: "6" diff --git a/packages/eslint-config-airbnb-base/package.json b/packages/eslint-config-airbnb-base/package.json index 2957b06427..b691e1a3b2 100644 --- a/packages/eslint-config-airbnb-base/package.json +++ b/packages/eslint-config-airbnb-base/package.json @@ -57,7 +57,7 @@ "babel-preset-airbnb": "^4.5.0", "babel-tape-runner": "^3.0.0", "eclint": "^2.8.1", - "eslint": "^5.16.0 || ^6.8.0", + "eslint": "^5.16.0 || ^6.8.0 || ^7.2.0", "eslint-find-rules": "^3.5.0", "eslint-plugin-import": "^2.21.2", "in-publish": "^2.0.1", @@ -65,7 +65,7 @@ "tape": "^5.0.1" }, "peerDependencies": { - "eslint": "^5.16.0 || ^6.8.0", + "eslint": "^5.16.0 || ^6.8.0 || ^7.2.0", "eslint-plugin-import": "^2.21.2" }, "engines": { diff --git a/packages/eslint-config-airbnb-base/rules/best-practices.js b/packages/eslint-config-airbnb-base/rules/best-practices.js index 0307c64345..8e1d991304 100644 --- a/packages/eslint-config-airbnb-base/rules/best-practices.js +++ b/packages/eslint-config-airbnb-base/rules/best-practices.js @@ -28,6 +28,11 @@ module.exports = { // require default case in switch statements 'default-case': ['error', { commentPattern: '^no default$' }], + // Enforce default clauses in switch statements to be last + // https://eslint.org/docs/rules/default-case-last + // TODO: enable, semver-minor, when eslint v7 is required (which is a major) + 'default-case-last': 'off', + // https://eslint.org/docs/rules/default-param-last // TODO: enable, semver-minor, when eslint v6.4 is required (which is a major) 'default-param-last': 'off', diff --git a/packages/eslint-config-airbnb-base/rules/errors.js b/packages/eslint-config-airbnb-base/rules/errors.js index e4cd542683..15b6130a20 100644 --- a/packages/eslint-config-airbnb-base/rules/errors.js +++ b/packages/eslint-config-airbnb-base/rules/errors.js @@ -91,6 +91,11 @@ module.exports = { // disallow irregular whitespace outside of strings and comments 'no-irregular-whitespace': 'error', + // Disallow Number Literals That Lose Precision + // https://eslint.org/docs/rules/no-loss-of-precision + // TODO: enable, semver-minor, once eslint v7.1 is required (which is major) + 'no-loss-of-precision': 'off', + // Disallow characters which are made with multiple code points in character class syntax // https://eslint.org/docs/rules/no-misleading-character-class 'no-misleading-character-class': 'error', @@ -131,13 +136,19 @@ module.exports = { // disallow negating the left operand of relational operators // https://eslint.org/docs/rules/no-unsafe-negation 'no-unsafe-negation': 'error', + + // Disallow useless backreferences in regular expressions + // https://eslint.org/docs/rules/no-useless-backreference + // TODO: enable, semver-minor, once eslint v7 is required (which is major) + 'no-useless-backreference': 'off', + // disallow negation of the left operand of an in expression // deprecated in favor of no-unsafe-negation 'no-negated-in-lhs': 'off', // Disallow assignments that can lead to race conditions due to usage of await or yield // https://eslint.org/docs/rules/require-atomic-updates - // TODO: enable, semver-major + // note: not enabled because it is very buggy 'require-atomic-updates': 'off', // disallow comparisons with the value NaN diff --git a/packages/eslint-config-airbnb-base/rules/es6.js b/packages/eslint-config-airbnb-base/rules/es6.js index bfdc6d29e4..02c616dad5 100644 --- a/packages/eslint-config-airbnb-base/rules/es6.js +++ b/packages/eslint-config-airbnb-base/rules/es6.js @@ -60,6 +60,16 @@ module.exports = { // https://eslint.org/docs/rules/no-new-symbol 'no-new-symbol': 'error', + // Disallow specified names in exports + // https://eslint.org/docs/rules/no-restricted-exports + // TODO enable, semver-minor, once eslint v7 is required (which is major) + 'no-restricted-exports': ['off', { + restrictedNamedExports: [ + 'default', // use `export default` to provide a default export + 'then', // this will cause tons of confusion when your module is dynamically `import()`ed + ], + }], + // disallow specific imports // https://eslint.org/docs/rules/no-restricted-imports 'no-restricted-imports': ['off', { diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json index 0e08d078fc..97703e59b0 100644 --- a/packages/eslint-config-airbnb/package.json +++ b/packages/eslint-config-airbnb/package.json @@ -63,7 +63,7 @@ "babel-preset-airbnb": "^4.5.0", "babel-tape-runner": "^3.0.0", "eclint": "^2.8.1", - "eslint": "^5.16.0 || ^6.8.0", + "eslint": "^5.16.0 || ^6.8.0 || ^7.2.0", "eslint-find-rules": "^3.5.0", "eslint-plugin-import": "^2.21.2", "eslint-plugin-jsx-a11y": "^6.2.3", @@ -75,7 +75,7 @@ "tape": "^5.0.1" }, "peerDependencies": { - "eslint": "^5.16.0 || ^6.8.0", + "eslint": "^5.16.0 || ^6.8.0 || ^7.2.0", "eslint-plugin-import": "^2.21.2", "eslint-plugin-jsx-a11y": "^6.2.3", "eslint-plugin-react": "^7.20.0",