@dfinity/eslint-config-oisy-wallet 0.1.3 → 0.1.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/README.md CHANGED
@@ -55,6 +55,30 @@ module.exports = require("@dfinity/eslint-config-oisy-wallet/eslint-local-rules"
55
55
  > [!NOTE]
56
56
  > This is necessary because the `eslint-plugin-local-rules` plugin we use for custom rules requires a file located at the root and does not offer any customizable location option.
57
57
 
58
+ ## 🔧 Overriding or Disabling Rules
59
+
60
+ You can override or disable any of the rules provided by this configuration — including custom **local rules** — just like you would with any ESLint config.
61
+
62
+ In your `.eslintrc.js`, simply add a `rules` section:
63
+
64
+ ```javascript
65
+ module.exports = {
66
+ extends: ["@dfinity/eslint-config-oisy-wallet/svelte"],
67
+ rules: {
68
+ // Disable a built-in rule
69
+ "no-console": "off",
70
+
71
+ // Disable a local custom rule
72
+ "local/use-nullish-checks": "off",
73
+
74
+ // Customize severity or options
75
+ "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
76
+ },
77
+ };
78
+ ```
79
+
80
+ Note: To override local rules, make sure you have the `eslint-local-rules.cjs` file at the root as described above.
81
+
58
82
  ## 🛠️ TypeScript Support
59
83
 
60
84
  If your project uses TypeScript, make sure you have a `tsconfig.json` file in your project root.
@@ -65,11 +65,13 @@ export const eslintRules = [
65
65
  "local-rules/use-option-type-wrapper": "warn",
66
66
  "import/no-duplicates": ["error", { "prefer-inline": true }],
67
67
  "import/no-relative-parent-imports": "error",
68
+ "object-shorthand": "error",
68
69
  "no-console": ["error", { allow: ["error", "warn"] }],
69
70
  "no-continue": "warn",
70
71
  "no-delete-var": "error",
71
72
  "no-else-return": ["warn", { allowElseIf: false }],
72
73
  "no-unused-vars": "off",
74
+ "no-useless-rename": "error",
73
75
 
74
76
  // TODO: Disabled for now to allow the migration of ESLint v9 in OISY, as the rule is not yet enforced.
75
77
  // It should also be introduced as an optional rule.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dfinity/eslint-config-oisy-wallet",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Shared ESLint configurations from the Oisy Wallet team",
6
6
  "repository": {
package/svelte.mjs CHANGED
@@ -41,6 +41,15 @@ export default [
41
41
 
42
42
  {
43
43
  rules: {
44
+ "svelte/block-lang": [
45
+ "error",
46
+ {
47
+ enforceScriptPresent: false,
48
+ enforceStylePresent: false,
49
+ script: ["ts"],
50
+ style: ["scss", "postcss"],
51
+ },
52
+ ],
44
53
  "svelte/no-extra-reactive-curlies": ["error"],
45
54
  "svelte/shorthand-attribute": ["error"],
46
55
  "svelte/shorthand-directive": ["error"],