60 lines
1.3 KiB
JavaScript
60 lines
1.3 KiB
JavaScript
import js from '@eslint/js';
|
|
import tsPlugin from '@typescript-eslint/eslint-plugin';
|
|
import tsParser from '@typescript-eslint/parser';
|
|
import sveltePlugin from 'eslint-plugin-svelte';
|
|
import svelteParser from 'svelte-eslint-parser';
|
|
|
|
export default [
|
|
js.configs.recommended,
|
|
{
|
|
files: ['**/*.{js,mjs,cjs,ts,svelte}'],
|
|
languageOptions: {
|
|
parser: tsParser,
|
|
parserOptions: {
|
|
sourceType: 'module',
|
|
ecmaVersion: 2020,
|
|
},
|
|
globals: {
|
|
fetch: 'readonly',
|
|
console: 'readonly',
|
|
window: 'readonly',
|
|
document: 'readonly',
|
|
localStorage: 'readonly',
|
|
$state: 'readonly',
|
|
$derived: 'readonly',
|
|
$effect: 'readonly',
|
|
$props: 'readonly',
|
|
$inspect: 'readonly',
|
|
$host: 'readonly',
|
|
},
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': tsPlugin,
|
|
svelte: sveltePlugin,
|
|
},
|
|
rules: {
|
|
...tsPlugin.configs.recommended.rules,
|
|
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
},
|
|
},
|
|
{
|
|
files: ['**/*.svelte'],
|
|
languageOptions: {
|
|
parser: svelteParser,
|
|
parserOptions: {
|
|
parser: tsParser,
|
|
},
|
|
},
|
|
plugins: {
|
|
svelte: sveltePlugin,
|
|
},
|
|
rules: {
|
|
...sveltePlugin.configs.recommended.rules,
|
|
},
|
|
},
|
|
{
|
|
ignores: ['node_modules/**', '.svelte-kit/**', 'build/**', 'dist/**'],
|
|
},
|
|
];
|