11import "eslint-plugin-only-warn" ;
2- // @ts -ignore
32import js from "@eslint/js" ;
43import ts from "typescript-eslint" ;
5- import react from "eslint-plugin-react" ;
6- // @ts -ignore
74import prettier from "eslint-config-prettier" ;
85import svelte from "eslint-plugin-svelte" ;
96import globals from "globals" ;
10- import svelteParser from "svelte-eslint-parser" ;
117
128export default ts . config (
13- js . configs . recommended ,
14- ...ts . configs . recommendedTypeChecked ,
15- // @ts -ignore
16- ...svelte . configs [ "flat/recommended" ] ,
17- prettier ,
18- ...svelte . configs [ "flat/prettier" ] ,
19- // react.configs.flat.recommended,
209 {
21- files : [ "**/*.{jsx,tsx}" ] ,
22- plugins : { react } ,
23- languageOptions : {
24- parserOptions : { ecmaFeatures : { jsx : true } } ,
25- globals : { ...globals . browser } ,
26- } ,
10+ ignores : [
11+ ".svelte-kit" ,
12+ ".vercel" ,
13+ "build" ,
14+ "node_modules" ,
15+ "package" ,
16+ "vite.config.ts.timestamp-*.mjs" ,
17+ ] ,
2718 } ,
2819 {
2920 languageOptions : {
30- ecmaVersion : 2022 ,
21+ ecmaVersion : "latest" ,
3122 sourceType : "module" ,
3223 globals : {
33- ...globals . node ,
3424 ...globals . browser ,
3525 sveltify : true ,
3626 hooks : true ,
3727 react : true ,
3828 } ,
39- parser : svelteParser ,
4029 parserOptions : {
4130 parser : ts . parser ,
4231 extraFileExtensions : [ ".svelte" ] ,
43- project : `tsconfig.eslint.json` ,
44- ecmaFeatures : { } ,
32+ project : "tsconfig.eslint.json" ,
4533 } ,
4634 } ,
4735 } ,
36+ js . configs . recommended ,
37+ ts . configs . eslintRecommended ,
38+ ...ts . configs . recommendedTypeChecked ,
39+ ...ts . configs . stylisticTypeChecked ,
40+ ...svelte . configs [ "flat/recommended" ] ,
41+ prettier ,
42+ ...svelte . configs [ "flat/prettier" ] ,
4843 {
4944 rules : {
45+ "@typescript-eslint/consistent-type-definitions" : [ "warn" , "type" ] ,
5046 "@typescript-eslint/ban-ts-comment" : "off" ,
5147 "@typescript-eslint/no-explicit-any" : "off" ,
48+ "@typescript-eslint/no-shadow" : "warn" ,
5249 "@typescript-eslint/no-unsafe-assignment" : "off" ,
5350 "@typescript-eslint/no-unsafe-member-access" : "off" ,
5451 "@typescript-eslint/no-unused-vars" : [
@@ -60,9 +57,12 @@ export default ts.config(
6057 "no-console" : [ "warn" , { allow : [ "info" , "warn" , "error" ] } ] ,
6158 "no-useless-rename" : "warn" ,
6259 "object-shorthand" : "warn" ,
60+ "prefer-const" : "off" ,
6361 "prefer-template" : "warn" ,
6462 "svelte/block-lang" : [ "warn" , { script : "ts" } ] ,
6563 "svelte/no-at-html-tags" : "off" ,
64+ "svelte/prefer-const" : [ "warn" , { destructuring : "all" } ] ,
65+ "svelte/require-each-key" : "off" ,
6666 "@typescript-eslint/no-unsafe-call" : 0 ,
6767 "@typescript-eslint/no-unsafe-return" : 0 ,
6868 "@typescript-eslint/no-unsafe-argument" : 0 ,
@@ -84,15 +84,7 @@ export default ts.config(
8484 } ,
8585 } ,
8686 {
87- ignores : [
88- ".svelte-kit" ,
89- ".vercel" ,
90- "build" ,
91- "node_modules" ,
92- "package" ,
93- "vite.config.ts.timestamp-*.mjs" ,
94- "src/global.d.ts" ,
95- "src/tests/reactify.spec.tsx" ,
96- ] ,
87+ files : [ "**/*.cjs" , "**/*.js" , "**/*.server.ts" ] ,
88+ languageOptions : { globals : globals . node } ,
9789 } ,
9890) ;
0 commit comments