Skip to content

Commit 42857ea

Browse files
committed
feat(unicorn): update xo to eslint-plugin-unicorn
1 parent dae98a3 commit 42857ea

3 files changed

Lines changed: 18 additions & 8 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"eslint-plugin-new-with-error": "^1.1.0",
4040
"eslint-plugin-no-use-extend-native": "^0.3.4",
4141
"eslint-plugin-react": "^7.0.1",
42-
"eslint-plugin-xo": "^0.4.0",
42+
"eslint-plugin-unicorn": "^2.1.1",
4343
"is-plain-obj": "^1.0.0",
4444
"nyc": "^10.3.2",
4545
"semantic-release": "^4.3.5"

src/index.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
},
55
plugins: [
66
'no-use-extend-native',
7-
'xo'
7+
'unicorn'
88
],
99
rules: {
1010
'accessor-pairs': 2,
@@ -227,10 +227,20 @@ module.exports = {
227227
'vars-on-top': 2,
228228
'wrap-iife': [2, 'outside'],
229229
'wrap-regex': 2,
230-
'xo/catch-error-name': 0,
231-
'xo/filename-case': [2, {case: 'kebabCase'}],
232-
'xo/no-process-exit': 2,
233-
'xo/throw-new-error': 2,
230+
'unicorn/catch-error-name': 0,
231+
'unicorn/custom-error-definition': 2,
232+
'unicorn/escape-case': 2,
233+
'unicorn/explicit-length-check': 0,
234+
'unicorn/filename-case': [2, {case: 'kebabCase'}],
235+
'unicorn/no-abusive-eslint-disable': 2,
236+
'unicorn/no-array-instanceof': 2,
237+
'unicorn/no-hex-escape': 2,
238+
'unicorn/no-new-buffer': 2,
239+
'unicorn/no-process-exit': 2,
240+
'unicorn/number-literal-case': 2,
241+
'unicorn/prefer-starts-ends-with': 2,
242+
'unicorn/prefer-type-error': 2,
243+
'unicorn/throw-new-error': 2,
234244
yoda: [2, 'never']
235245
}
236246
}

test/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ test('index should include no-use-extend-native', t => {
2222
})
2323

2424
test('index should include xo', t => {
25-
t.truthy(config.plugins.indexOf('xo') > -1)
25+
t.truthy(config.plugins.indexOf('unicorn') > -1)
2626
})
2727

2828
test('esnext should es6 env', t => {
@@ -41,7 +41,7 @@ test('jsx should have browser env', t => {
4141
test('jsx should add react plugin', t => {
4242
t.truthy(jsx.plugins.indexOf('no-use-extend-native') > -1)
4343
t.truthy(jsx.plugins.indexOf('react') > -1)
44-
t.truthy(jsx.plugins.indexOf('xo') > -1)
44+
t.truthy(jsx.plugins.indexOf('unicorn') > -1)
4545
})
4646

4747
test('jsx should have jsx ecmaFeature', t => {

0 commit comments

Comments
 (0)