@@ -10,56 +10,54 @@ import eslint_plugin_import from 'eslint-plugin-import';
10
10
11
11
const gitignore_path = fileURLToPath ( new URL ( './.gitignore' , import . meta. url ) ) ;
12
12
13
- export default /** @type {ts.Config } */ (
14
- ts . config (
15
- includeIgnoreFile ( gitignore_path ) ,
16
- js . configs . recommended ,
17
- ...ts . configs . recommended ,
18
- ...svelte . configs . recommended ,
19
- eslint_plugin_import . flatConfigs . recommended ,
20
- prettier ,
21
- ...svelte . configs . prettier ,
22
- {
23
- languageOptions : {
24
- globals : { ...globals . browser , ...globals . node } ,
25
- } ,
26
- rules : {
27
- // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
28
- // 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
29
- 'no-undef' : 'off' ,
30
- '@typescript-eslint/naming-convention' : [
31
- 'error' ,
32
- {
33
- selector : [ 'variableLike' ] ,
34
- format : [ 'snake_case' , 'UPPER_CASE' ] ,
35
- leadingUnderscore : 'allow' ,
36
- } ,
37
- ] ,
38
- 'func-style' : [ 'error' , 'declaration' , { allowTypeAnnotation : true } ] ,
39
- 'import/no-unresolved' : 'off' , // this doesn't work well with typescript path mapping
40
- 'import/extensions' : [
41
- 'error' ,
42
- 'ignorePackages' ,
43
- {
44
- js : 'always' ,
45
- mjs : 'always' ,
46
- cjs : 'always' ,
47
- ts : 'always' ,
48
- svelte : 'always' ,
49
- } ,
50
- ] ,
51
- } ,
13
+ export default /** @type {import("eslint").Linter.Config } */ ( [
14
+ includeIgnoreFile ( gitignore_path ) ,
15
+ js . configs . recommended ,
16
+ ...ts . configs . recommended ,
17
+ ...svelte . configs . recommended ,
18
+ eslint_plugin_import . flatConfigs . recommended ,
19
+ prettier ,
20
+ ...svelte . configs . prettier ,
21
+ {
22
+ languageOptions : {
23
+ globals : { ...globals . browser , ...globals . node } ,
52
24
} ,
53
- {
54
- files : [ '**/*.svelte' , '**/*.svelte.ts' , '**/*.svelte.js' ] ,
55
- languageOptions : {
56
- parserOptions : {
57
- projectService : true ,
58
- extraFileExtensions : [ '.svelte' ] ,
59
- parser : ts . parser ,
60
- svelteConfig,
25
+ rules : {
26
+ // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
27
+ // 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
28
+ 'no-undef' : 'off' ,
29
+ '@typescript-eslint/naming-convention' : [
30
+ 'error' ,
31
+ {
32
+ selector : [ 'variableLike' ] ,
33
+ format : [ 'snake_case' , 'UPPER_CASE' ] ,
34
+ leadingUnderscore : 'allow' ,
61
35
} ,
36
+ ] ,
37
+ 'func-style' : [ 'error' , 'declaration' , { allowTypeAnnotation : true } ] ,
38
+ 'import/no-unresolved' : 'off' , // this doesn't work well with typescript path mapping
39
+ 'import/extensions' : [
40
+ 'error' ,
41
+ 'ignorePackages' ,
42
+ {
43
+ js : 'always' ,
44
+ mjs : 'always' ,
45
+ cjs : 'always' ,
46
+ ts : 'always' ,
47
+ svelte : 'always' ,
48
+ } ,
49
+ ] ,
50
+ } ,
51
+ } ,
52
+ {
53
+ files : [ '**/*.svelte' , '**/*.svelte.ts' , '**/*.svelte.js' ] ,
54
+ languageOptions : {
55
+ parserOptions : {
56
+ projectService : true ,
57
+ extraFileExtensions : [ '.svelte' ] ,
58
+ parser : ts . parser ,
59
+ svelteConfig,
62
60
} ,
63
61
} ,
64
- )
65
- ) ;
62
+ } ,
63
+ ] ) ;
0 commit comments