Skip to content

Commit 5b462a0

Browse files
committed
[eslint config] [*] [new] add eslint v7
1 parent 22adc06 commit 5b462a0

File tree

6 files changed

+67
-6
lines changed

6 files changed

+67
-6
lines changed

.travis.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ node_js:
33
- "14"
44
- "12"
55
- "10"
6-
- "8"
76
before_install:
87
- 'nvm install-latest-npm'
98
install:
@@ -16,6 +15,11 @@ script:
1615
sudo: false
1716
env:
1817
matrix:
18+
- 'TEST=true ESLINT=7 PACKAGE=eslint-config-airbnb-base'
19+
- 'TEST=true ESLINT=7 PACKAGE=eslint-config-airbnb'
20+
- 'TEST=true ESLINT=7 REACT_HOOKS=3 PACKAGE=eslint-config-airbnb'
21+
- 'TEST=true ESLINT=7 REACT_HOOKS=2.3 PACKAGE=eslint-config-airbnb'
22+
- 'TEST=true ESLINT=7 REACT_HOOKS=1.7 PACKAGE=eslint-config-airbnb'
1923
- 'TEST=true ESLINT=6 PACKAGE=eslint-config-airbnb-base'
2024
- 'TEST=true ESLINT=6 PACKAGE=eslint-config-airbnb'
2125
- 'TEST=true ESLINT=6 REACT_HOOKS=3 PACKAGE=eslint-config-airbnb'
@@ -29,6 +33,17 @@ env:
2933
matrix:
3034
fast_finish: true
3135
include:
36+
- node_js: "lts/*"
37+
env: PREPUBLISH=true ESLINT=7 PACKAGE=eslint-config-airbnb-base
38+
- node_js: "lts/*"
39+
env: PREPUBLISH=true ESLINT=7 PACKAGE=eslint-config-airbnb
40+
- node_js: "lts/*"
41+
env: PREPUBLISH=true ESLINT=7 REACT_HOOKS=3 PACKAGE=eslint-config-airbnb
42+
- node_js: "lts/*"
43+
env: PREPUBLISH=true ESLINT=7 REACT_HOOKS=2.3 PACKAGE=eslint-config-airbnb
44+
- node_js: "lts/*"
45+
env: PREPUBLISH=true ESLINT=7 REACT_HOOKS=1.7 PACKAGE=eslint-config-airbnb
46+
- node_js: "lts/*"
3247
- node_js: "lts/*"
3348
env: PREPUBLISH=true ESLINT=6 PACKAGE=eslint-config-airbnb-base
3449
- node_js: "lts/*"
@@ -55,6 +70,26 @@ matrix:
5570
env: LINT=true PACKAGE=eslint-config-airbnb
5671
- node_js: "lts/*"
5772
env: LINT=true PACKAGE=eslint-config-airbnb-base
73+
- node_js: "8"
74+
env: TEST=true ESLINT=6 PACKAGE=eslint-config-airbnb-base
75+
- node_js: "8"
76+
env: TEST=true ESLINT=6 PACKAGE=eslint-config-airbnb
77+
- node_js: "8"
78+
env: TEST=true ESLINT=6 REACT_HOOKS=3 PACKAGE=eslint-config-airbnb
79+
- node_js: "8"
80+
env: TEST=true ESLINT=6 REACT_HOOKS=2.3 PACKAGE=eslint-config-airbnb
81+
- node_js: "8"
82+
env: TEST=true ESLINT=6 REACT_HOOKS=1.7 PACKAGE=eslint-config-airbnb
83+
- node_js: "8"
84+
env: TEST=true ESLINT=5 PACKAGE=eslint-config-airbnb-base
85+
- node_js: "8"
86+
env: TEST=true ESLINT=5 PACKAGE=eslint-config-airbnb
87+
- node_js: "8"
88+
env: TEST=true ESLINT=5 REACT_HOOKS=3 PACKAGE=eslint-config-airbnb
89+
- node_js: "8"
90+
env: TEST=true ESLINT=5 REACT_HOOKS=2.3 PACKAGE=eslint-config-airbnb
91+
- node_js: "8"
92+
env: TEST=true ESLINT=5 REACT_HOOKS=1.7 PACKAGE=eslint-config-airbnb
5893
- node_js: "6"
5994
env: TEST=true ESLINT=5 PACKAGE=eslint-config-airbnb-base
6095
- node_js: "6"

