You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add `ignorePropertyPatterns` property and rename `ignorePatterns` to `ignoreTypePatterns` in `no-unused-props` rule. The `ignorePatterns` option existed only for a few hours and is removed by this PR. Technically, this is a breaking change, but we’ll handle it as a minor release since very few users are likely affected.
Copy file name to clipboardexpand all lines: docs/rules/no-unused-props.md
+26-5
Original file line number
Diff line number
Diff line change
@@ -159,14 +159,17 @@ Note: Properties of class types are not checked for usage, as they might be used
159
159
"svelte/no-unused-props": ["error", {
160
160
// Whether to check properties from imported types
161
161
"checkImportedTypes":false,
162
+
// Patterns to ignore when checking property types
163
+
"ignoreTypePatterns": [],
162
164
// Patterns to ignore when checking for unused props
163
-
"ignorePatterns": []
165
+
"ignorePropertyPatterns": [],
164
166
}]
165
167
}
166
168
```
167
169
168
-
-`checkImportedTypes` ... Controls whether to check properties from imported types. Default is `false`.
169
-
-`ignorePatterns` ... Patterns to ignore when checking for unused props. Default is an empty array.
170
+
-`checkImportedTypes` ... Controls whether to check properties from types defined in external files. Default is `false`, meaning the rule only checks types defined within the component file itself. When set to `true`, the rule will also check properties from imported and extended types.
171
+
-`ignoreTypePatterns` ... Regular expression patterns for type names to exclude from checks. Default is `[]` (no exclusions). Most useful when `checkImportedTypes` is `true`, allowing you to exclude specific imported types (like utility types or third-party types) from being checked.
172
+
-`ignorePropertyPatterns` ... Regular expression patterns for property names to exclude from unused checks. Default is `[]` (no exclusions). Most useful when `checkImportedTypes` is `true`, allowing you to ignore specific properties from external types that shouldn't trigger warnings.
'eslint-plugin-svelte: The `ignorePatterns` option in the `no-unused-props` rule has been removed. Please use `ignorePropertyPatterns` or/and `ignoreTypePatterns` instead.'
Copy file name to clipboardexpand all lines: packages/eslint-plugin-svelte/tests/fixtures/rules/no-unused-props/invalid/ignored-pattern-partial-config.json
Copy file name to clipboardexpand all lines: packages/eslint-plugin-svelte/tests/fixtures/rules/no-unused-props/valid/ignored-conditional-type-config.json
0 commit comments