Skip to content

Commit b3319aa

Browse files
committed
docs: require is not defined in ES module scope
1 parent d804133 commit b3319aa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/verifyCommit.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Invoked on the commit-msg git hook by yorkie.
22

3-
const chalk = require('chalk')
3+
import chalk from 'chalk';
44
const msgPath = process.env.GIT_PARAMS
5-
const msg = require('fs').readFileSync(msgPath, 'utf-8').trim()
5+
import fs from 'fs';
6+
const msg = fs.readFileSync(msgPath, 'utf-8').trim()
67

78
const releaseRE = /^v\d/
89
const commitRE = /^(revert: )?(feat|fix|style|docs|typo|dx|refactor|perf|test|workflow|build|ci|chore|types|wip|release|deps)(\(.+\))?: .{1,50}/
910

1011
if (!releaseRE.test(msg) && !commitRE.test(msg)) {
11-
console.log()
1212
console.error(
1313
` ${chalk.bgRed.white(' ERROR ')} ${chalk.red(
1414
`invalid commit message format.`
@@ -21,4 +21,4 @@ if (!releaseRE.test(msg) && !commitRE.test(msg)) {
2121
chalk.red(` See .github/commit-convention.md for more details.\n`)
2222
)
2323
process.exit(1)
24-
}
24+
}

0 commit comments

Comments
 (0)