Skip to content

Commit

Permalink
fix: honor eslint-disable-next-line in svelte files (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
squirmy committed Jan 8, 2024
1 parent 6ee2e39 commit e3328a9
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 13 deletions.
8 changes: 8 additions & 0 deletions fixtures/input/svelte.svelte
@@ -0,0 +1,8 @@
<script lang='ts'>
export const content = "hi!"
</script>

<article>
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
<div>{@html content}</div>
</article>
8 changes: 8 additions & 0 deletions fixtures/output/all/svelte.svelte
@@ -0,0 +1,8 @@
<script lang='ts'>
export const content = 'hi!'
</script>

<article>
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
<div>{@html content}</div>
</article>
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -134,6 +134,7 @@
"lint-staged": "^15.2.0",
"rimraf": "^5.0.5",
"simple-git-hooks": "^2.9.0",
"svelte": "^4.2.8",
"svelte-eslint-parser": "^0.33.1",
"tsup": "^8.0.1",
"typescript": "^5.3.3",
Expand Down
105 changes: 92 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/configs/svelte.ts
Expand Up @@ -47,6 +47,7 @@ export async function svelte(
},
},
name: 'antfu:svelte:rules',
processor: pluginSvelte.processors['.svelte'],
rules: {
'import/no-mutable-exports': 'off',
'no-undef': 'off', // incompatible with most recent (attribute-form) generic types RFC
Expand Down
1 change: 1 addition & 0 deletions test/fixtures.test.ts
Expand Up @@ -19,6 +19,7 @@ runWithConfig('js', {
runWithConfig('all', {
typescript: true,
vue: true,
svelte: true,
})
runWithConfig('no-style', {
typescript: true,
Expand Down

0 comments on commit e3328a9

Please sign in to comment.