64 lines
1.3 KiB
JavaScript
64 lines
1.3 KiB
JavaScript
// ESLint v9 Flat Config
|
|
import tseslint from 'typescript-eslint';
|
|
import svelte from 'eslint-plugin-svelte';
|
|
import prettier from 'eslint-config-prettier';
|
|
import globals from 'globals';
|
|
|
|
export default [
|
|
// Ignore patterns
|
|
{
|
|
ignores: [
|
|
'**/node_modules/**',
|
|
'**/dist/**',
|
|
'**/build/**',
|
|
'**/.svelte-kit/**',
|
|
'**/coverage/**',
|
|
'**/*.min.js',
|
|
],
|
|
},
|
|
|
|
// Base recommended configs
|
|
...tseslint.configs.recommended,
|
|
...svelte.configs['flat/recommended'],
|
|
prettier,
|
|
|
|
// Configuration for all files
|
|
{
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.node,
|
|
},
|
|
},
|
|
rules: {
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'error',
|
|
{
|
|
argsIgnorePattern: '^_',
|
|
varsIgnorePattern: '^_',
|
|
},
|
|
],
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
|
'prefer-const': 'error',
|
|
'no-var': 'error',
|
|
},
|
|
},
|
|
|
|
// Svelte-specific config
|
|
{
|
|
files: ['**/*.svelte'],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
parser: tseslint.parser,
|
|
},
|
|
},
|
|
rules: {
|
|
'svelte/no-at-html-tags': 'error',
|
|
'svelte/no-target-blank': 'error',
|
|
'@typescript-eslint/no-explicit-any': 'off', // Allow any in Svelte files
|
|
},
|
|
},
|
|
];
|
|
|