@itcase/lint 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/readme.md +15 -9
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -20,6 +20,17 @@ import eslint from '@itcase/lint/eslint/index.js'
|
|
|
20
20
|
export default eslint
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
## ESLint with MobX
|
|
24
|
+
|
|
25
|
+
Create a `eslint.config.mjs` configuration file in the root of your project with the following content:
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import eslint from '@itcase/lint/eslint/index.js'
|
|
29
|
+
import eslintMobx from '@itcase/lint/eslint/mobx/index.js'
|
|
30
|
+
|
|
31
|
+
export default [...eslint, ...eslintMobx]
|
|
32
|
+
```
|
|
33
|
+
|
|
23
34
|
## Stylelint
|
|
24
35
|
|
|
25
36
|
Create a `eslint.config.mjs` configuration file in the root of your project with the following content:
|
|
@@ -31,13 +42,13 @@ export default {
|
|
|
31
42
|
```
|
|
32
43
|
|
|
33
44
|
## Prettier
|
|
45
|
+
|
|
34
46
|
Create a `prettier.config.mjs` configuration file in the root of your project with the following content:
|
|
35
47
|
|
|
36
48
|
```js
|
|
37
49
|
import prettier from '@itcase/lint/prettier/index.js'
|
|
38
50
|
|
|
39
51
|
export default prettier
|
|
40
|
-
|
|
41
52
|
```
|
|
42
53
|
|
|
43
54
|
## git-hook
|
|
@@ -52,14 +63,9 @@ npm i -D husky lint-staged
|
|
|
52
63
|
|
|
53
64
|
```json
|
|
54
65
|
{
|
|
55
|
-
"*.css": [
|
|
56
|
-
|
|
57
|
-
],
|
|
58
|
-
"*.(js|jsx|ts|tsx)": [
|
|
59
|
-
"npx eslint --fix"
|
|
60
|
-
]
|
|
66
|
+
"*.css": ["npx stylelint --fix"],
|
|
67
|
+
"*.(js|jsx|ts|tsx)": ["npx eslint --fix"]
|
|
61
68
|
}
|
|
62
|
-
|
|
63
69
|
```
|
|
64
70
|
|
|
65
71
|
3. Add **pre-commit** hook in `.husky/pre-commit`
|
|
@@ -71,4 +77,4 @@ if grep --include=*.{json,css,html} --exclude-dir={dist,node_modules,bower_compo
|
|
|
71
77
|
echo 'Fix conflicts'
|
|
72
78
|
exit 1
|
|
73
79
|
else ./node_modules/lint-staged/bin/lint-staged.js; fi
|
|
74
|
-
```
|
|
80
|
+
```
|