You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.0 KiB
71 lines
2.0 KiB
import prettier from 'eslint-config-prettier';
|
|
import path from 'node:path';
|
|
import js from '@eslint/js';
|
|
import svelte from 'eslint-plugin-svelte';
|
|
import { defineConfig, includeIgnoreFile } from 'eslint/config';
|
|
import globals from 'globals';
|
|
import ts from 'typescript-eslint';
|
|
|
|
const gitignorePath = path.resolve(import.meta.dirname, '.gitignore');
|
|
|
|
export default defineConfig(
|
|
includeIgnoreFile(gitignorePath),
|
|
js.configs.recommended,
|
|
ts.configs.recommended,
|
|
svelte.configs.recommended,
|
|
prettier,
|
|
svelte.configs.prettier,
|
|
{
|
|
languageOptions: { globals: { ...globals.browser, ...globals.node } },
|
|
rules: {
|
|
// typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
|
|
// 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
|
|
'no-undef': 'off'
|
|
}
|
|
},
|
|
{
|
|
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
projectService: true,
|
|
extraFileExtensions: ['.svelte'],
|
|
parser: ts.parser
|
|
}
|
|
}
|
|
},
|
|
{
|
|
/*
|
|
* El panel es la otra aplicación del repositorio y no está en el
|
|
* `tsconfig.json` de la web, así que el servicio de proyectos no encontraba
|
|
* sus componentes y fallaba al leerlos. Se le dice cuál es el suyo.
|
|
*/
|
|
files: ['src/panel/**/*.svelte', 'src/panel/**/*.ts'],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
projectService: false,
|
|
project: './tsconfig.panel.json',
|
|
tsconfigRootDir: import.meta.dirname,
|
|
extraFileExtensions: ['.svelte'],
|
|
parser: ts.parser
|
|
}
|
|
}
|
|
},
|
|
{
|
|
// Override or add rule settings here, such as:
|
|
// 'svelte/button-has-type': 'error'
|
|
rules: {}
|
|
},
|
|
{
|
|
files: ['src/estudio/**/*.svelte', 'src/estudio/**/*.ts'],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
projectService: false,
|
|
project: './tsconfig.estudio.json',
|
|
tsconfigRootDir: import.meta.dirname,
|
|
extraFileExtensions: ['.svelte'],
|
|
parser: ts.parser
|
|
}
|
|
}
|
|
}
|
|
);
|