Skip to content

Commit 5c9a336

Browse files
committed
Upgrade dependencies
1 parent 42e9445 commit 5c9a336

13 files changed

+47
-43
lines changed

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"dependencies": {
3333
"deep-strict-equal": "^0.2.0",
3434
"enhance-visitors": "^1.0.0",
35-
"espree": "^6.1.2",
35+
"espree": "^7.1.0",
3636
"espurify": "^2.0.1",
3737
"import-modules": "^2.0.0",
3838
"micro-spelling-correcter": "^1.1.1",
@@ -42,19 +42,19 @@
4242
"devDependencies": {
4343
"ava": "^2.3.0",
4444
"babel-eslint": "^10.0.2",
45-
"chalk": "^2.4.2",
45+
"chalk": "^4.1.0",
4646
"del": "^5.0.0",
4747
"eslint": "6.2.0",
48-
"eslint-ava-rule-tester": "^3.0.0",
49-
"eslint-plugin-eslint-plugin": "2.1.0",
50-
"execa": "^2.0.4",
48+
"eslint-ava-rule-tester": "^4.0.0",
49+
"eslint-plugin-eslint-plugin": "^2.2.2",
50+
"execa": "^4.0.2",
5151
"js-combinatorics": "^0.5.4",
5252
"listr": "^0.14.3",
53-
"nyc": "^14.1.1",
53+
"nyc": "^15.1.0",
5454
"outdent": "^0.7.0",
55-
"pify": "^4.0.1",
56-
"tempy": "^0.3.0",
57-
"xo": "^0.24.0"
55+
"pify": "^5.0.0",
56+
"tempy": "^0.5.0",
57+
"xo": "^0.32.0"
5858
},
5959
"peerDependencies": {
6060
"eslint": ">=6.2.0"

rules/hooks-order.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ const create = context => {
8888

8989
const sourceCode = context.getSourceCode();
9090

91+
// TODO: Remove `.reduce()` usage.
92+
// eslint-disable-next-line unicorn/no-reduce
9193
const selectors = checks.reduce((result, check) => {
9294
result[check.selector] = visitIf([
9395
ava.isInTestFile,
@@ -117,11 +119,11 @@ const create = context => {
117119
const start = nodeEarlier.parent.range[1];
118120
const end = node.parent.range[1];
119121

120-
let text = sourceCode.getText().substring(start, end);
122+
let text = sourceCode.getText().slice(start, end);
121123

122124
// Preserve newline previously between hooks
123125
if (source.length >= (start + 1) && source[start + 1] === '\n') {
124-
text = text.substring(1) + '\n';
126+
text = text.slice(1) + '\n';
125127
}
126128

127129
// Preserve newline that was previously before hooks

rules/max-asserts.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const createAvaRule = require('../create-ava-rule');
55

66
const MAX_ASSERTIONS_DEFAULT = 5;
77

8-
const notAssertionMethods = ['plan', 'end'];
8+
const notAssertionMethods = new Set(['plan', 'end']);
99

1010
const create = context => {
1111
const ava = createAvaRule();
@@ -28,7 +28,7 @@ const create = context => {
2828

2929
if (
3030
callee.property &&
31-
!notAssertionMethods.includes(callee.property.name) &&
31+
!notAssertionMethods.has(callee.property.name) &&
3232
util.getNameOfRootNodeObject(callee) === 't'
3333
) {
3434
const members = util.getMembers(callee).filter(name => name !== 'skip');

rules/no-duplicate-modifiers.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ const create = context => {
2929
return;
3030
}
3131

32-
testModifiers.reduce((prev, current) => {
33-
if (prev.name === current.name) {
32+
// TODO: Remove `.reduce()` usage.
33+
// eslint-disable-next-line unicorn/no-reduce
34+
testModifiers.reduce((previous, current) => {
35+
if (previous.name === current.name) {
3436
context.report({
3537
node: current,
3638
message: `Duplicate test modifier \`.${current.name}\`.`

rules/no-identical-title.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const createAvaRule = require('../create-ava-rule');
77

88
const purify = node => node && espurify(node);
99

10-
const isStaticTemplateLiteral = node => node.expressions.every(isStatic);
10+
const isStaticTemplateLiteral = node => node.expressions.every(expression => isStatic(expression));
1111

1212
const isStatic = node => node.type === 'Literal' ||
1313
(node.type === 'TemplateLiteral' && isStaticTemplateLiteral(node)) ||

rules/no-statement-after-end.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const create = context => {
2727

2828
currentSegmentInfo = {
2929
ended: false,
30-
prev: segment.prevSegments.map(prevSegment => segmentInfoMap.get(prevSegment.id))
30+
prev: segment.prevSegments.map(previousSegment => segmentInfoMap.get(previousSegment.id))
3131
};
3232

3333
segmentInfoMap.set(segment.id, currentSegmentInfo);

rules/no-todo-implementation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const create = context => {
1111
ava.isInTestFile,
1212
ava.isTestNode
1313
])(node => {
14-
if (ava.hasTestModifier('todo') && node.arguments.some(util.isFunctionExpression)) {
14+
if (ava.hasTestModifier('todo') && node.arguments.some(argument => util.isFunctionExpression(argument))) {
1515
context.report({
1616
node,
1717
message: '`test.todo()` should not be passed an implementation function.'

rules/no-unknown-modifiers.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const {visitIf} = require('enhance-visitors');
33
const util = require('../util');
44
const createAvaRule = require('../create-ava-rule');
55

6-
const modifiers = [
6+
const modifiers = new Set([
77
'after',
88
'afterEach',
99
'always',
@@ -15,10 +15,10 @@ const modifiers = [
1515
'skip',
1616
'todo',
1717
'failing'
18-
];
18+
]);
1919

2020
const unknownModifiers = node => util.getTestModifiers(node)
21-
.filter(modifier => !modifiers.includes(modifier.name));
21+
.filter(modifier => !modifiers.has(modifier.name));
2222

2323
const create = context => {
2424
const ava = createAvaRule();

rules/prefer-t-regex.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ const util = require('../util');
66
const create = context => {
77
const ava = createAvaRule();
88

9-
const booleanTests = [
9+
const booleanTests = new Set([
1010
'true',
1111
'false',
1212
'truthy',
1313
'falsy'
14-
];
14+
]);
1515

1616
const findReference = name => {
1717
const reference = context.getScope().references.find(reference => reference.identifier.name === name);
@@ -26,7 +26,7 @@ const create = context => {
2626
])(node => {
2727
// Call a boolean assertion, for example, `t.true`, `t.false`, …
2828
const isBooleanAssertion = node.callee.type === 'MemberExpression' &&
29-
booleanTests.includes(node.callee.property.name) &&
29+
booleanTests.has(node.callee.property.name) &&
3030
util.getNameOfRootNodeObject(node.callee) === 't';
3131

3232
if (!isBooleanAssertion) {

rules/use-true-false.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const deepStrictEqual = require('deep-strict-equal');
66
const util = require('../util');
77
const createAvaRule = require('../create-ava-rule');
88

9-
const booleanBinaryOperators = [
9+
const booleanBinaryOperators = new Set([
1010
'==',
1111
'===',
1212
'!=',
@@ -15,7 +15,7 @@ const booleanBinaryOperators = [
1515
'<=',
1616
'>',
1717
'>='
18-
];
18+
]);
1919

2020
const knownBooleanSignatures = [
2121
'isFinite()',
@@ -62,7 +62,7 @@ const create = context => {
6262
const argument = node.arguments[0];
6363

6464
if (argument &&
65-
((argument.type === 'BinaryExpression' && booleanBinaryOperators.includes(argument.operator)) ||
65+
((argument.type === 'BinaryExpression' && booleanBinaryOperators.has(argument.operator)) ||
6666
(argument.type === 'UnaryExpression' && argument.operator === '!') ||
6767
(argument.type === 'Literal' && argument.value === Boolean(argument.value)) ||
6868
(matchesKnownBooleanExpression(argument)))

0 commit comments

Comments
 (0)