Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Use eslint types for exported configs #789

Merged
merged 3 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/eslint-plugin-svelte/src/configs/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export = {
extends: [baseExtend],
rules: Object.fromEntries(
rules
.map((rule) => [`svelte/${rule.meta.docs.ruleName}`, 'error'])
.map((rule) => [`svelte/${rule.meta.docs.ruleName}`, 'error' as const])
.filter(
([ruleName]) =>
![
Expand Down
10 changes: 5 additions & 5 deletions packages/eslint-plugin-svelte/src/configs/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ export = {
parser: require.resolve('svelte-eslint-parser'),
rules: {
// ESLint core rules known to cause problems with `.svelte`.
'no-inner-declarations': 'off', // The AST generated by svelte-eslint-parser will false positives in it rule because the root node of the script is not the `Program`.
// "no-irregular-whitespace": "off",
'no-inner-declarations': 'off' as const, // The AST generated by svelte-eslint-parser will false positives in it rule because the root node of the script is not the `Program`.
// "no-irregular-whitespace": "off" as const,
// Self assign is one of way to update reactive value in Svelte.
'no-self-assign': 'off',
'no-self-assign': 'off' as const,

// eslint-plugin-svelte rules
'svelte/comment-directive': 'error',
'svelte/system': 'error'
'svelte/comment-directive': 'error' as const,
'svelte/system': 'error' as const
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-svelte/src/configs/flat/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default [
{
rules: Object.fromEntries(
rules
.map((rule) => [`svelte/${rule.meta.docs.ruleName}`, 'error'])
.map((rule) => [`svelte/${rule.meta.docs.ruleName}`, 'error' as const])
.filter(
([ruleName]) =>
![
Expand Down
10 changes: 5 additions & 5 deletions packages/eslint-plugin-svelte/src/configs/flat/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ export default [
},
rules: {
// ESLint core rules known to cause problems with `.svelte`.
'no-inner-declarations': 'off', // The AST generated by svelte-eslint-parser will false positives in it rule because the root node of the script is not the `Program`.
// "no-irregular-whitespace": "off",
'no-inner-declarations': 'off' as const, // The AST generated by svelte-eslint-parser will false positives in it rule because the root node of the script is not the `Program`.
// "no-irregular-whitespace": "off" as const,
// Self assign is one of way to update reactive value in Svelte.
'no-self-assign': 'off',
'no-self-assign': 'off' as const,

// eslint-plugin-svelte rules
'svelte/comment-directive': 'error',
'svelte/system': 'error'
'svelte/comment-directive': 'error' as const,
'svelte/system': 'error' as const
},
processor: 'svelte/svelte'
}
Expand Down
22 changes: 11 additions & 11 deletions packages/eslint-plugin-svelte/src/configs/flat/prettier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ export default [
{
rules: {
// eslint-plugin-svelte rules
'svelte/first-attribute-linebreak': 'off',
'svelte/html-closing-bracket-spacing': 'off',
'svelte/html-quotes': 'off',
'svelte/html-self-closing': 'off',
'svelte/indent': 'off',
'svelte/max-attributes-per-line': 'off',
'svelte/mustache-spacing': 'off',
'svelte/no-spaces-around-equal-signs-in-attribute': 'off',
'svelte/no-trailing-spaces': 'off',
'svelte/shorthand-attribute': 'off',
'svelte/shorthand-directive': 'off'
'svelte/first-attribute-linebreak': 'off' as const,
'svelte/html-closing-bracket-spacing': 'off' as const,
'svelte/html-quotes': 'off' as const,
'svelte/html-self-closing': 'off' as const,
'svelte/indent': 'off' as const,
'svelte/max-attributes-per-line': 'off' as const,
'svelte/mustache-spacing': 'off' as const,
'svelte/no-spaces-around-equal-signs-in-attribute': 'off' as const,
'svelte/no-trailing-spaces': 'off' as const,
'svelte/shorthand-attribute': 'off' as const,
'svelte/shorthand-directive': 'off' as const
}
}
];
28 changes: 14 additions & 14 deletions packages/eslint-plugin-svelte/src/configs/flat/recommended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ export default [
{
rules: {
// eslint-plugin-svelte rules
'svelte/comment-directive': 'error',
'svelte/no-at-debug-tags': 'warn',
'svelte/no-at-html-tags': 'error',
'svelte/no-dupe-else-if-blocks': 'error',
'svelte/no-dupe-style-properties': 'error',
'svelte/no-dynamic-slot-name': 'error',
'svelte/no-inner-declarations': 'error',
'svelte/no-not-function-handler': 'error',
'svelte/no-object-in-text-mustaches': 'error',
'svelte/no-shorthand-style-property-overrides': 'error',
'svelte/no-unknown-style-directive-property': 'error',
'svelte/no-unused-svelte-ignore': 'error',
'svelte/system': 'error',
'svelte/valid-compile': 'error'
'svelte/comment-directive': 'error' as const,
'svelte/no-at-debug-tags': 'warn' as const,
'svelte/no-at-html-tags': 'error' as const,
'svelte/no-dupe-else-if-blocks': 'error' as const,
'svelte/no-dupe-style-properties': 'error' as const,
'svelte/no-dynamic-slot-name': 'error' as const,
'svelte/no-inner-declarations': 'error' as const,
'svelte/no-not-function-handler': 'error' as const,
'svelte/no-object-in-text-mustaches': 'error' as const,
'svelte/no-shorthand-style-property-overrides': 'error' as const,
'svelte/no-unknown-style-directive-property': 'error' as const,
'svelte/no-unused-svelte-ignore': 'error' as const,
'svelte/system': 'error' as const,
'svelte/valid-compile': 'error' as const
}
}
];
22 changes: 11 additions & 11 deletions packages/eslint-plugin-svelte/src/configs/prettier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ export = {
extends: [baseExtend],
rules: {
// eslint-plugin-svelte rules
'svelte/first-attribute-linebreak': 'off',
'svelte/html-closing-bracket-spacing': 'off',
'svelte/html-quotes': 'off',
'svelte/html-self-closing': 'off',
'svelte/indent': 'off',
'svelte/max-attributes-per-line': 'off',
'svelte/mustache-spacing': 'off',
'svelte/no-spaces-around-equal-signs-in-attribute': 'off',
'svelte/no-trailing-spaces': 'off',
'svelte/shorthand-attribute': 'off',
'svelte/shorthand-directive': 'off'
'svelte/first-attribute-linebreak': 'off' as const,
'svelte/html-closing-bracket-spacing': 'off' as const,
'svelte/html-quotes': 'off' as const,
'svelte/html-self-closing': 'off' as const,
'svelte/indent': 'off' as const,
'svelte/max-attributes-per-line': 'off' as const,
'svelte/mustache-spacing': 'off' as const,
'svelte/no-spaces-around-equal-signs-in-attribute': 'off' as const,
'svelte/no-trailing-spaces': 'off' as const,
'svelte/shorthand-attribute': 'off' as const,
'svelte/shorthand-directive': 'off' as const
}
};
28 changes: 14 additions & 14 deletions packages/eslint-plugin-svelte/src/configs/recommended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ export = {
extends: [baseExtend],
rules: {
// eslint-plugin-svelte rules
'svelte/comment-directive': 'error',
'svelte/no-at-debug-tags': 'warn',
'svelte/no-at-html-tags': 'error',
'svelte/no-dupe-else-if-blocks': 'error',
'svelte/no-dupe-style-properties': 'error',
'svelte/no-dynamic-slot-name': 'error',
'svelte/no-inner-declarations': 'error',
'svelte/no-not-function-handler': 'error',
'svelte/no-object-in-text-mustaches': 'error',
'svelte/no-shorthand-style-property-overrides': 'error',
'svelte/no-unknown-style-directive-property': 'error',
'svelte/no-unused-svelte-ignore': 'error',
'svelte/system': 'error',
'svelte/valid-compile': 'error'
'svelte/comment-directive': 'error' as const,
'svelte/no-at-debug-tags': 'warn' as const,
'svelte/no-at-html-tags': 'error' as const,
'svelte/no-dupe-else-if-blocks': 'error' as const,
'svelte/no-dupe-style-properties': 'error' as const,
'svelte/no-dynamic-slot-name': 'error' as const,
'svelte/no-inner-declarations': 'error' as const,
'svelte/no-not-function-handler': 'error' as const,
'svelte/no-object-in-text-mustaches': 'error' as const,
'svelte/no-shorthand-style-property-overrides': 'error' as const,
'svelte/no-unknown-style-directive-property': 'error' as const,
'svelte/no-unused-svelte-ignore': 'error' as const,
'svelte/system': 'error' as const,
'svelte/valid-compile': 'error' as const
}
};