@@ -24,28 +24,24 @@ function toArray<T>(value: T | T[]): T[] {
24
24
25
25
export class TsEslintConfigForVue {
26
26
// the name property is here to provide better error messages when ESLint throws an error
27
- name : string
28
-
29
- #configName: ExtendableConfigName
27
+ configName : ExtendableConfigName
30
28
31
29
constructor ( configName : ExtendableConfigName ) {
32
- this . #configName = configName
33
-
34
- this . name = `vueTsConfigs.${ configName } `
30
+ this . configName = configName
35
31
}
36
32
37
33
needsTypeChecking ( ) : boolean {
38
- if ( this . # configName === 'disableTypeChecked' ) {
34
+ if ( this . configName === 'disableTypeChecked' ) {
39
35
return false
40
36
}
41
- if ( this . # configName === 'all' ) {
37
+ if ( this . configName === 'all' ) {
42
38
return true
43
39
}
44
- return this . # configName. includes ( 'TypeChecked' )
40
+ return this . configName . includes ( 'TypeChecked' )
45
41
}
46
42
47
43
toConfigArray ( ) : FlatConfig . ConfigArray {
48
- return toArray ( tseslint . configs [ this . # configName] )
44
+ return toArray ( tseslint . configs [ this . configName ] )
49
45
. flat ( )
50
46
. map ( config =>
51
47
config . files && config . files . includes ( '**/*.ts' )
@@ -68,7 +64,18 @@ export const vueTsConfigs = Object.fromEntries(
68
64
// `defineConfigWithVueTs()`
69
65
// We throw an error here to provide a better error message to the user.
70
66
ownKeys ( ) {
71
- throw new Error ( 'Please wrap the config object with `defineConfigWithVueTs()`' )
67
+ throw new Error (
68
+ 'Please wrap the config object with `defineConfigWithVueTs()`' ,
69
+ )
70
+ } ,
71
+
72
+ get ( target , prop ) {
73
+ // for clearer error messages on where the config is coming from
74
+ if ( prop === 'name' ) {
75
+ return `vueTsConfigs.${ Reflect . get ( target , 'configName' ) } `
76
+ }
77
+
78
+ return Reflect . get ( target , prop )
72
79
} ,
73
80
} ) ,
74
81
] ) ,
0 commit comments