File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
packages/eslint-plugin/src/rules Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,10 @@ export default createRule<RuleOptions, keyof typeof messages>({
65
65
} ,
66
66
defaultOptions : [ ] ,
67
67
create ( context ) {
68
- const filename = context . filename ?? context . getFilename ( )
69
- const sourceCode = context . sourceCode ?? context . getSourceCode ( )
68
+ const filename =
69
+ context . filename ?? /* istanbul ignore next */ context . getFilename ( )
70
+ const sourceCode =
71
+ context . sourceCode ?? /* istanbul ignore next */ context . getSourceCode ( )
70
72
const jsxRuntimeMode = context . options . find (
71
73
( option ) : option is JSXConfig =>
72
74
typeof option === 'object' && option . runtime === 'automatic'
@@ -272,9 +274,10 @@ export default createRule<RuleOptions, keyof typeof messages>({
272
274
}
273
275
274
276
const lastSpecifier = specifiers [ specifiers . length - 1 ]
275
- const scope = sourceCode . getScope
276
- ? sourceCode . getScope ( node )
277
- : context . getScope ( )
277
+ const scope =
278
+ typeof sourceCode . getScope === 'function'
279
+ ? sourceCode . getScope ( node )
280
+ : /* istanbul ignore next */ context . getScope ( )
278
281
279
282
if ( scope . variables . some ( x => x . name === 'css' ) ) {
280
283
return [
You can’t perform that action at this time.
0 commit comments