Skip to content

Commit 39a86dc

Browse files
committed
Upgrade XO
1 parent 7ce7a43 commit 39a86dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+942
-962
lines changed

create-ava-rule.js

Lines changed: 54 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
'use strict';
21
const {isDeepStrictEqual} = require('util');
32
const espurify = require('espurify');
43
const enhance = require('enhance-visitors');
@@ -11,92 +10,92 @@ const avaImportDeclarationAsts = [{
1110
type: 'ImportDefaultSpecifier',
1211
local: {
1312
type: 'Identifier',
14-
name: 'test'
15-
}
16-
}
13+
name: 'test',
14+
},
15+
},
1716
],
1817
source: {
1918
type: 'Literal',
20-
value: 'ava'
21-
}
19+
value: 'ava',
20+
},
2221
}, {
2322
type: 'ImportDeclaration',
2423
specifiers: [
2524
{
2625
type: 'ImportSpecifier',
2726
imported: {
2827
type: 'Identifier',
29-
name: 'serial'
28+
name: 'serial',
3029
},
3130
local: {
3231
type: 'Identifier',
33-
name: 'test'
34-
}
35-
}
32+
name: 'test',
33+
},
34+
},
3635
],
3736
source: {
3837
type: 'Literal',
39-
value: 'ava'
40-
}
38+
value: 'ava',
39+
},
4140
}, {
4241
type: 'ImportDeclaration',
4342
specifiers: [
4443
{
4544
type: 'ImportSpecifier',
4645
imported: {
4746
type: 'Identifier',
48-
name: 'serial'
47+
name: 'serial',
4948
},
5049
local: {
5150
type: 'Identifier',
52-
name: 'test'
53-
}
54-
}
51+
name: 'test',
52+
},
53+
},
5554
],
5655
source: {
5756
type: 'Literal',
58-
value: 'ava'
59-
}
57+
value: 'ava',
58+
},
6059
}, {
6160
type: 'ImportDeclaration',
6261
specifiers: [
6362
{
6463
type: 'ImportSpecifier',
6564
imported: {
6665
type: 'Identifier',
67-
name: 'serial'
66+
name: 'serial',
6867
},
6968
local: {
7069
type: 'Identifier',
71-
name: 'serial'
72-
}
73-
}
70+
name: 'serial',
71+
},
72+
},
7473
],
7574
source: {
7675
type: 'Literal',
77-
value: 'ava'
78-
}
76+
value: 'ava',
77+
},
7978
}];
8079

8180
const avaVariableDeclaratorAsts = [{
8281
type: 'VariableDeclarator',
8382
id: {
8483
type: 'Identifier',
85-
name: 'test'
84+
name: 'test',
8685
},
8786
init: {
8887
type: 'CallExpression',
8988
callee: {
9089
type: 'Identifier',
91-
name: 'require'
90+
name: 'require',
9291
},
9392
arguments: [
9493
{
9594
type: 'Literal',
96-
value: 'ava'
97-
}
98-
]
99-
}
95+
value: 'ava',
96+
},
97+
],
98+
},
10099
}, {
101100
type: 'VariableDeclarator',
102101
id: {
@@ -105,31 +104,31 @@ const avaVariableDeclaratorAsts = [{
105104
type: 'Property',
106105
key: {
107106
type: 'Identifier',
108-
name: 'serial'
107+
name: 'serial',
109108
},
110109
value: {
111110
type: 'Identifier',
112-
name: 'serial'
111+
name: 'serial',
113112
},
114113
kind: 'init',
115114
method: false,
116115
shorthand: true,
117-
computed: false
118-
}]
116+
computed: false,
117+
}],
119118
},
120119
init: {
121120
type: 'CallExpression',
122121
callee: {
123122
type: 'Identifier',
124-
name: 'require'
123+
name: 'require',
125124
},
126125
arguments: [
127126
{
128127
type: 'Literal',
129-
value: 'ava'
130-
}
131-
]
132-
}
128+
value: 'ava',
129+
},
130+
],
131+
},
133132
}, {
134133
type: 'VariableDeclarator',
135134
id: {
@@ -138,31 +137,31 @@ const avaVariableDeclaratorAsts = [{
138137
type: 'Property',
139138
key: {
140139
type: 'Identifier',
141-
name: 'serial'
140+
name: 'serial',
142141
},
143142
value: {
144143
type: 'Identifier',
145-
name: 'test'
144+
name: 'test',
146145
},
147146
kind: 'init',
148147
method: false,
149148
shorthand: false,
150-
computed: false
151-
}]
149+
computed: false,
150+
}],
152151
},
153152
init: {
154153
type: 'CallExpression',
155154
callee: {
156155
type: 'Identifier',
157-
name: 'require'
156+
name: 'require',
158157
},
159158
arguments: [
160159
{
161160
type: 'Literal',
162-
value: 'ava'
163-
}
164-
]
165-
}
161+
value: 'ava',
162+
},
163+
],
164+
},
166165
}];
167166

