Skip to content

Commit 34f2970

Browse files
committed
dev: better development environment
1 parent 664fb47 commit 34f2970

File tree

4 files changed

+1134
-13
lines changed

4 files changed

+1134
-13
lines changed

.prettierrc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"printWidth": 80,
3+
"semi": false,
4+
"trailingComma": "all",
5+
"singleQuote": true,
6+
"arrowParens": "always",
7+
"jsxBracketSameLine": false,
8+
"bracketSpacing": true
9+
}

package.json

+23-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,26 @@
55
"main": "./build/index.js",
66
"types": "./build/index.d.ts",
77
"scripts": {
8-
"build": "rm -rf ./build && tsc"
8+
"build": "rm -rf ./build && tsc",
9+
"prettier": "prettier '@(src)/**/*.@(ts)' --write",
10+
"lint": "tslint -p tsconfig.json --fix"
911
},
1012
"repository": {
1113
"type": "git",
1214
"url": "git+https://github.com/Runjuu/html-inline-css-webpack-plugin.git"
1315
},
16+
"husky": {
17+
"hooks": {
18+
"pre-commit": "lint-staged"
19+
}
20+
},
21+
"lint-staged": {
22+
"*.{ts}": [
23+
"prettier --write",
24+
"tslint -p tsconfig.json --fix",
25+
"git add"
26+
]
27+
},
1428
"keywords": [
1529
"webpack",
1630
"webpack4",
@@ -31,8 +45,14 @@
3145
"homepage": "https://github.com/Runjuu/html-inline-css-webpack-plugin#readme",
3246
"devDependencies": {
3347
"@types/webpack": "^4.4.0",
34-
"tslib": "^1.9.2",
35-
"typescript": "^2.9.1",
48+
"husky": "^1.3.1",
49+
"lint-staged": "^8.1.0",
50+
"prettier": "^1.15.3",
51+
"tslib": "^1.9.3",
52+
"tslint": "^5.12.1",
53+
"tslint-eslint-rules": "^5.4.0",
54+
"tslint-sonarts": "^1.8.0",
55+
"typescript": "^3.2.2",
3656
"webpack": "^4.11.1"
3757
}
3858
}

tslint.json

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"extends": [
3+
"tslint-eslint-rules",
4+
"tslint-sonarts"
5+
],
6+
"defaultSeverity": "error",
7+
"rules": {
8+
"array-bracket-spacing": [true, "never", {
9+
"arraysInArrays": false,
10+
"singleValue": false,
11+
"objectsInArrays": false
12+
}],
13+
"block-spacing": [true, "always"],
14+
"import-spacing": true,
15+
"no-boolean-literal-compare": true,
16+
"no-console": [true, "log", "time", "trace"],
17+
"no-duplicate-variable": true,
18+
"no-multi-spaces": true,
19+
"no-return-await": true,
20+
"no-string-literal": true,
21+
"no-string-throw": true,
22+
"no-trailing-whitespace": true,
23+
"no-unnecessary-initializer": true,
24+
"no-var-keyword": true,
25+
"object-curly-spacing": [true, "always"],
26+
"one-variable-per-declaration": [true, "ignore-for-loop"],
27+
"prefer-const": true,
28+
"quotemark": [true, "single", "jsx-double"],
29+
"ter-arrow-spacing": [true, { "before": true, "after": true }],
30+
"triple-equals": [true, "allow-null-check", "allow-undefined-check"],
31+
"whitespace": [
32+
true,
33+
"check-branch",
34+
"check-decl",
35+
"check-operator",
36+
"check-module",
37+
"check-separator",
38+
"check-rest-spread",
39+
"check-type",
40+
"check-typecast",
41+
"check-type-operator",
42+
"check-preblock"
43+
],
44+
"interface-over-type-literal": true,
45+
"no-consecutive-blank-lines": true,
46+
"space-before-function-paren": [true, {
47+
"anonymous": "never",
48+
"named": "never",
49+
"asyncArrow": "always"
50+
}],
51+
"space-within-parens": [true, 0],
52+
"cognitive-complexity": false,
53+
"no-duplicate-string": false,
54+
"no-big-function": false,
55+
"no-small-switch": false,
56+
"max-union-size": [true, 20],
57+
"parameters-max-number": false
58+
}
59+
}

0 commit comments

Comments
 (0)