|
| 1 | +// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format |
| 2 | +import storybook from 'eslint-plugin-storybook'; |
| 3 | + |
| 4 | +import prettier from 'eslint-config-prettier'; |
| 5 | +import { includeIgnoreFile } from '@eslint/compat'; |
| 6 | +import js from '@eslint/js'; |
| 7 | +import svelte from 'eslint-plugin-svelte'; |
| 8 | +import globals from 'globals'; |
| 9 | +import { fileURLToPath } from 'node:url'; |
| 10 | +import ts from 'typescript-eslint'; |
| 11 | +import svelteConfig from './svelte.config.js'; |
| 12 | + |
| 13 | +const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url)); |
| 14 | + |
| 15 | +export default ts.config( |
| 16 | + includeIgnoreFile(gitignorePath), |
| 17 | + js.configs.recommended, |
| 18 | + ...ts.configs.recommended, |
| 19 | + ...svelte.configs.recommended, |
| 20 | + prettier, |
| 21 | + ...svelte.configs.prettier, |
| 22 | + { |
| 23 | + languageOptions: { |
| 24 | + globals: { ...globals.browser, ...globals.node } |
| 25 | + }, |
| 26 | + rules: { |
| 27 | + // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects. |
| 28 | + // 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 |
| 29 | + 'no-undef': 'off' |
| 30 | + } |
| 31 | + }, |
| 32 | + { |
| 33 | + files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'], |
| 34 | + languageOptions: { |
| 35 | + parserOptions: { |
| 36 | + projectService: true, |
| 37 | + extraFileExtensions: ['.svelte'], |
| 38 | + parser: ts.parser, |
| 39 | + svelteConfig |
| 40 | + } |
| 41 | + } |
| 42 | + }, |
| 43 | + storybook.configs['flat/recommended'] |
| 44 | +); |
0 commit comments