Skip to content

Commit 5be725b

Browse files
author
Raice Hannay
committed
migrate from tslint to eslint
1 parent 5da50dc commit 5be725b

File tree

6 files changed

+867
-78
lines changed

6 files changed

+867
-78
lines changed

.eslintrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": ["voodoocreation/base"],
3+
"parserOptions": {
4+
"project": "tsconfig.lint.json"
5+
}
6+
}

package.json

+10-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"author": "Raice Hannay <[email protected]>",
44
"description": "A set of useful mocks and helpers for the Jest unit testing framework.",
55
"license": "ISC",
6-
"version": "1.0.1",
6+
"version": "1.0.2",
77
"keywords": [
88
"jest",
99
"mock",
@@ -23,9 +23,10 @@
2323
],
2424
"scripts": {
2525
"format": "prettier --write \"**/*.{js,jsx,json,ts,tsx}\"",
26-
"lint": "tslint \"./{types,src,pages}/**/*.ts?(x)\"",
26+
"lint": "eslint \"./src/**/*.ts?(x)\"",
27+
"lint:fix": "eslint \"./src/**/*.ts?(x)\" --fix",
2728
"test": "cross-env NODE_ENV=test jest --no-cache --config ./jest.config.js",
28-
"test:all": "npm-run-all format typecheck lint test:coverage",
29+
"test:all": "npm-run-all format typecheck lint:fix test:coverage",
2930
"test:coverage": "cross-env NODE_ENV=test jest --no-cache --coverage --config ./jest.config.js",
3031
"typecheck": "tsc"
3132
},
@@ -44,13 +45,17 @@
4445
},
4546
"devDependencies": {
4647
"@types/jest": "^24.0.23",
48+
"@typescript-eslint/eslint-plugin": "^2.22.0",
4749
"cross-env": "^6.0.3",
50+
"eslint": "^6.8.0",
51+
"eslint-config-voodoocreation": "^1.0.8",
52+
"eslint-plugin-import": "^2.20.1",
53+
"eslint-plugin-jest": "^23.8.1",
54+
"eslint-plugin-prefer-arrow": "^1.1.7",
4855
"jest": "^24.9.0",
4956
"npm-run-all": "^4.1.5",
5057
"prettier": "^1.19.1",
5158
"ts-jest": "^24.2.0",
52-
"tslint": "^5.20.0",
53-
"tslint-config-prettier": "^1.18.0",
5459
"typescript": "^3.7.3"
5560
}
5661
}

src/index.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ describe("Jest mocks", () => {
5858

5959
it("returns a promise that instantly rejects with the provided error", async () => {
6060
let rejectedError;
61-
const error = new Error("Rejected");
61+
const mockError = new Error("Rejected");
6262

6363
try {
64-
await rejectedPromise(error);
64+
await rejectedPromise(mockError);
6565
} catch (error) {
6666
rejectedError = error;
6767
}
6868

69-
expect(rejectedError).toEqual(error);
69+
expect(rejectedError).toEqual(mockError);
7070
});
7171
});
7272

tsconfig.lint.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"include": ["./src/*"]
4+
}

tslint.json

-17
This file was deleted.

0 commit comments

Comments
 (0)