@dfinity/eslint-config-oisy-wallet 0.1.8 → 0.1.9

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.
@@ -30,9 +30,9 @@ export const eslintRules = [
30
30
 
31
31
  rules: {
32
32
  "@typescript-eslint/consistent-type-imports": "error",
33
+ "@typescript-eslint/no-import-type-side-effects": "error",
33
34
  "@typescript-eslint/no-inferrable-types": "error",
34
35
  "@typescript-eslint/no-unnecessary-type-assertion": "error",
35
-
36
36
  "@typescript-eslint/no-unused-vars": [
37
37
  "warn",
38
38
  {
@@ -41,15 +41,12 @@ export const eslintRules = [
41
41
  caughtErrorsIgnorePattern: "^_",
42
42
  },
43
43
  ],
44
-
45
44
  "@typescript-eslint/prefer-nullish-coalescing": "error",
46
45
  "@typescript-eslint/prefer-reduce-type-parameter": "error",
46
+
47
47
  "arrow-body-style": ["warn", "as-needed"],
48
48
  curly: "error",
49
-
50
- // TODO: Disabled for now to allow the migration of ESLint v9 in OISY, as the rule is not yet enforced.
51
- // It should also be introduced as an optional rule.
52
- // "func-style": "error",
49
+ "func-style": "error",
53
50
 
54
51
  "local-rules/prefer-object-params": "warn",
55
52
 
@@ -58,30 +55,28 @@ export const eslintRules = [
58
55
  // "local-rules/use-nullish-checks": "warn",
59
56
 
60
57
  "local-rules/use-option-type-wrapper": "warn",
58
+
61
59
  "import/no-duplicates": ["error", { "prefer-inline": true }],
62
60
  "import/no-relative-parent-imports": "error",
61
+
63
62
  "object-shorthand": "error",
63
+ "prefer-destructuring": "error",
64
64
  "no-console": ["error", { allow: ["error", "warn"] }],
65
65
  "no-continue": "warn",
66
66
  "no-delete-var": "error",
67
67
  "no-else-return": ["warn", { allowElseIf: false }],
68
68
  "no-unused-vars": "off",
69
69
  "no-useless-rename": "error",
70
+ "prefer-arrow-callback": "error",
70
71
 
71
- // TODO: Disabled for now to allow the migration of ESLint v9 in OISY, as the rule is not yet enforced.
72
- // It should also be introduced as an optional rule.
73
- // "prefer-arrow-callback": "error",
74
-
75
- // TODO: Disabled for now to allow the migration of ESLint v9 in OISY, as the rule is not yet enforced.
76
- // It should also be introduced as an optional rule.
77
- // "prefer-arrow/prefer-arrow-functions": [
78
- // "error",
79
- // {
80
- // disallowPrototype: true,
81
- // singleReturnOnly: false,
82
- // classPropertiesAllowed: false,
83
- // },
84
- // ],
72
+ "prefer-arrow/prefer-arrow-functions": [
73
+ "error",
74
+ {
75
+ disallowPrototype: true,
76
+ singleReturnOnly: false,
77
+ classPropertiesAllowed: false,
78
+ },
79
+ ],
85
80
 
86
81
  "prefer-template": "error",
87
82
  "require-await": "error",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dfinity/eslint-config-oisy-wallet",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Shared ESLint configurations from the Oisy Wallet team",
6
6
  "repository": {
@@ -43,6 +43,7 @@
43
43
  "format": "prettier . --write",
44
44
  "format:check": "prettier --check .",
45
45
  "lint": "eslint .",
46
+ "lint:fix": "eslint --fix .",
46
47
  "test": "vitest --run"
47
48
  },
48
49
  "keywords": [
@@ -38,7 +38,7 @@ const inferReturnType = (node) => {
38
38
  };
39
39
 
40
40
  const checkReturnType = ({ node, context }) => {
41
- const returnType = node.returnType;
41
+ const { returnType } = node;
42
42
 
43
43
  if (!returnType) {
44
44
  const inferredType = inferReturnType(node);
@@ -13,7 +13,7 @@ module.exports = {
13
13
  },
14
14
  create: (context) => {
15
15
  const checkForMoreThanOneParameter = (node) => {
16
- const parent = node.parent;
16
+ const { parent } = node;
17
17
 
18
18
  // Check if it is a callback for looping methods
19
19
  if (
package/vitest.mjs CHANGED
@@ -13,6 +13,7 @@ export default [
13
13
  "vitest/no-duplicate-hooks": ["error"],
14
14
  "vitest/padding-around-all": ["error"],
15
15
  "vitest/prefer-comparison-matcher": ["error"],
16
+ "vitest/prefer-each": ["error"],
16
17
  "vitest/prefer-hooks-in-order": ["error"],
17
18
  "vitest/prefer-hooks-on-top": ["error"],
18
19
  "vitest/prefer-to-be-falsy": ["error"],