eslint-plugin-svelte 3.3.2 → 3.3.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/lib/main.d.ts +1 -1
- package/lib/meta.d.ts +1 -1
- package/lib/meta.js +1 -1
- package/lib/rules/no-unused-props.js +12 -4
- package/package.json +1 -1
package/lib/main.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare const configs: {
|
|
|
14
14
|
export declare const rules: Record<string, Rule.RuleModule>;
|
|
15
15
|
export declare const meta: {
|
|
16
16
|
name: "eslint-plugin-svelte";
|
|
17
|
-
version: "3.3.
|
|
17
|
+
version: "3.3.3";
|
|
18
18
|
};
|
|
19
19
|
export declare const processors: {
|
|
20
20
|
'.svelte': typeof processor;
|
package/lib/meta.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "eslint-plugin-svelte";
|
|
2
|
-
export declare const version = "3.3.
|
|
2
|
+
export declare const version = "3.3.3";
|
package/lib/meta.js
CHANGED
|
@@ -303,10 +303,18 @@ export default createRule('no-unused-props', {
|
|
|
303
303
|
usedProps = getUsedPropertiesFromPattern(node.id);
|
|
304
304
|
if (usedProps.size === 0)
|
|
305
305
|
return;
|
|
306
|
-
const identifiers =
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
306
|
+
const identifiers = [];
|
|
307
|
+
for (const p of node.id.properties) {
|
|
308
|
+
if (p.type !== 'Property') {
|
|
309
|
+
continue;
|
|
310
|
+
}
|
|
311
|
+
if (p.value.type === 'Identifier') {
|
|
312
|
+
identifiers.push(p.value);
|
|
313
|
+
}
|
|
314
|
+
else if (p.value.type === 'AssignmentPattern' && p.value.left.type === 'Identifier') {
|
|
315
|
+
identifiers.push(p.value.left);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
310
318
|
for (const identifier of identifiers) {
|
|
311
319
|
const paths = getUsedNestedPropertyNames(identifier);
|
|
312
320
|
usedPaths.push(...paths.map((path) => [identifier.name, ...path]));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-svelte",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.3",
|
|
4
4
|
"description": "ESLint plugin for Svelte using AST",
|
|
5
5
|
"repository": "git+https://github.com/sveltejs/eslint-plugin-svelte.git",
|
|
6
6
|
"homepage": "https://sveltejs.github.io/eslint-plugin-svelte",
|