168167
function isTestFunctionCall(node) {
@@ -211,22 +210,22 @@ module.exports = () => { // eslint-disable-line eslint-plugin/prefer-object-rule
211210
},
212211
'Program:exit': () => {
213212
isTestFile = false;
214-
}
213+
},
215214
};
216215

217216
return {
218217
hasTestModifier: mod => getTestModifierNames(currentTestNode).includes(mod),
219218
hasNoUtilityModifier: () => {
220219
const modifiers = getTestModifierNames(currentTestNode);
221-
return !modifiers.includes('before') &&
222-
!modifiers.includes('beforeEach') &&
223-
!modifiers.includes('after') &&
224-
!modifiers.includes('afterEach') &&
225-
!modifiers.includes('macro');
220+
return !modifiers.includes('before')
221+
&& !modifiers.includes('beforeEach')
222+
&& !modifiers.includes('after')
223+
&& !modifiers.includes('afterEach')
224+
&& !modifiers.includes('macro');
226225
},
227226
isInTestFile: () => isTestFile,
228227
isInTestNode: () => currentTestNode,
229228
isTestNode: node => currentTestNode === node,
230-
merge: customHandlers => enhance.mergeVisitors([predefinedRules, customHandlers])
229+
merge: customHandlers => enhance.mergeVisitors([predefinedRules, customHandlers]),
231230
};
232231
};

index.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
'use strict';
21
const path = require('path');
32
const importModules = require('import-modules');
43

@@ -7,21 +6,21 @@ module.exports = {
76
configs: {
87
recommended: {
98
env: {
10-
es6: true
9+
es6: true,
1110
},
1211
parserOptions: {
1312
ecmaVersion: 2021,
14-
sourceType: 'module'
13+
sourceType: 'module',
1514
},
1615
plugins: [
17-
'ava'
16+
'ava',
1817
],
1918
rules: {
2019
'ava/assertion-arguments': 'error',
2120
'ava/hooks-order': 'error',
2221
'ava/max-asserts': [
2322
'off',
24-
5
23+
5,
2524
],
2625
'ava/no-async-fn-without-await': 'error',
2726
'ava/no-duplicate-modifiers': 'error',
@@ -46,8 +45,8 @@ module.exports = {
4645
'ava/use-t': 'error',
4746
'ava/use-t-throws-async-well': 'error',
4847
'ava/use-test': 'error',
49-
'ava/use-true-false': 'error'
50-
}
51-
}
52-
}
48+
'ava/use-true-false': 'error',
49+
},
50+
},
51+
},
5352
};

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"outdent": "^0.8.0",
5353
"pify": "^5.0.0",
5454
"tempy": "^1.0.1",
55-
"xo": "^0.38.2"
55+
"xo": "^0.44.0"
5656
},
5757
"peerDependencies": {
5858
"eslint": ">=7.22.0"
@@ -80,7 +80,10 @@
8080
],
8181
"rules": {
8282
"ava/no-ignored-test-files": "off",
83-
"import/extensions": "off"
83+
"eslint-plugin/prefer-message-ids": "off",
84+
"eslint-plugin/require-meta-docs-description": "off",
85+
"import/extensions": "off",
86+
"unicorn/prefer-module": "off"
8487
}
8588
},
8689
"c8": {

0 commit comments

Comments
 (0)