Skip to content

Commit d7fa875

Browse files
committed
Require Node.js 10
1 parent ab3e01a commit d7fa875

File tree

9 files changed

+57
-97
lines changed

9 files changed

+57
-97
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ language: node_js
55
node_js:
66
- '12'
77
- '10'
8-
- '8'
98
after_success:
109
- './node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls'

config/plugins.js

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ module.exports = {
3232
rules: {
3333
'no-use-extend-native/no-use-extend-native': 'error',
3434

35-
// TODO: Enable this again in the minor XO release.
35+
// TODO: Enable this again in the next XO release.
36+
// Start with just a manual list of some non-contreversial abbreviations.
37+
//
3638
// TODO: Remove this override at some point.
3739
// It's just here to ease users into readable variable names.
3840
// 'unicorn/prevent-abbreviations': [
3941
// 'error',
4042
// {
41-
// checkProperties: false,
4243
// checkFilenames: false,
4344
// replacements: {
4445
// args: false,
@@ -53,16 +54,14 @@ module.exports = {
5354
// ],
5455
'unicorn/prevent-abbreviations': 'off',
5556

57+
// TODO: Enable this when targeting Node.js 12.
58+
'unicorn/prefer-flat-map': 'off',
59+
5660
// TODO: Remove this override when the rule is more stable.
5761
'unicorn/consistent-function-scoping': 'off',
5862

59-
// TODO: Change the rule default for this.
60-
'unicorn/expiring-todo-comments': [
61-
'error',
62-
{
63-
allowWarningComments: true
64-
}
65-
],
63+
// TODO: Enable it again when the bugs are fixed.
64+
'unicorn/regex-shorthand': 'off',
6665

6766
// TODO: Temporarily disabled as the rule is buggy.
6867
'function-call-argument-newline': 'off',
@@ -77,10 +76,7 @@ module.exports = {
7776
'promise/no-new-statics': 'error',
7877
'promise/no-return-in-finally': 'error',
7978
'promise/valid-params': 'error',
80-
81-
// TODO: Enable this when XO targets Node.js 8
82-
// 'promise/prefer-await-to-then': 'error',
83-
79+
'promise/prefer-await-to-then': 'error',
8480
'import/default': 'error',
8581
'import/export': 'error',
8682
'import/extensions': [
@@ -220,7 +216,8 @@ module.exports = {
220216
'error',
221217
'always'
222218
],
223-
// TODO: Enable these when XO targets Node.js 10
219+
220+
// Enable these when targeting Node.js 12.
224221
// 'node/prefer-global/text-decoder': [
225222
// 'error',
226223
// 'always'
@@ -229,14 +226,17 @@ module.exports = {
229226
// 'error',
230227
// 'always'
231228
// ],
232-
// 'node/prefer-global/url-search-params': [
233-
// 'error',
234-
// 'always'
235-
// ],
236-
// 'node/prefer-global/url': [
237-
// 'error',
238-
// 'always'
239-
// ]
229+
230+
'node/prefer-global/url-search-params': [
231+
'error',
232+
'always'
233+
],
234+
'node/prefer-global/url': [
235+
'error',
236+
'always'
237+
],
238+
239+
// Enable these when targeting Node.js 12.
240240
// 'node/prefer-promises/dns': 'error',
241241
// 'node/prefer-promises/fs': 'error',
242242

@@ -253,9 +253,6 @@ module.exports = {
253253
// 'eslint-comments/no-unlimited-disable': 'error',
254254

255255
'eslint-comments/no-unused-disable': 'error',
256-
'eslint-comments/no-unused-enable': 'error',
257-
258-
// Disabled by default, enabled only in Node.js >= 11 in option-manager.js
259-
'unicorn/prefer-flat-map': 'off'
256+
'eslint-comments/no-unused-enable': 'error'
260257
}
261258
};

lib/options-manager.js

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ const DEFAULT_CONFIG = {
6666
* With `engines.node` set to `>=8` the rule `plugin/rule` will be used with the config `{prop: 'node-8-conf'}`.
6767
*/
6868
const ENGINE_RULES = {
69-
'promise/prefer-await-to-then': {
70-
'7.6.0': 'error'
71-
},
72-
'prefer-object-spread': {
73-
'8.3.0': 'error'
74-
},
7569
'node/prefer-global/text-decoder': {
7670
'11.0.0': [
7771
'error',
@@ -84,30 +78,12 @@ const ENGINE_RULES = {
8478
'always'
8579
]
8680
},
87-
'node/prefer-global/url-search-params': {
88-
'10.0.0': [
89-
'error',
90-
'always'
91-
]
92-
},
93-
'node/prefer-global/url': {
94-
'10.0.0': [
95-
'error',
96-
'always'
97-
]
98-
},
9981
'node/prefer-promises/dns': {
10082
'12.0.0': 'error'
10183
},
10284
'node/prefer-promises/fs': {
10385
'12.0.0': 'error'
10486
},
105-
'no-useless-catch': {
106-
'10.0.0': 'error'
107-
},
108-
'prefer-named-capture-group': {
109-
'10.0.0': 'error'
110-
},
11187
'unicorn/prefer-flat-map': {
11288
'11.0.0': 'error'
11389
}

package.json

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
"description": "JavaScript linter with great defaults",
55
"license": "MIT",
66
"repository": "xojs/xo",
7+
"funding": "https://github.com/sponsors/sindresorhus",
78
"author": {
89
"name": "Sindre Sorhus",
910
"email": "[email protected]",
1011
"url": "sindresorhus.com"
1112
},
1213
"bin": "cli.js",
1314
"engines": {
14-
"node": ">=8"
15+
"node": ">=10.18"
1516
},
1617
"scripts": {
1718
"test": "eslint --quiet . && nyc ava"
@@ -50,18 +51,18 @@
5051
"dependencies": {
5152
"arrify": "^2.0.1",
5253
"debug": "^4.1.0",
53-
"eslint": "^6.4.0",
54-
"eslint-config-prettier": "^6.3.0",
55-
"eslint-config-xo": "^0.27.1",
56-
"eslint-formatter-pretty": "^2.0.0",
57-
"eslint-plugin-ava": "^9.0.0",
58-
"eslint-plugin-eslint-comments": "^3.0.1",
59-
"eslint-plugin-import": "^2.18.2",
60-
"eslint-plugin-no-use-extend-native": "^0.4.0",
61-
"eslint-plugin-node": "^10.0.0",
62-
"eslint-plugin-prettier": "^3.1.1",
63-
"eslint-plugin-promise": "^4.0.0",
64-
"eslint-plugin-unicorn": "^12.0.0",
54+
"eslint": "^6.8.0",
55+
"eslint-config-prettier": "^6.10.0",
56+
"eslint-config-xo": "^0.28.0",
57+
"eslint-formatter-pretty": "^3.0.1",
58+
"eslint-plugin-ava": "^10.0.1",
59+
"eslint-plugin-eslint-comments": "^3.1.2",
60+
"eslint-plugin-import": "^2.20.1",
61+
"eslint-plugin-no-use-extend-native": "^0.4.1",
62+
"eslint-plugin-node": "^11.0.0",
63+
"eslint-plugin-prettier": "^3.1.2",
64+
"eslint-plugin-promise": "^4.2.1",
65+
"eslint-plugin-unicorn": "^16.1.1",
6566
"find-cache-dir": "^3.0.0",
6667
"get-stdin": "^7.0.0",
6768
"globby": "^9.0.0",
@@ -75,18 +76,18 @@
7576
"prettier": "^1.15.2",
7677
"resolve-cwd": "^3.0.0",
7778
"resolve-from": "^5.0.0",
78-
"semver": "^6.3.0",
79+
"semver": "^7.1.3",
7980
"slash": "^3.0.0",
80-
"update-notifier": "^3.0.1"
81+
"update-notifier": "^4.0.0"
8182
},
8283
"devDependencies": {
8384
"ava": "^1.1.0",
8485
"coveralls": "^3.0.6",
85-
"eslint-config-xo-react": "^0.20.0",
86+
"eslint-config-xo-react": "^0.22.0",
8687
"eslint-plugin-react": "^7.14.3",
8788
"eslint-plugin-react-hooks": "^2.0.1",
88-
"execa": "^1.0.0",
89-
"nyc": "^14.1.1",
89+
"execa": "^4.0.0",
90+
"nyc": "^15.0.0",
9091
"pify": "^4.0.0",
9192
"proxyquire": "^2.1.3",
9293
"temp-write": "^4.0.0"

0 commit comments

Comments
 (0)