11// @ts -check
2-
3- import eslint from '@eslint/js' ;
4- import tseslint from 'typescript-eslint' ;
5- import eslintPluginSvelte from 'eslint-plugin-svelte' ;
2+ import js from '@eslint/js' ;
3+ import ts from 'typescript-eslint' ;
4+ import svelte from 'eslint-plugin-svelte' ;
65import globals from 'globals' ;
76
8- export default tseslint . config (
9- eslint . configs . recommended ,
10- ...tseslint . configs . recommended ,
11- ...tseslint . configs . strict ,
12- ...tseslint . configs . stylistic ,
13- ...eslintPluginSvelte . configs [ 'flat/recommended' ] ,
7+ export default ts . config (
8+ js . configs . recommended ,
9+ ...ts . configs . recommended ,
10+ ...svelte . configs [ 'flat/recommended' ] ,
11+ {
12+ languageOptions : {
13+ globals : {
14+ ...globals . browser ,
15+ ...globals . node ,
16+ // Seemingly not defined in `globals.browser`
17+ ScrollBehavior : 'readonly' ,
18+ }
19+ }
20+ } ,
21+ {
22+ files : [ '**/*.svelte' ] ,
23+ languageOptions : {
24+ parserOptions : {
25+ parser : ts . parser
26+ }
27+ }
28+ } ,
29+ {
30+ rules : {
31+ // Allow explicit any, to avoid type gymnastics
32+ "@typescript-eslint/no-explicit-any" : "off" ,
33+ "@typescript-eslint/no-unused-vars" : [ "error" , {
34+ argsIgnorePattern : "^_" ,
35+ caughtErrors : "none" ,
36+ } ]
37+ } ,
38+ } ,
1439 {
1540 ignores : [
1641 "**/.DS_Store" ,
@@ -28,20 +53,5 @@ export default tseslint.config(
2853 "**/vitest.config.ts" ,
2954 "eslint.config.mjs" ,
3055 ] ,
31- languageOptions : {
32- globals : {
33- ...globals . node ,
34- ...globals . browser ,
35- }
36- } ,
37- rules : {
38- // Allow explicit any, to avoid type gymnastics
39- "@typescript-eslint/no-explicit-any" : "off" ,
40- "@typescript-eslint/no-unused-vars" : [ "error" , {
41- argsIgnorePattern : "^_" ,
42- caughtErrors : "none" ,
43- } ]
44- } ,
4556 } ,
4657) ;
47-
0 commit comments