@shelf/eslint-config 2.2.0 → 2.5.0
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/.husky/_/husky.sh +31 -0
- package/frontend-typescript-vue.js +1 -0
- package/frontend-typescript.js +1 -0
- package/package.json +14 -19
- package/rules/jest.json +3 -3
- package/typescript.js +2 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
if [ -z "$husky_skip_init" ]; then
|
|
3
|
+
debug () {
|
|
4
|
+
if [ "$HUSKY_DEBUG" = "1" ]; then
|
|
5
|
+
echo "husky (debug) - $1"
|
|
6
|
+
fi
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
readonly hook_name="$(basename "$0")"
|
|
10
|
+
debug "starting $hook_name..."
|
|
11
|
+
|
|
12
|
+
if [ "$HUSKY" = "0" ]; then
|
|
13
|
+
debug "HUSKY env variable is set to 0, skipping hook"
|
|
14
|
+
exit 0
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
if [ -f ~/.huskyrc ]; then
|
|
18
|
+
debug "sourcing ~/.huskyrc"
|
|
19
|
+
. ~/.huskyrc
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
export readonly husky_skip_init=1
|
|
23
|
+
sh -e "$0" "$@"
|
|
24
|
+
exitCode="$?"
|
|
25
|
+
|
|
26
|
+
if [ $exitCode != 0 ]; then
|
|
27
|
+
echo "husky - $hook_name hook exited with code $exitCode (error)"
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
exit $exitCode
|
|
31
|
+
fi
|
|
@@ -20,6 +20,7 @@ module.exports = {
|
|
|
20
20
|
'@typescript-eslint/explicit-member-accessibility': 0,
|
|
21
21
|
'jest/lowercase-name': 'off',
|
|
22
22
|
...consistentTypeAssertions,
|
|
23
|
+
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
|
|
23
24
|
},
|
|
24
25
|
overrides: [allowRequireInConfigs, noExplicitReturnTypeInTests],
|
|
25
26
|
};
|
package/frontend-typescript.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shelf/eslint-config",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "ESLint Config for Shelf Projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "shelfio/eslint-config",
|
|
@@ -32,37 +32,32 @@
|
|
|
32
32
|
"eslintconfig"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@babel/eslint-parser": "7.
|
|
36
|
-
"@typescript-eslint/eslint-plugin": "
|
|
37
|
-
"@typescript-eslint/parser": "
|
|
35
|
+
"@babel/eslint-parser": "7.16.0",
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "5.2.0",
|
|
37
|
+
"@typescript-eslint/parser": "5.2.0",
|
|
38
38
|
"eslint-config-next": "11.1.2",
|
|
39
39
|
"eslint-config-prettier": "8.3.0",
|
|
40
40
|
"eslint-plugin-babel": "5.3.1",
|
|
41
|
-
"eslint-plugin-import": "2.
|
|
42
|
-
"eslint-plugin-jest": "
|
|
41
|
+
"eslint-plugin-import": "2.25.2",
|
|
42
|
+
"eslint-plugin-jest": "25.2.2",
|
|
43
43
|
"eslint-plugin-jest-formatting": "3.0.0",
|
|
44
44
|
"eslint-plugin-json-format": "2.0.1",
|
|
45
45
|
"eslint-plugin-jsx": "0.1.0",
|
|
46
|
-
"eslint-plugin-prettier": "
|
|
47
|
-
"eslint-plugin-react": "7.
|
|
46
|
+
"eslint-plugin-prettier": "4.0.0",
|
|
47
|
+
"eslint-plugin-react": "7.26.1",
|
|
48
48
|
"eslint-plugin-react-hooks": "4.2.0",
|
|
49
|
-
"eslint-plugin-testing-library": "4.12.
|
|
50
|
-
"eslint-plugin-vue": "7.
|
|
49
|
+
"eslint-plugin-testing-library": "4.12.4",
|
|
50
|
+
"eslint-plugin-vue": "7.20.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"husky": "
|
|
54
|
-
"lint-staged": "11.
|
|
55
|
-
"prettier": "2.4.
|
|
53
|
+
"husky": "7.0.4",
|
|
54
|
+
"lint-staged": "11.2.6",
|
|
55
|
+
"prettier": "2.4.1"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"eslint": "7.x",
|
|
58
|
+
"eslint": "7.x || 8.x",
|
|
59
59
|
"prettier": "2.x"
|
|
60
60
|
},
|
|
61
|
-
"husky": {
|
|
62
|
-
"hooks": {
|
|
63
|
-
"pre-commit": "lint-staged"
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
61
|
"lint-staged": {
|
|
67
62
|
"*.{js,json,css,md,yml}": [
|
|
68
63
|
"prettier --write",
|
package/rules/jest.json
CHANGED
|
@@ -12,10 +12,9 @@
|
|
|
12
12
|
"assertFunctionNames": ["expect"]
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
|
-
"jest/lowercase-
|
|
15
|
+
"jest/prefer-lowercase-title": "error",
|
|
16
16
|
"jest/no-commented-out-tests": "error",
|
|
17
17
|
"jest/no-duplicate-hooks": "error",
|
|
18
|
-
"jest/no-expect-resolves": "warn",
|
|
19
18
|
"jest/no-export": "error",
|
|
20
19
|
"jest/no-large-snapshots": "warn",
|
|
21
20
|
"jest/no-if": "warn",
|
|
@@ -32,5 +31,6 @@
|
|
|
32
31
|
"jest/prefer-todo": "warn",
|
|
33
32
|
"jest/require-to-throw-message": "warn",
|
|
34
33
|
"jest/valid-title": "error",
|
|
35
|
-
"jest/no-conditional-expect": "off"
|
|
34
|
+
"jest/no-conditional-expect": "off",
|
|
35
|
+
"jest/prefer-to-be": "off"
|
|
36
36
|
}
|
package/typescript.js
CHANGED
|
@@ -17,6 +17,7 @@ module.exports = {
|
|
|
17
17
|
...tsParser,
|
|
18
18
|
rules: {
|
|
19
19
|
complexity: ['warn', {max: 5}],
|
|
20
|
+
'multiline-ternary': ['error', 'never'],
|
|
20
21
|
curly: 'error',
|
|
21
22
|
'no-nested-ternary': 'error',
|
|
22
23
|
'prettier/prettier': 'error',
|
|
@@ -33,6 +34,7 @@ module.exports = {
|
|
|
33
34
|
'comma-dangle': 'off',
|
|
34
35
|
'@typescript-eslint/ban-ts-comment': 'off',
|
|
35
36
|
...consistentTypeAssertions,
|
|
37
|
+
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
|
|
36
38
|
},
|
|
37
39
|
overrides: [allowRequireInConfigs, noExplicitReturnTypeInTests],
|
|
38
40
|
};
|