Skip to content

Commit 0f58aaf

Browse files
committed
chore: update outdated dev dependencies (#577)
Closes #562 Closes #529 Closes #567 Closes #526 Closes #547 Closes #554 Closes #528 Closes #602 Closes #609 Closes #647
1 parent 1755965 commit 0f58aaf

11 files changed

+1634
-1794
lines changed

docs/rules/consistent-test-it.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ test.only('foo'); // invalid
5959
/*eslint jest/consistent-test-it: ["error", {"fn": "it", "withinDescribe": "test"}]*/
6060

6161
it('foo'); // valid
62-
describe('foo', function() {
62+
describe('foo', function () {
6363
test('bar'); // valid
6464
});
6565

6666
test('foo'); // invalid
67-
describe('foo', function() {
67+
describe('foo', function () {
6868
it('bar'); // invalid
6969
});
7070
```
@@ -78,12 +78,12 @@ nested within `describe` to use `it`.
7878
/*eslint jest/consistent-test-it: ["error"]*/
7979

8080
test('foo'); // valid
81-
describe('foo', function() {
81+
describe('foo', function () {
8282
it('bar'); // valid
8383
});
8484

8585
it('foo'); // invalid
86-
describe('foo', function() {
86+
describe('foo', function () {
8787
test('bar'); // invalid
8888
});
8989
```

docs/rules/expect-expect.md

+5-12
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ import { expectSaga } from 'redux-saga-test-plan';
5656
import { addSaga } from '../src/sagas';
5757

5858
test('returns sum', () => {
59-
expectSaga(addSaga, 1, 1)
60-
.returns(2)
61-
.run();
59+
expectSaga(addSaga, 1, 1).returns(2).run();
6260
});
6361
```
6462

@@ -72,9 +70,7 @@ import { expectSaga } from 'redux-saga-test-plan';
7270
import { addSaga } from '../src/sagas';
7371

7472
test('returns sum', () => {
75-
expectSaga(addSaga, 1, 1)
76-
.returns(2)
77-
.run();
73+
expectSaga(addSaga, 1, 1).returns(2).run();
7874
});
7975
```
8076

@@ -100,12 +96,9 @@ const express = require('express');
10096

10197
const app = express();
10298

103-
describe('GET /user', function() {
104-
it('responds with json', function(done) {
105-
request(app)
106-
.get('/user')
107-
.expect('Content-Type', /json/)
108-
.expect(200, done);
99+
describe('GET /user', function () {
100+
it('responds with json', function (done) {
101+
request(app).get('/user').expect('Content-Type', /json/).expect(200, done);
109102
});
110103
});
111104
```

docs/rules/no-export.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Examples of **incorrect** code for this rule:
1515
```js
1616
export function myHelper() {}
1717

18-
module.exports = function() {};
18+
module.exports = function () {};
1919

2020
module.exports = {
2121
something: 'that should be moved to a non-test file',

docs/rules/no-test-callback.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ test('myFunction()', done => {
5555
// ...
5656
});
5757

58-
test('myFunction()', function(done) {
58+
test('myFunction()', function (done) {
5959
// ...
6060
});
6161
```

docs/rules/no-test-return-statement.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ body.
1515

1616
// valid:
1717

18-
it('noop', function() {});
18+
it('noop', function () {});
1919

2020
test('noop', () => {});
2121

@@ -27,7 +27,7 @@ test('one', () => {
2727
expect(1).toBe(1);
2828
});
2929

30-
it('one', function() {
30+
it('one', function () {
3131
expect(1).toBe(1);
3232
});
3333

@@ -41,7 +41,7 @@ test('return an expect', () => {
4141
return expect(1).toBe(1);
4242
});
4343

44-
it('returning a promise', function() {
44+
it('returning a promise', function () {
4545
return new Promise(res => setTimeout(res, 100)).then(() => expect(1).toBe(1));
4646
});
4747
```

docs/rules/valid-title.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ it(123, () => {});
5555
describe(String(/.+/), () => {});
5656
describe(myFunction, () => {});
5757
xdescribe(myFunction, () => {});
58-
describe(6, function() {});
58+
describe(6, function () {});
5959
```
6060

6161
Examples of **correct** code for this rule:
@@ -82,7 +82,7 @@ fdescribe('is a string', () => {});
8282
describe(String(/.+/), () => {});
8383
describe(myFunction, () => {});
8484
xdescribe(myFunction, () => {});
85-
describe(6, function() {});
85+
describe(6, function () {});
8686
```
8787

8888
**duplicatePrefix**

package.json

+17-23
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,8 @@
4242
]
4343
},
4444
"lint-staged": {
45-
"*.{js,ts}": [
46-
"eslint --fix",
47-
"git add"
48-
],
49-
"*.{md,json}": [
50-
"prettier --write",
51-
"git add"
52-
]
45+
"*.{js,ts}": "eslint --fix",
46+
"*.{md,json}": "prettier --write"
5347
},
5448
"prettier": {
5549
"arrowParens": "avoid",
@@ -95,37 +89,37 @@
9589
"@babel/core": "^7.4.4",
9690
"@babel/preset-env": "^7.4.4",
9791
"@babel/preset-typescript": "^7.3.3",
98-
"@commitlint/cli": "^8.2.0",
99-
"@commitlint/config-conventional": "^8.2.0",
92+
"@commitlint/cli": "^9.1.1",
93+
"@commitlint/config-conventional": "^9.1.1",
10094
"@schemastore/package": "^0.0.6",
101-
"@semantic-release/changelog": "^3.0.5",
102-
"@semantic-release/git": "^7.0.17",
95+
"@semantic-release/changelog": "^5.0.1",
96+
"@semantic-release/git": "^9.0.0",
10397
"@types/dedent": "^0.7.0",
104-
"@types/jest": "^25.1.0",
105-
"@types/node": "^12.6.6",
106-
"@types/prettier": "^1.19.0",
98+
"@types/jest": "^26.0.0",
99+
"@types/node": "^14.0.0",
100+
"@types/prettier": "^2.0.0",
107101
"@typescript-eslint/eslint-plugin": "^4.0.1",
108102
"@typescript-eslint/parser": "^4.0.1",
109-
"babel-jest": "^25.2.0",
103+
"babel-jest": "^26.0.1",
110104
"babel-plugin-replace-ts-export-assignment": "^0.0.2",
111105
"dedent": "^0.7.0",
112-
"eslint": "^5.1.0 || ^6.0.0",
106+
"eslint": "^5.1.0 || ^6.0.0 || ^7.0.0",
113107
"eslint-config-prettier": "^6.5.0",
114108
"eslint-plugin-eslint-comments": "^3.1.2",
115109
"eslint-plugin-eslint-config": "^1.0.2",
116110
"eslint-plugin-eslint-plugin": "^2.0.0",
117111
"eslint-plugin-import": "^2.20.2",
118112
"eslint-plugin-node": "^11.0.0",
119113
"eslint-plugin-prettier": "^3.0.0",
120-
"husky": "^3.0.9",
121-
"jest": "^25.2.0",
114+
"husky": "^4.2.5",
115+
"jest": "^26.0.1",
122116
"jest-runner-eslint": "^0.10.0",
123-
"lint-staged": "^9.4.2",
124-
"prettier": "^1.19.1",
117+
"lint-staged": "^10.2.2",
118+
"prettier": "^2.0.5",
125119
"resolve-from": "^5.0.0",
126120
"rimraf": "^3.0.0",
127-
"semantic-release": "^15.13.28",
128-
"ts-node": "^8.10.1",
121+
"semantic-release": "^17.0.7",
122+
"ts-node": "^9.0.0",
129123
"typescript": "^3.5.3"
130124
},
131125
"peerDependencies": {

src/rules/__tests__/no-standalone-expect.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ ruleTester.run('no-standalone-expect', rule, {
7373
t('testing', () => expect(true));
7474
});
7575
`,
76-
options: [{ additionalTestBlockFunctions: undefined }],
76+
options: [{ additionalTestBlockFunctions: [] }],
7777
errors: [{ endColumn: 42, column: 30, messageId: 'unexpectedExpect' }],
7878
},
7979
{

src/rules/prefer-todo.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ function createTodoFixer(
3737
node: JestFunctionCallExpression<TestCaseName>,
3838
fixer: TSESLint.RuleFixer,
3939
) {
40-
const testName = getNodeName(node.callee)
41-
.split('.')
42-
.shift();
40+
const testName = getNodeName(node.callee).split('.').shift();
4341

4442
return fixer.replaceText(node.callee, `${testName}.todo`);
4543
}

tools/regenerate-docs.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,7 @@ const details: RuleDetails[] = Object.keys(config.configs.all.rules)
118118
details.forEach(({ name, description }) => {
119119
const pathToDoc = path.join(pathTo.docs, 'rules', `${name}.md`);
120120

121-
const contents = fs
122-
.readFileSync(pathToDoc)
123-
.toString()
124-
.split('\n');
121+
const contents = fs.readFileSync(pathToDoc).toString().split('\n');
125122

126123
contents[0] = `# ${description} (\`${name}\`)`;
127124

0 commit comments

Comments
 (0)