@dfinity/eslint-config-oisy-wallet 0.2.2 → 0.2.3
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/configs/eslint.rules.mjs +71 -9
- package/package.json +17 -13
package/configs/eslint.rules.mjs
CHANGED
|
@@ -19,6 +19,27 @@ const resolveGitIgnorePath = () => {
|
|
|
19
19
|
|
|
20
20
|
const gitignorePath = resolveGitIgnorePath();
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* The rules below are part of the typescript-eslint `recommended-type-checked` ruleset.
|
|
24
|
+
*
|
|
25
|
+
* If at some point we have enough of them, we can switch the ruleset on,
|
|
26
|
+
* turn off the ones that we don't want, and remove this section.
|
|
27
|
+
*
|
|
28
|
+
* @link {https://typescript-eslint.io/users/configs/#recommended-type-checked}
|
|
29
|
+
* @link {https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked.ts}
|
|
30
|
+
*/
|
|
31
|
+
const partialTypeCheckedRules = {
|
|
32
|
+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
33
|
+
"@typescript-eslint/no-unused-vars": [
|
|
34
|
+
"warn",
|
|
35
|
+
{
|
|
36
|
+
argsIgnorePattern: "^_",
|
|
37
|
+
varsIgnorePattern: "^_",
|
|
38
|
+
caughtErrorsIgnorePattern: "^_",
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
|
|
22
43
|
export const eslintRules = [
|
|
23
44
|
...(nonNullish(gitignorePath) ? [includeIgnoreFile(gitignorePath)] : []),
|
|
24
45
|
{
|
|
@@ -29,21 +50,14 @@ export const eslintRules = [
|
|
|
29
50
|
},
|
|
30
51
|
|
|
31
52
|
rules: {
|
|
53
|
+
...partialTypeCheckedRules,
|
|
54
|
+
|
|
32
55
|
"@typescript-eslint/consistent-type-definitions": "error",
|
|
33
56
|
"@typescript-eslint/consistent-type-imports": "error",
|
|
34
57
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
35
58
|
"@typescript-eslint/no-inferrable-types": "error",
|
|
36
59
|
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
|
|
37
60
|
"@typescript-eslint/no-non-null-assertion": "error",
|
|
38
|
-
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
39
|
-
"@typescript-eslint/no-unused-vars": [
|
|
40
|
-
"warn",
|
|
41
|
-
{
|
|
42
|
-
argsIgnorePattern: "^_",
|
|
43
|
-
varsIgnorePattern: "^_",
|
|
44
|
-
caughtErrorsIgnorePattern: "^_",
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
61
|
"@typescript-eslint/prefer-nullish-coalescing": "error",
|
|
48
62
|
"@typescript-eslint/prefer-reduce-type-parameter": "error",
|
|
49
63
|
|
|
@@ -62,8 +76,55 @@ export const eslintRules = [
|
|
|
62
76
|
"no-continue": "warn",
|
|
63
77
|
"no-delete-var": "error",
|
|
64
78
|
"no-else-return": ["warn", { allowElseIf: false }],
|
|
79
|
+
"no-restricted-imports": [
|
|
80
|
+
"error",
|
|
81
|
+
{
|
|
82
|
+
patterns: [
|
|
83
|
+
{
|
|
84
|
+
group: ["**/dist/**"],
|
|
85
|
+
message:
|
|
86
|
+
"Do not import directly from a package's /dist/ folder. Use the package's public entry point instead.",
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
paths: [
|
|
90
|
+
{
|
|
91
|
+
name: "@dfinity/ckbtc",
|
|
92
|
+
message: "Use @icp-sdk/canisters/ckbtc instead.",
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: "@dfinity/cketh",
|
|
96
|
+
message: "Use @icp-sdk/canisters/cketh instead.",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "@dfinity/cmc",
|
|
100
|
+
message: "Use @icp-sdk/canisters/cmc instead.",
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "@dfinity/ic-management",
|
|
104
|
+
message: "Use @icp-sdk/canisters/ic-management instead.",
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: "@dfinity/ledger-icp",
|
|
108
|
+
message: "Use @icp-sdk/canisters/ledger/icp instead.",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "@dfinity/ledger-icrc",
|
|
112
|
+
message: "Use @icp-sdk/canisters/ledger/icrc instead.",
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: "@dfinity/nns",
|
|
116
|
+
message: "Use @icp-sdk/canisters/nns instead.",
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: "@dfinity/sns",
|
|
120
|
+
message: "Use @icp-sdk/canisters/sns instead.",
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
],
|
|
65
125
|
"no-unused-vars": "off",
|
|
66
126
|
"no-useless-rename": "error",
|
|
127
|
+
"no-useless-return": "error",
|
|
67
128
|
"prefer-arrow-callback": "error",
|
|
68
129
|
|
|
69
130
|
"prefer-arrow/prefer-arrow-functions": [
|
|
@@ -79,6 +140,7 @@ export const eslintRules = [
|
|
|
79
140
|
"require-await": "error",
|
|
80
141
|
},
|
|
81
142
|
},
|
|
143
|
+
|
|
82
144
|
{
|
|
83
145
|
files: ["**/*.ts"],
|
|
84
146
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dfinity/eslint-config-oisy-wallet",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Shared ESLint configurations from the Oisy Wallet team",
|
|
6
6
|
"repository": {
|
|
@@ -64,19 +64,19 @@
|
|
|
64
64
|
],
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@dfinity/utils": "*",
|
|
67
|
-
"@eslint/compat": "^1.3.
|
|
67
|
+
"@eslint/compat": "^1.3.2",
|
|
68
68
|
"@eslint/eslintrc": "^3.3.1",
|
|
69
|
-
"@eslint/js": "^9.
|
|
70
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
71
|
-
"@vitest/eslint-plugin": "^1.3.
|
|
72
|
-
"eslint": "^9.
|
|
73
|
-
"eslint-config-love": "^
|
|
74
|
-
"eslint-config-prettier": "^10.1.
|
|
69
|
+
"@eslint/js": "^9.34.0",
|
|
70
|
+
"@typescript-eslint/eslint-plugin": "^8.42.0",
|
|
71
|
+
"@vitest/eslint-plugin": "^1.3.8",
|
|
72
|
+
"eslint": "^9.34.0",
|
|
73
|
+
"eslint-config-love": "^122.0.0",
|
|
74
|
+
"eslint-config-prettier": "^10.1.8",
|
|
75
75
|
"eslint-plugin-import": "^2.32.0",
|
|
76
76
|
"eslint-plugin-local-rules": "^3.0.2",
|
|
77
|
-
"eslint-plugin-n": "^17.21.
|
|
77
|
+
"eslint-plugin-n": "^17.21.3",
|
|
78
78
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
79
|
-
"eslint-plugin-prettier": "^5.5.
|
|
79
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
80
80
|
"eslint-plugin-promise": "^7.2.1",
|
|
81
81
|
"eslint-plugin-svelte": "^3",
|
|
82
82
|
"globals": "^16.3.0",
|
|
@@ -85,8 +85,12 @@
|
|
|
85
85
|
"typescript": "^5"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@types/node": "^
|
|
89
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
90
|
-
"vitest": "^
|
|
88
|
+
"@types/node": "^24.10.1",
|
|
89
|
+
"@typescript-eslint/rule-tester": "^8.47.0",
|
|
90
|
+
"vitest": "^4.0.10"
|
|
91
|
+
},
|
|
92
|
+
"engines": {
|
|
93
|
+
"node": ">=22",
|
|
94
|
+
"npm": ">=11.5.1 <12.0.0"
|
|
91
95
|
}
|
|
92
96
|
}
|