File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -14,3 +14,10 @@ import 'node:process'
14
14
import '@jcoreio/toolchain'
15
15
16
16
import '@jcoreio/eslint-plugin-implicit-dependencies'
17
+
18
+ const foo = 1
19
+ export { foo }
20
+
21
+ export default foo
22
+
23
+ export class Bar { }
Original file line number Diff line number Diff line change @@ -76,7 +76,9 @@ export default {
76
76
'CallExpression:exit' : ( node ) => {
77
77
if (
78
78
node . callee . type === 'Identifier' &&
79
- node . callee . name === 'require'
79
+ node . callee . name === 'require' &&
80
+ node . arguments . length >= 1 &&
81
+ node . arguments [ 0 ] . type === 'Literal'
80
82
) {
81
83
const name = node . arguments [ 0 ] . value
82
84
checkModuleName ( name , node )
@@ -91,11 +93,11 @@ export default {
91
93
checkModuleName ( name , node )
92
94
} ,
93
95
'ExportNamedDeclaration:exit' : ( node ) => {
94
- const name = node . source . value
96
+ const name = node . source ? .value
95
97
checkModuleName ( name , node )
96
98
} ,
97
99
'ExportAllDeclaration:exit' : ( node ) => {
98
- const name = node . source . value
100
+ const name = node . source ? .value
99
101
checkModuleName ( name , node )
100
102
} ,
101
103
}
You can’t perform that action at this time.
0 commit comments