Skip to content

Commit

Permalink
Example: Update ESLint configuration for Svelte
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed Dec 9, 2024
1 parent 380657d commit 67ae9cb
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions examples/svelte/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import js from '@eslint/js'
import { includeIgnoreFile } from '@eslint/compat'
import svelte from 'eslint-plugin-svelte'
import globals from 'globals';
import { fileURLToPath } from 'node:url'
import ts from 'typescript-eslint'

const gitignorePath = fileURLToPath(new URL("./.gitignore", import.meta.url))

export default ts.config(
includeIgnoreFile(gitignorePath),
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs["flat/recommended"],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node
}
}
},
{
files: ["**/*.svelte"],
languageOptions: {
parserOptions: {
parser: ts.parser
}
}
}
)

0 comments on commit 67ae9cb

Please sign in to comment.