eslint-config-xo 0.27.2 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/browser.js CHANGED
@@ -1,10 +1,17 @@
1
1
  'use strict';
2
2
  const path = require('path');
3
+ const confusingBrowserGlobals = require('confusing-browser-globals');
3
4
 
4
5
  module.exports = {
5
6
  extends: path.join(__dirname, 'index.js'),
6
7
  env: {
7
8
  node: false,
8
9
  browser: true
10
+ },
11
+ rules: {
12
+ 'no-restricted-globals': [
13
+ 'error',
14
+ ...confusingBrowserGlobals
15
+ ]
9
16
  }
10
17
  };
package/esnext.js CHANGED
@@ -24,8 +24,7 @@ module.exports = {
24
24
  'prefer-numeric-literals': 'error',
25
25
  'prefer-rest-params': 'error',
26
26
  'prefer-spread': 'error',
27
- // TODO: Enable this when targeting Node.js 8
28
- // 'prefer-object-spread': 'error',
27
+ 'prefer-object-spread': 'error',
29
28
  'prefer-destructuring': [
30
29
  'error',
31
30
  {
@@ -48,8 +47,9 @@ module.exports = {
48
47
  enforceForRenamedProperties: false
49
48
  }
50
49
  ],
51
- // TODO: Enable these when targeting Node.js 10
52
- // 'no-useless-catch': 'error',
50
+ 'no-useless-catch': 'error',
51
+
52
+ // Disabled for now as Firefox doesn't support named capture groups and I'm tired of getting issues about the use of named capture groups...
53
53
  // 'prefer-named-capture-group': 'error'
54
54
  }
55
55
  };
package/index.js CHANGED
@@ -9,8 +9,8 @@ module.exports = {
9
9
  }
10
10
  },
11
11
  env: {
12
- node: true,
13
- es6: true
12
+ es2020: true,
13
+ node: true
14
14
  },
15
15
  reportUnusedDisableDirectives: true,
