Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
66 lines (64 loc) · 2.06 KB
/
Copy patheslint.config.js
File metadata and controls
66 lines (64 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import prettier from 'eslint-config-prettier';
import js from '@eslint/js';
import { includeIgnoreFile } from '@eslint/compat';
import { defineConfig } from 'eslint/config';
import svelte from 'eslint-plugin-svelte';
import betterTailwindcss from 'eslint-plugin-better-tailwindcss';
import security from 'eslint-plugin-security';
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 defineConfig(
includeIgnoreFile(gitignorePath),
{ ignores: ['src/lib/editor/generated/**'] },
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs.recommended,
{ ...security.configs.recommended, files: ['**/*.ts'] },
prettier,
...svelte.configs.prettier,
{
languageOptions: {
globals: { ...globals.browser, ...globals.node }
},
rules: {
'no-undef': 'off',
// It will currently also error on external links or links with query parameters
// https://github.com/sveltejs/eslint-plugin-svelte/issues/1353
'svelte/no-navigation-without-resolve': 'warn',
// Too common occurance in this project, disabling for now
'security/detect-object-injection': 'off'
}
},
{
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
languageOptions: {
parserOptions: {
projectService: true,
extraFileExtensions: ['.svelte'],
parser: ts.parser
}
}
},
{
files: ['src/**/*.svelte'],
plugins: { 'better-tailwindcss': betterTailwindcss },
settings: {
'better-tailwindcss': {
entryPoint: 'src/app.css'
}
},
rules: {
'better-tailwindcss/no-unknown-classes': [
'warn',
{
detectComponentClasses: true,
// DaisyUIs nestes selectors are not detected by this rule.
// Ignore them to catch outdated classes from DaisyUI v4 Agents seem to love.
ignore: ['dropdown-content', 'tab-active', 'swap-on', 'swap-off', 'menu-disabled']
}
]
}
}
);