Skip to content

Commit fa521c7

Browse files
committed
fix(prefer-const): allow ESLint core rule's properties
1 parent d8e0724 commit fa521c7

File tree

6 files changed

+19
-7
lines changed

6 files changed

+19
-7
lines changed

.changeset/good-carrots-notice.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'eslint-plugin-svelte': patch
3+
---
4+
5+
fix(prefer-const): allow ESLint core rule's properties
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// IMPORTANT!
22
// This file has been automatically generated,
33
// in order to update its content execute "pnpm run update"
4-
export const name = 'eslint-plugin-svelte' as const;
5-
export const version = '3.9.0' as const;
4+
export const name = 'eslint-plugin-svelte';
5+
export const version = '3.9.0';

packages/eslint-plugin-svelte/src/rule-types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,9 +570,8 @@ type SveltePreferClassDirective = []|[{
570570
}]
571571
// ----- svelte/prefer-const -----
572572
type SveltePreferConst = []|[{
573-
destructuring?: ("any" | "all")
574-
ignoreReadBeforeAssign?: boolean
575573
excludedRunes?: string[]
574+
[k: string]: unknown | undefined
576575
}]
577576
// ----- svelte/require-event-prefix -----
578577
type SvelteRequireEventPrefix = []|[{

packages/eslint-plugin-svelte/src/rules/prefer-const.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,15 @@ export default createRule('prefer-const', {
5959
{
6060
type: 'object',
6161
properties: {
62-
destructuring: { enum: ['any', 'all'] },
63-
ignoreReadBeforeAssign: { type: 'boolean' },
6462
excludedRunes: {
6563
type: 'array',
6664
items: {
6765
type: 'string'
6866
}
6967
}
7068
},
71-
additionalProperties: false
69+
// allow ESLint core rule's properties
70+
additionalProperties: true
7271
}
7372
]
7473
},
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"options": [
3+
{
4+
"destructuring": "all",
5+
"ignoreReadonly": true
6+
}
7+
]
8+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
123

0 commit comments

Comments
 (0)