|
| 1 | +import prettier from 'eslint-config-prettier'; |
| 2 | +import js from '@eslint/js'; |
| 3 | +import { includeIgnoreFile } from '@eslint/compat'; |
| 4 | +import svelte from 'eslint-plugin-svelte'; |
| 5 | +import globals from 'globals'; |
| 6 | +import { fileURLToPath } from 'node:url'; |
| 7 | +import ts from 'typescript-eslint'; |
| 8 | +import svelteConfig from './svelte.config.js'; |
| 9 | +import dciLint from 'eslint-plugin-dci-lint'; |
| 10 | + |
| 11 | +const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url)); |
| 12 | + |
| 13 | +export default ts.config( |
| 14 | + includeIgnoreFile(gitignorePath), |
| 15 | + js.configs.recommended, |
| 16 | + ...ts.configs.recommended, |
| 17 | + ...svelte.configs.recommended, |
| 18 | + prettier, |
| 19 | + ...svelte.configs.prettier, |
| 20 | + dciLint.configs.recommended, |
| 21 | + { |
| 22 | + languageOptions: { |
| 23 | + globals: { ...globals.browser, ...globals.node } |
| 24 | + }, |
| 25 | + rules: { |
| 26 | + 'no-undef': 'off', |
| 27 | + 'svelte/require-each-key': 'off', |
| 28 | + 'dci-lint/literal-role-contracts': 'off' |
| 29 | + } |
| 30 | + }, |
| 31 | + { |
| 32 | + files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'], |
| 33 | + languageOptions: { |
| 34 | + parserOptions: { |
| 35 | + projectService: true, |
| 36 | + extraFileExtensions: ['.svelte'], |
| 37 | + parser: ts.parser, |
| 38 | + svelteConfig |
| 39 | + } |
| 40 | + } |
| 41 | + }, |
| 42 | + { |
| 43 | + files: ['src/lib/**'], |
| 44 | + |
| 45 | + rules: { |
| 46 | + 'no-console': [ |
| 47 | + 'error', |
| 48 | + { |
| 49 | + allow: ['warn'] |
| 50 | + } |
| 51 | + ] |
| 52 | + } |
| 53 | + } |
| 54 | +); |
0 commit comments