16
16
  rules: {
@@ -28,6 +28,7 @@ module.exports = {
28
28
  'no-control-regex': 'error',
29
29
  'no-debugger': 'error',
30
30
  'no-dupe-args': 'error',
31
+ 'no-dupe-else-if': 'error',
31
32
  'no-dupe-keys': 'error',
32
33
  'no-duplicate-case': 'error',
33
34
  'no-empty-character-class': 'error',
@@ -59,6 +60,7 @@ module.exports = {
59
60
  'no-obj-calls': 'error',
60
61
  'no-prototype-builtins': 'error',
61
62
  'no-regex-spaces': 'error',
63
+ 'no-setter-return': 'error',
62
64
  'no-sparse-arrays': 'error',
63
65
  'no-template-curly-in-string': 'error',
64
66
  'no-unreachable': 'error',
@@ -78,7 +80,12 @@ module.exports = {
78
80
  enforceForClassMembers: true
79
81
  }
80
82
  ],
81
- 'array-callback-return': 'error',
83
+ 'array-callback-return': [
84
+ 'error',
85
+ {
86
+ allowImplicit: true
87
+ }
88
+ ],
82
89
  'block-scoped-var': 'error',
83
90
  complexity: 'warn',
84
91
  curly: 'error',
@@ -90,10 +97,15 @@ module.exports = {
90
97
  'property'
91
98
  ],
92
99
  eqeqeq: 'error',
100
+ 'grouped-accessor-pairs': [
101
+ 'error',
102
+ 'getBeforeSet'
103
+ ],
93
104
  'guard-for-in': 'error',
94
105
  'no-alert': 'error',
95
106
  'no-caller': 'error',
96
107
  'no-case-declarations': 'error',
108
+ 'no-constructor-return': 'error',
97
109
  'no-else-return': [
98
110
  'error',
99
111
  {
@@ -191,22 +203,12 @@ module.exports = {
191
203
  vars: 'all',
192
204
  args: 'after-used',
193
205
  ignoreRestSiblings: true,
194
- argsIgnorePattern: '^_$',
206
+ argsIgnorePattern: /^_$/.source,
195
207
  caughtErrors: 'all',
196
- caughtErrorsIgnorePattern: '^_$'
208
+ caughtErrorsIgnorePattern: /^_$/.source
197
209
  }
198
210
  ],
199
- 'handle-callback-err': 'warn',
200
211
  'no-buffer-constructor': 'error',
201
- 'no-mixed-requires': [
202
- 'error',
203
- {
204
- grouping: true,
205
- allowCall: true
206
- }
207
- ],
208
- 'no-new-require': 'error',
209
- 'no-path-concat': 'error',
210
212
  'no-restricted-imports': [
211
213
  'error',
212
214
  'domain',
@@ -215,14 +217,6 @@ module.exports = {
215
217
  'sys',
216
218
  'colors'
217
219
  ],
218
- 'no-restricted-modules': [
219
- 'error',
220
- 'domain',
221
- 'freelist',
222
- 'smalloc',
223
- 'sys',
224
- 'colors'
225
- ],
226
220
  'array-bracket-newline': [
227
221
  'error',
228
222
  'consistent'
@@ -252,8 +246,8 @@ module.exports = {
252
246
  'error',
253
247
  'always',
254
248
  {
255
- // You can also ignore this rule by wrapping the first word in quotes
256
- ignorePattern: 'pragma|ignore|prettier-ignore',
249
+ // You can also ignore this rule by wrapping the first word in quotes.
250
+ ignorePattern: /pragma|ignore|prettier-ignore/.source,
257
251
  ignoreInlineComments: true,
258
252
  ignoreConsecutiveComments: true
259
253
  }
@@ -398,6 +392,7 @@ module.exports = {
398
392
  next: '*'
399
393
  }
400
394
  ],
395
+ 'prefer-exponentiation-operator': 'error',
401
396
  'quote-props': [
402
397
  'error',
403
398
  'as-needed'
@@ -505,7 +500,12 @@ module.exports = {
505
500
  'no-dupe-class-members': 'error',
506
501
  'no-new-symbol': 'error',
507
502
  'no-this-before-super': 'error',
508
- 'no-useless-computed-key': 'error',
503
+ 'no-useless-computed-key': [
504
+ 'error',
505
+ {
506
+ enforceForClassMembers: true
507
+ }
508
+ ],
509
509
  'no-useless-constructor': 'error',
510
510
  'no-useless-rename': 'error',
511
511
  'require-yield': 'error',
package/license CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "eslint-config-xo",
3
- "version": "0.27.2",
3
+ "version": "0.30.0",
4
4
  "description": "ESLint shareable config for XO",
5
5
  "license": "MIT",
6
6
  "repository": "xojs/eslint-config-xo",
7
+ "funding": "https://github.com/sponsors/sindresorhus",
7
8
  "author": {
8
9
  "name": "Sindre Sorhus",
9
10
  "email": "sindresorhus@gmail.com",
10
- "url": "sindresorhus.com"
11
+ "url": "https://sindresorhus.com"
11
12
  },
12
13
  "engines": {
13
- "node": ">=8"
14
+ "node": ">=10"
14
15
  },
15
16
  "scripts": {
16
17
  "test": "ava"
@@ -49,13 +50,16 @@
49
50
  "hint",
50
51
  "simple"
51
52
  ],
53
+ "dependencies": {
54
+ "confusing-browser-globals": "1.0.9"
55
+ },
52
56
  "devDependencies": {
53
57
  "ava": "^2.3.0",
54
- "eslint": "^6.4.0",
58
+ "eslint": "^7.0.0",
55
59
  "is-plain-obj": "^2.0.0",
56
60
  "temp-write": "^4.0.0"
57
61
  },
58
62
  "peerDependencies": {
59
- "eslint": ">=6.4.0"
63
+ "eslint": ">=7"
60
64
  }
61
65
  }
package/readme.md CHANGED
@@ -14,7 +14,6 @@ See [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicor
14
14
  $ npm install --save-dev eslint-config-xo
15
15
  ```
16
16
 
17
-
18
17
  ## Usage
19
18
 
20
19
  Add some ESLint config to your `package.json`:
@@ -54,7 +53,6 @@ And [`xo/browser`](browser.js) if you're in the browser:
54
53
  }
55
54
  ```
56
55
 
57
-
58
56
  ## Use the XO CLI instead
59
57
 
60
58
  XO is an ESLint wrapper with great defaults.
@@ -73,14 +71,8 @@ Here are some reason why you should use the [XO CLI](https://github.com/xojs/xo)
73
71
 
74
72
  tl;dr You miss out on a lot by just using this config.
75
73
 
76
-
77
74
  ## Related
78
75
 
79
76
  - [eslint-config-xo-space](https://github.com/xojs/eslint-config-xo-space) - ESLint shareable config for XO with 2-space indent
80
77
  - [eslint-config-xo-react](https://github.com/xojs/eslint-config-xo-react) - ESLint shareable config for React to be used with this config
81
78
  - [eslint-config-xo-typescript](https://github.com/xojs/eslint-config-xo-typescript) - ESLint shareable config for TypeScript to be used with this config
82
-
83
-
84
- ## License
85
-
86
- MIT © [Sindre Sorhus](https://sindresorhus.com)