packages/eslint-config-airbnb-base/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@
5757
"babel-preset-airbnb": "^4.5.0",
5858
"babel-tape-runner": "^3.0.0",
5959
"eclint": "^2.8.1",
60-
"eslint": "^5.16.0 || ^6.8.0",
60+
"eslint": "^5.16.0 || ^6.8.0 || ^7.2.0",
6161
"eslint-find-rules": "^3.5.0",
6262
"eslint-plugin-import": "^2.21.2",
6363
"in-publish": "^2.0.1",
6464
"safe-publish-latest": "^1.1.4",
6565
"tape": "^5.0.1"
6666
},
6767
"peerDependencies": {
68-
"eslint": "^5.16.0 || ^6.8.0",
68+
"eslint": "^5.16.0 || ^6.8.0 || ^7.2.0",
6969
"eslint-plugin-import": "^2.21.2"
7070
},
7171
"engines": {

packages/eslint-config-airbnb-base/rules/best-practices.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ module.exports = {
2828
// require default case in switch statements
2929
'default-case': ['error', { commentPattern: '^no default$' }],
3030

31+
// Enforce default clauses in switch statements to be last
32+
// https://eslint.org/docs/rules/default-case-last
33+
// TODO: enable, semver-minor, when eslint v7 is required (which is a major)
34+
'default-case-last': 'off',
35+
3136
// https://eslint.org/docs/rules/default-param-last
3237
// TODO: enable, semver-minor, when eslint v6.4 is required (which is a major)
3338
'default-param-last': 'off',

packages/eslint-config-airbnb-base/rules/errors.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ module.exports = {
9191
// disallow irregular whitespace outside of strings and comments
9292
'no-irregular-whitespace': 'error',
9393

94+
// Disallow Number Literals That Lose Precision
95+
// https://eslint.org/docs/rules/no-loss-of-precision
96+
// TODO: enable, semver-minor, once eslint v7.1 is required (which is major)
97+
'no-loss-of-precision': 'off',
98+
9499
// Disallow characters which are made with multiple code points in character class syntax
95100
// https://eslint.org/docs/rules/no-misleading-character-class
96101
'no-misleading-character-class': 'error',
@@ -131,13 +136,19 @@ module.exports = {
131136
// disallow negating the left operand of relational operators
132137
// https://eslint.org/docs/rules/no-unsafe-negation
133138
'no-unsafe-negation': 'error',
139+
140+
// Disallow useless backreferences in regular expressions
141+
// https://eslint.org/docs/rules/no-useless-backreference
142+
// TODO: enable, semver-minor, once eslint v7 is required (which is major)
143+
'no-useless-backreference': 'off',
144+
134145
// disallow negation of the left operand of an in expression
135146
// deprecated in favor of no-unsafe-negation
136147
'no-negated-in-lhs': 'off',
137148

138149
// Disallow assignments that can lead to race conditions due to usage of await or yield
139150
// https://eslint.org/docs/rules/require-atomic-updates
140-
// TODO: enable, semver-major
151+
// note: not enabled because it is very buggy
141152
'require-atomic-updates': 'off',
142153

143154
// disallow comparisons with the value NaN

packages/eslint-config-airbnb-base/rules/es6.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ module.exports = {
6060
// https://eslint.org/docs/rules/no-new-symbol
6161
'no-new-symbol': 'error',
6262

63+
// Disallow specified names in exports
64+
// https://eslint.org/docs/rules/no-restricted-exports
65+
// TODO enable, semver-minor, once eslint v7 is required (which is major)
66+
'no-restricted-exports': ['off', {
67+
restrictedNamedExports: [
68+
'default', // use `export default` to provide a default export
69+
'then', // this will cause tons of confusion when your module is dynamically `import()`ed
70+
],
71+
}],
72+
6373
// disallow specific imports
6474
// https://eslint.org/docs/rules/no-restricted-imports
6575
'no-restricted-imports': ['off', {

packages/eslint-config-airbnb/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"babel-preset-airbnb": "^4.5.0",
6464
"babel-tape-runner": "^3.0.0",
6565
"eclint": "^2.8.1",
66-
"eslint": "^5.16.0 || ^6.8.0",
66+
"eslint": "^5.16.0 || ^6.8.0 || ^7.2.0",
6767
"eslint-find-rules": "^3.5.0",
6868
"eslint-plugin-import": "^2.21.2",
6969
"eslint-plugin-jsx-a11y": "^6.2.3",
@@ -75,7 +75,7 @@
7575
"tape": "^5.0.1"
7676
},
7777
"peerDependencies": {
78-
"eslint": "^5.16.0 || ^6.8.0",
78+
"eslint": "^5.16.0 || ^6.8.0 || ^7.2.0",
7979
"eslint-plugin-import": "^2.21.2",
8080
"eslint-plugin-jsx-a11y": "^6.2.3",
8181
"eslint-plugin-react": "^7.20.0",

0 commit comments

Comments
 (0)