@@ -25,7 +25,7 @@ import type {
25
25
import * as jsoncESLintParser from 'jsonc-eslint-parser'
26
26
import * as yamlESLintParser from 'yaml-eslint-parser'
27
27
import { getCwd } from './get-cwd'
28
- import { getSourceCode } from './compat'
28
+ import { getFilename , getSourceCode } from './compat'
29
29
30
30
interface LocaleFiles {
31
31
files : string [ ]
@@ -45,7 +45,7 @@ export function defineTemplateBodyVisitor(
45
45
) : RuleListener {
46
46
const sourceCode = getSourceCode ( context )
47
47
if ( sourceCode . parserServices . defineTemplateBodyVisitor == null ) {
48
- const filename = context . getFilename ( )
48
+ const filename = getFilename ( context )
49
49
if ( extname ( filename ) === '.vue' ) {
50
50
context . report ( {
51
51
loc : UNEXPECTED_ERROR_LOCATION ,
@@ -268,12 +268,12 @@ function getLocaleMessagesFromI18nBlocks(
268
268
context : RuleContext ,
269
269
i18nBlocks : VAST . VElement [ ]
270
270
) {
271
- const sourceCode = context . getSourceCode ( )
271
+ const sourceCode = getSourceCode ( context )
272
272
let localeMessages = i18nBlockLocaleMessages . get ( sourceCode . ast )
273
273
if ( localeMessages ) {
274
274
return localeMessages
275
275
}
276
- const filename = context . getFilename ( )
276
+ const filename = getFilename ( context )
277
277
localeMessages = i18nBlocks
278
278
. map ( block => {
279
279
const attrs = getStaticAttributes ( block )
@@ -387,7 +387,7 @@ export function getVueObjectType(
387
387
const parent = node . parent
388
388
if ( parent . type === 'ExportDefaultDeclaration' ) {
389
389
// export default {} in .vue || .jsx
390
- const ext = extname ( context . getFilename ( ) ) . toLowerCase ( )
390
+ const ext = extname ( getFilename ( context ) ) . toLowerCase ( )
391
391
if (
392
392
( ext === '.vue' || ext === '.jsx' || ! ext ) &&
393
393
skipTSAsExpression ( parent . declaration ) === node
@@ -443,7 +443,7 @@ export function getVueObjectType(
443
443
( pp . key . type === 'Identifier'
444
444
? pp . key . name
445
445
: pp . key . type === 'Literal'
446
- ? pp . key . value + ''
446
+ ? ` ${ pp . key . value } `
447
447
: '' ) === 'components'
448
448
) {
449
449
return 'components-option'
@@ -667,7 +667,7 @@ function getComponentComments(context: RuleContext) {
667
667
if ( tokens ) {
668
668
return tokens
669
669
}
670
- const sourceCode = context . getSourceCode ( )
670
+ const sourceCode = getSourceCode ( context )
671
671
tokens = sourceCode
672
672
. getAllComments ( )
673
673
. filter ( comment => / @ v u e \/ c o m p o n e n t / g. test ( comment . value ) )
0 commit comments