Skip to content

Commit aede82f

Browse files
make changes for eslint
1 parent 00178fd commit aede82f

File tree

4 files changed

+68
-143
lines changed

4 files changed

+68
-143
lines changed

.eslintrc.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
module.exports = {
2+
extends: [
3+
"airbnb-typescript",
4+
"airbnb/hooks",
5+
"eslint:recommended",
6+
"plugin:import/recommended",
7+
"plugin:react/recommended",
8+
"plugin:@typescript-eslint/recommended",
9+
"plugin:jest/recommended",
10+
"plugin:prettier/recommended"
11+
],
12+
plugins: ["react", "@typescript-eslint", "jest"],
13+
ignorePatterns: ["*.js"],
14+
env: {
15+
browser: true,
16+
es6: true,
17+
jest: true
18+
},
19+
globals: {
20+
Atomics: "readonly",
21+
SharedArrayBuffer: "readonly",
22+
},
23+
parser: "@typescript-eslint/parser",
24+
parserOptions: {
25+
ecmaVersion: 2018,
26+
sourceType: "module",
27+
project: "./tsconfig.json"
28+
},
29+
rules: {
30+
"linebreak-style": "off",
31+
"class-methods-use-this":"off",
32+
"no-param-reassign": ["error", { "props": false }],
33+
"import/no-extraneous-dependencies": "off",
34+
"import/prefer-default-export": "off",
35+
"react/static-property-placement": ["warn", "property assignment", {
36+
childContextTypes: "static getter",
37+
contextTypes: "static public field",
38+
contextType: "static public field",
39+
displayName: "static public field",
40+
}],
41+
"react/prop-types": "off",
42+
"react/jsx-props-no-spreading": "off",
43+
}
44+
};

.prettierrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
"endOfLine": "auto",
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"printWidth": 160
6+
};

package.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
"test:web": "test ! $(find tests -name \"*.ts\") || jest -w=1",
5252
"test:python": "test ! $(find tests -name \"*.py\") || python setup.py test",
5353
"test": "npm run test:web && npm run test:python",
54-
"lint": "tslint -c tslint.json -p . 'src/**/*.ts?(x)' 'tests/**/*.ts?(x)'",
54+
"lint": "eslint src/**/*.ts{,x}",
55+
"lint:fix": "eslint --fix src/**/*.ts{,x}",
5556
"docs:web": "typedoc --options typedoc.json src/**.ts",
5657
"docs:python": "sphinx-apidoc -o docs -f ./tdp_core && sphinx-build ./docs build/docs",
5758
"docs": "npm run docs:web && npm run docs:python",
@@ -77,7 +78,8 @@
7778
"docker": "docker build -t tdp_core -f deploy/Dockerfile .",
7879
"db-migration:base": "docker-compose run api python phovea_server/__main__.py --env dev db-migration",
7980
"db-migration": "npm run db-migration:base exec --",
80-
"db-migration:list": "npm run db-migration:base list --"
81+
"db-migration:list": "npm run db-migration:base list --",
82+
"precommit": "npm run build"
8183
},
8284
"dependencies": {
8385
"d3": "~3.5.17",
@@ -113,14 +115,27 @@
113115
"@types/react": "^16.9.23",
114116
"@types/react-dom": "^16.9.5",
115117
"@types/papaparse": "~5.2.4",
118+
"@typescript-eslint/eslint-plugin": "^5.9.0",
119+
"@typescript-eslint/parser": "^5.9.0",
120+
"eslint": "^8.6.0",
121+
"eslint-config-airbnb": "^19.0.4",
122+
"eslint-config-airbnb-typescript": "^16.1.0",
123+
"eslint-config-prettier": "^8.3.0",
124+
"eslint-plugin-import": "^2.25.4",
125+
"eslint-plugin-jest": "^25.3.4",
126+
"eslint-plugin-jsx-a11y": "^6.5.1",
127+
"eslint-plugin-prettier": "^4.0.0",
128+
"eslint-plugin-react": "^7.28.0",
129+
"eslint-plugin-react-hooks": "^4.3.0",
130+
"husky": "^7.0.4",
116131
"identity-obj-proxy": "~3.0.0",
117132
"jest": "~26.6.3",
118133
"jest-raw-loader": "~1.0.1",
134+
"prettier": "^2.5.1",
119135
"rimraf": "~3.0.2",
120136
"shx": "~0.3.3",
121137
"ts-jest": "~26.4.4",
122138
"tslib": "~2.0.3",
123-
"tslint": "~5.20.1",
124139
"typedoc": "~0.19.2",
125140
"typescript": "~3.9.7"
126141
}

tslint.json

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

0 commit comments

Comments
 (0)