|
1 | | -import js from '@eslint/js'; |
2 | | -import { includeIgnoreFile } from '@eslint/compat'; |
3 | | -import svelte from 'eslint-plugin-svelte'; |
4 | | -import globals from 'globals'; |
5 | | -import { fileURLToPath } from 'node:url'; |
6 | | -import ts from 'typescript-eslint'; |
7 | | -import svelteConfig from './svelte.config.js'; |
| 1 | +import js from "@eslint/js"; |
| 2 | +import { includeIgnoreFile } from "@eslint/compat"; |
| 3 | +import svelte from "eslint-plugin-svelte"; |
| 4 | +import { fileURLToPath } from "node:url"; |
| 5 | +import ts from "typescript-eslint"; |
| 6 | +import svelteConfig from "./svelte.config.js"; |
8 | 7 |
|
9 | | -const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url)); |
| 8 | +const gitignorePath = fileURLToPath(new URL("./.gitignore", import.meta.url)); |
10 | 9 |
|
11 | 10 | export default ts.config( |
12 | | - includeIgnoreFile(gitignorePath), |
13 | | - js.configs.recommended, |
14 | | - ...ts.configs.strict, |
15 | | - ...svelte.configs.recommended, |
16 | | - { |
17 | | - languageOptions: { |
18 | | - globals: { ...globals.browser, ...globals.node } |
19 | | - }, |
20 | | - rules: { // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects. |
21 | | - // see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors |
22 | | - "no-undef": 'off', |
23 | | - } |
24 | | - }, |
25 | | - { |
26 | | - // Note: there should be no other properties in this object |
27 | | - ignores: ["wasm-lib/*", "dev-dist/*", "coverage/*"], |
28 | | - }, |
29 | | - { |
30 | | - files: [ |
31 | | - '**/*.svelte', |
32 | | - '**/*.svelte.ts', |
33 | | - '**/*.svelte.js' |
34 | | - ], |
35 | | - languageOptions: { |
36 | | - parserOptions: { |
37 | | - projectService: true, |
38 | | - extraFileExtensions: ['.svelte'], |
39 | | - parser: ts.parser, |
40 | | - svelteConfig |
41 | | - } |
42 | | - } |
43 | | - } |
| 11 | + includeIgnoreFile(gitignorePath), |
| 12 | + js.configs.recommended, |
| 13 | + ...ts.configs.strict, |
| 14 | + ...svelte.configs.recommended, |
| 15 | + { |
| 16 | + rules: { |
| 17 | + // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects. |
| 18 | + // see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors |
| 19 | + "no-undef": "off", |
| 20 | + }, |
| 21 | + }, |
| 22 | + { |
| 23 | + // Note: there should be no other properties in this object |
| 24 | + ignores: ["wasm-lib/*", "dev-dist/*", "coverage/*"], |
| 25 | + }, |
| 26 | + { |
| 27 | + files: ["**/*.svelte", "**/*.svelte.ts", "**/*.svelte.js"], |
| 28 | + languageOptions: { |
| 29 | + parserOptions: { |
| 30 | + projectService: true, |
| 31 | + extraFileExtensions: [".svelte"], |
| 32 | + parser: ts.parser, |
| 33 | + svelteConfig, |
| 34 | + }, |
| 35 | + }, |
| 36 | + } |
44 | 37 | ); |
0 commit comments