Skip to content

Commit a2e4439

Browse files
committed
chore(eslint-local-rules): convert require to import
1 parent fc3e514 commit a2e4439

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

eslint-local-rules.cjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ const path = require('node:path')
44
const glob = require('glob')
55

66
module.exports = Object.fromEntries(
7-
glob.sync('./scripts/rules/*', { cwd: __dirname, dotRelative: true }).map(name => (
8-
[path.parse(name).name, require(name).default]
9-
))
7+
glob.sync('./scripts/rules/*', { cwd: __dirname, dotRelative: true }).map(name => {
8+
const modulePath = path.resolve(__dirname, name)
9+
const module = require(modulePath)
10+
return [path.parse(name).name, module.default || module]
11+
})
1012
)

0 commit comments

Comments
 (0)