Skip to content

Commit 4cf6835

Browse files
committed
Make the world a better, linted, place
1 parent f369f56 commit 4cf6835

8 files changed

+188
-151
lines changed

.eslintrc.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"extends": [
3+
"react-app",
4+
"eslint:recommended",
5+
"plugin:react/recommended",
6+
"plugin:prettier/recommended"
7+
],
8+
"parser": "babel-eslint",
9+
"env": {
10+
"jest": true
11+
},
12+
"settings": {
13+
"react": {
14+
"version": "detect"
15+
}
16+
},
17+
"globals": {
18+
"context": true,
19+
"assert": true
20+
}
21+
}

.prettierrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"trailingComma": "es5",
3+
"printWidth": 80,
4+
"proseWrap": "always",
5+
"tabWidth": 2,
6+
"semi": true,
7+
"singleQuote": true
8+
}

.vscode/extensions.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
3+
}

.vscode/settings.json

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"editor.rulers": [80, 120],
3+
4+
// ===
5+
// Spacing
6+
// ===
7+
8+
"editor.insertSpaces": true,
9+
"editor.tabSize": 2,
10+
"editor.trimAutoWhitespace": true,
11+
"files.trimTrailingWhitespace": true,
12+
"files.eol": "\n",
13+
"files.insertFinalNewline": true,
14+
"files.trimFinalNewlines": true,
15+
16+
// ===
17+
// Event Triggers
18+
// ===
19+
20+
"editor.formatOnSave": true,
21+
"eslint.autoFixOnSave": true,
22+
"eslint.run": "onSave",
23+
"eslint.validate": [
24+
{ "language": "javascript", "autoFix": true },
25+
{ "language": "javascriptreact", "autoFix": true }
26+
],
27+
"prettier.disableLanguages": [],
28+
"prettier.endOfLine": "lf",
29+
"workbench.colorCustomizations": {}
30+
}

babel.config.js

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
module.exports = {
22
presets: [
3-
["@babel/preset-env", {
4-
targets: {
5-
ie: "11"
6-
}
7-
}],
8-
"@babel/preset-react"
3+
[
4+
'@babel/preset-env',
5+
{
6+
targets: {
7+
ie: '11',
8+
},
9+
},
10+
],
11+
'@babel/preset-react',
912
],
1013
plugins: [
11-
"@babel/plugin-proposal-class-properties",
12-
"@babel/plugin-transform-runtime"
13-
]
14-
}
14+
'@babel/plugin-proposal-class-properties',
15+
'@babel/plugin-transform-runtime',
16+
],
17+
};

package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,17 @@
4545
"dicom-parser": "^1.8.3",
4646
"dicomweb-client": "^0.5.2",
4747
"eslint": "5.16.0",
48+
"eslint-config-react-app": "^4.0.1",
4849
"eslint-plugin-import": "^2.17.3",
4950
"eslint-plugin-node": "^9.1.0",
5051
"eslint-plugin-promise": "^4.1.1",
5152
"eslint-plugin-react": "^7.13.0",
5253
"gh-pages": "^2.0.1",
5354
"hammerjs": "^2.0.8",
5455
"html-webpack-plugin": "^3.2.0",
55-
"husky": "^2.4.1",
56+
"husky": "^3.0.0",
5657
"kw-web-suite": "^8.0.0",
57-
"lint-staged": "^8.2.1",
58+
"lint-staged": "^9.2.5",
5859
"postcss-loader": "^3.0.0",
5960
"prettier": "^1.18.2",
6061
"prop-types": "^15.7.2",
@@ -71,6 +72,7 @@
7172
"webpack": "4.34.0",
7273
"webpack-cli": "^3.3.4",
7374
"webpack-dev-server": "^3.8.0",
75+
"webpack-merge": "^4.2.2",
7476
"worker-loader": "^2.0.0"
7577
},
7678
"husky": {
@@ -80,7 +82,8 @@
8082
},
8183
"lint-staged": {
8284
"src/**/*.{js,jsx,json,css}": [
83-
"prettier --single-quote --write",
85+
"eslint --fix",
86+
"prettier --write",
8487
"git add"
8588
]
8689
},

webpack.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ module.exports = {
6565
amd: 'cornerstone-math',
6666
root: 'cornerstoneMath',
6767
},
68+
//
69+
react: 'react',
6870
},
6971
],
7072
plugins: [

0 commit comments

Comments
 (0)