Skip to content

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Mar 24, 2021
1 parent ae34aea commit 55b7214
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 33 deletions.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,31 @@
"deep-strict-equal": "^0.2.0",
"enhance-visitors": "^1.0.0",
"eslint-utils": "^2.1.0",
"espree": "^7.3.0",
"espree": "^7.3.1",
"espurify": "^2.0.1",
"import-modules": "^2.0.0",
"import-modules": "^2.1.0",
"micro-spelling-correcter": "^1.1.1",
"pkg-dir": "^4.2.0",
"pkg-dir": "^5.0.0",
"resolve-from": "^5.0.0"
},
"devDependencies": {
"ava": "^3.11.1",
"ava": "^3.15.0",
"babel-eslint": "^10.1.0",
"c8": "^7.3.0",
"c8": "^7.6.0",
"chalk": "^4.1.0",
"del": "^5.1.0",
"del": "^6.0.0",
"eslint": "^7.8.1",
"eslint-ava-rule-tester": "^4.0.0",
"eslint-plugin-eslint-plugin": "^2.3.0",
"execa": "^4.0.3",
"execa": "^5.0.0",
"listr": "^0.14.3",
"outdent": "^0.7.1",
"outdent": "^0.8.0",
"pify": "^5.0.0",
"tempy": "^0.6.0",
"xo": "^0.33.0"
"tempy": "^1.0.1",
"xo": "^0.38.2"
},
"peerDependencies": {
"eslint": ">=7.7.0"
"eslint": ">=7.22.0"
},
"ava": {
"files": [
Expand Down
2 changes: 1 addition & 1 deletion rules/hooks-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const create = context => {
const sourceCode = context.getSourceCode();

// TODO: Remove `.reduce()` usage.
// eslint-disable-next-line unicorn/no-reduce
// eslint-disable-next-line unicorn/no-array-reduce
const selectors = checks.reduce((result, check) => {
result[check.selector] = visitIf([
ava.isInTestFile,
Expand Down
2 changes: 1 addition & 1 deletion rules/no-duplicate-modifiers.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const create = context => {
}

// TODO: Remove `.reduce()` usage.
// eslint-disable-next-line unicorn/no-reduce
// eslint-disable-next-line unicorn/no-array-reduce
testModifiers.reduce((previous, current) => {
if (previous.name === current.name) {
context.report({
Expand Down
10 changes: 3 additions & 7 deletions rules/no-statement-after-end.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@ const create = context => {
}

function checkForEndExpression(node) {
if (isEndExpression(node)) {
if (currentSegmentInfo !== undefined) {
currentSegmentInfo.ended = true;
}
if (isEndExpression(node) && currentSegmentInfo !== undefined) {
currentSegmentInfo.ended = true;
}
}

Expand All @@ -65,9 +63,7 @@ const create = context => {
return;
}

const ended = [currentSegmentInfo]
.concat(currentSegmentInfo.prev)
.filter(info => info.ended);
const ended = [currentSegmentInfo, ...currentSegmentInfo.prev].filter(info => info.ended);

// If this segment or any previous segment is already ended, further statements are not allowed, report as an error.
if (ended.length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion rules/no-unknown-modifiers.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const create = context => {
])(node => {
const unknown = unknownModifiers(node);

if (unknown.length !== 0) {
if (unknown.length > 0) {
context.report({
node: unknown[0],
message: `Unknown test modifier \`.${unknown[0].name}\`.`
Expand Down
2 changes: 1 addition & 1 deletion rules/test-title.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const create = context => {
ava.isTestNode,
ava.hasNoHookModifier
])(node => {
const firstArgumentIsFunction = node.arguments.length < 1 || util.isFunctionExpression(node.arguments[0]);
const firstArgumentIsFunction = node.arguments.length === 0 || util.isFunctionExpression(node.arguments[0]);

if (firstArgumentIsFunction) {
context.report({
Expand Down
2 changes: 1 addition & 1 deletion rules/use-t-well.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const isCallExpression = node =>

const getMemberNodes = node => {
if (node.object.type === 'MemberExpression') {
return getMemberNodes(node.object).concat(node.property);
return [...getMemberNodes(node.object), node.property];
}

return [node.property];
Expand Down
2 changes: 1 addition & 1 deletion test/max-asserts.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ruleTester.run('max-asserts', rule, {
},
{
code: `${header} test(t => { ${nbAssertions(10)} }); test(t => { ${nbAssertions(10)} });`,
errors: errors.concat(errors) // Should have two errors, one per test
errors: [...errors, ...errors] // Should have two errors, one per test
}
]
});
10 changes: 4 additions & 6 deletions test/no-duplicate-modifiers.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,15 @@ const invalid = modifiers.map(modifier => ({
}));

ruleTester.run('no-duplicate-modifiers', rule, {
valid: valid.concat([
valid: [...valid,
`${header}test(t => {});`,
`${header}test.cb.only(t => {});`,
`${header}test.after.always(t => {});`,
`${header}test.afterEach.always(t => {});`,
`${header}test.failing.cb(t => {});`,
// Shouldn't be triggered since it's not a test file
'test.serial.serial(t => {});'
]),
invalid: invalid.concat([
'test.serial.serial(t => {});'],
invalid: [...invalid,
{
code: `${header}test.serial.cb.only.serial(t => {});`,
errors: [
Expand All @@ -58,6 +57,5 @@ ruleTester.run('no-duplicate-modifiers', rule, {
column: 21
}
]
}
])
}]
});
6 changes: 3 additions & 3 deletions util.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function getTestModifiers(node) {
}

if (node.type === 'MemberExpression') {
return getTestModifiers(node.object).concat(node.property);
return [...getTestModifiers(node.object), node.property];
}

return [];
Expand Down Expand Up @@ -79,7 +79,7 @@ const getMembers = node => {
const {name} = node.property;

if (node.object.type === 'MemberExpression') {
return getMembers(node.object).concat(name);
return [...getMembers(node.object), name];
}

return [name];
Expand Down Expand Up @@ -125,4 +125,4 @@ const assertionMethodNames = [...assertionMethodsNumberArguments.keys()];

exports.assertionMethodsNumArguments = assertionMethodsNumberArguments;
exports.assertionMethods = new Set(assertionMethodNames);
exports.executionMethods = new Set(assertionMethodNames.concat(['end', 'plan', 'log', 'teardown', 'timeout']));
exports.executionMethods = new Set([...assertionMethodNames, 'end', 'plan', 'log', 'teardown', 'timeout']);

0 comments on commit 55b7214

Please sign in to comment.