Skip to content

Commit 702c30b

Browse files
committed
Migrate to use ESLint tooling instead of TSLint
1 parent 6cd8315 commit 702c30b

File tree

5 files changed

+1021
-75
lines changed

5 files changed

+1021
-75
lines changed

.eslintrc.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es6: true,
5+
},
6+
extends: [
7+
"plugin:react/recommended", // Uses the recommended rules from @eslint-plugin-react
8+
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
9+
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
10+
"plugin:prettier/recommended", // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
11+
],
12+
parser: "@typescript-eslint/parser",
13+
parserOptions: {
14+
project: "tsconfig.json",
15+
sourceType: "module", // Allows for the use of imports
16+
ecmaFeatures: {
17+
jsx: true, // Allows for the parsing of JSX
18+
},
19+
},
20+
plugins: ["prettier"],
21+
rules: {
22+
"@typescript-eslint/explicit-module-boundary-types": "off",
23+
"react/no-unescaped-entities": "off",
24+
"@typescript-eslint/no-non-null-assertion": "off",
25+
"react/prop-types": "off",
26+
},
27+
settings: {
28+
react: {
29+
version: "detect", // Tells eslint-plugin-react to automatically detect the version of React to use
30+
},
31+
},
32+
};

package.json

+9-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"develop": "concurrently npm:watch npm:storybook",
2929
"website": "lerna run start --scope=@gitgraph/website --stream",
3030
"deploy:website": "lerna run deploy --scope=@gitgraph/website --stream",
31-
"lint": "tslint packages/*/src/**/*",
31+
"lint": "eslint packages/*/src/**/*.{ts,tsx,js,jsx}",
3232
"lint:fix": "npm run lint -- --fix",
3333
"pretest": "npm run build",
3434
"test": "jest",
@@ -39,16 +39,20 @@
3939
},
4040
"devDependencies": {
4141
"@types/jest": "23.1.4",
42+
"@typescript-eslint/eslint-plugin": "^4.8.2",
43+
"@typescript-eslint/parser": "^4.8.2",
4244
"all-contributors-cli": "6.16.0",
4345
"concurrently": "4.1.0",
46+
"eslint": "^7.14.0",
47+
"eslint-config-prettier": "^6.15.0",
48+
"eslint-plugin-prettier": "^3.1.4",
49+
"eslint-plugin-react": "^7.21.5",
4450
"husky": "1.1.2",
4551
"jest": "23.3.0",
4652
"lerna": "3.13.1",
47-
"prettier": "1.13.7",
48-
"pretty-quick": "1.6.0",
53+
"prettier": "^2.2.0",
54+
"pretty-quick": "^3.1.0",
4955
"ts-jest": "23.0.0",
50-
"tslint": "5.11.0",
51-
"tslint-config-prettier": "1.15.0",
5256
"typescript": "3.5.1"
5357
},
5458
"workspaces": [

tsconfig.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"compilerOptions": {
3+
"rootDir": "src",
4+
"outDir": "lib",
5+
"target": "es5",
6+
"module": "es2015",
7+
"jsx": "react",
8+
"lib": [
9+
"dom",
10+
"esnext"
11+
],
12+
"declaration": true,
13+
"sourceMap": true,
14+
"removeComments": false,
15+
"strict": true,
16+
"noImplicitAny": true,
17+
"noImplicitReturns": true,
18+
"noImplicitThis": true,
19+
"noUnusedLocals": true,
20+
"moduleResolution": "node",
21+
}
22+
}

tslint.json

-20
This file was deleted.

0 commit comments

Comments
 (0)