Skip to content

Commit ad3c9af

Browse files
committed
chore(lint): switch to eslint
1 parent 7ae2128 commit ad3c9af

File tree

4 files changed

+451
-176
lines changed

4 files changed

+451
-176
lines changed

.eslintrc.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"plugins": ["@typescript-eslint"],
3+
"parser": "@typescript-eslint/parser",
4+
"extends": [
5+
"plugin:react/recommended",
6+
"plugin:@typescript-eslint/recommended",
7+
"prettier",
8+
"prettier/@typescript-eslint"
9+
],
10+
"globals": {
11+
"Atomics": "readonly",
12+
"SharedArrayBuffer": "readonly"
13+
},
14+
"rules": {
15+
"@typescript-eslint/explicit-member-accessibility": ["error", { "accessibility": "no-public" }],
16+
"@typescript-eslint/explicit-function-return-type": "off",
17+
"@typescript-eslint/no-parameter-properties": "off",
18+
"@typescript-eslint/no-use-before-define": ["error", { "functions": false }],
19+
"@typescript-eslint/no-explicit-any": "off",
20+
"@typescript-eslint/no-var-requires": "off"
21+
},
22+
"env": {
23+
"browser": true,
24+
"es6": true
25+
},
26+
"parserOptions": {
27+
"project": "./tsconfig.json",
28+
"extraFileExtensions": [".html"],
29+
"ecmaFeatures": {
30+
"jsx": true
31+
},
32+
"ecmaVersion": 2018,
33+
"sourceType": "module"
34+
}
35+
}

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"build:esm": "shx rm -rf ./esm && tsc -p ./tsconfig.build.json -m esnext --outDir esm",
2424
"build:next": "shx rm -rf ./esnext && tsc -p ./tsconfig.build.json --target esnext --outDir esnext",
2525
"prettier": "prettier '@(src|demo)/**/*.@(ts|tsx|html|less)' --write",
26-
"lint": "tslint -p tsconfig.json --fix",
26+
"lint": "eslint src/**/* test/**/* demo/**/* --ext .ts,.tsx --ignore-pattern *.html --fix --max-warnings 0",
2727
"test": "jest --collectCoverage"
2828
},
2929
"husky": {
@@ -34,7 +34,7 @@
3434
"lint-staged": {
3535
"*.{ts,tsx}": [
3636
"prettier --write",
37-
"tslint -p tsconfig.json --fix",
37+
"yarn run lint",
3838
"git add"
3939
],
4040
"*.{less,html}": [
@@ -70,7 +70,11 @@
7070
"@types/react-dom": "^16.8.3",
7171
"@types/react-test-renderer": "^16.8.1",
7272
"@types/shallowequal": "^1.1.1",
73+
"@typescript-eslint/eslint-plugin": "^1.7.0",
7374
"codecov": "^3.2.0",
75+
"eslint": "5.3.0",
76+
"eslint-config-prettier": "^4.1.0",
77+
"eslint-plugin-react": "^7.12.4",
7478
"husky": "^1.3.1",
7579
"jest": "^24.5.0",
7680
"lint-staged": "^8.1.5",
@@ -84,10 +88,6 @@
8488
"shx": "^0.3.2",
8589
"ts-jest": "^24.0.1",
8690
"tslib": "^1.9.3",
87-
"tslint": "^5.14.0",
88-
"tslint-eslint-rules": "^5.4.0",
89-
"tslint-react": "^4.0.0",
90-
"tslint-sonarts": "^1.9.0",
9191
"typescript": "^3.4.4"
9292
},
9393
"peerDependencies": {

tslint.json

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)