A fork of pds-dash for selfhosted.social
1
2import {fileURLToPath} from 'node:url';
3import {includeIgnoreFile} from '@eslint/compat';
4import js from '@eslint/js';
5import svelte from 'eslint-plugin-svelte';
6import {defineConfig} from 'eslint/config';
7import globals from 'globals';
8import ts from 'typescript-eslint';
9import svelteConfig from './svelte.config.js';
10
11const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
12
13export default defineConfig(
14 includeIgnoreFile(gitignorePath),
15 js.configs.recommended,
16 ...ts.configs.recommended,
17 ...svelte.configs.recommended,
18 {
19 languageOptions: {
20 globals: {...globals.browser, ...globals.node}
21 },
22 rules: { // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
23 // 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
24 'no-undef': 'off',
25 'quotes': ['error', 'single'],
26
27 }
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 }
44);