Skip to content

Commit b91ff29

Browse files
committed
fix(config-rush-scopes): support older NodeJS
1 parent 5939971 commit b91ff29

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

@commitlint/config-rush-scopes/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
const Path = require('path');
2-
const fs = require('fs/promises');
2+
const util = require('util');
3+
const fs = require('fs');
34
const jsonc = require('jsonc');
45

6+
const readFilePromisifed = util.promisify(fs.readFile);
7+
58
module.exports = {
69
utils: {getPackages},
710
rules: {
@@ -16,8 +19,7 @@ function getPackages(context) {
1619
const ctx = context || {};
1720
const cwd = ctx.cwd || process.cwd();
1821

19-
return fs
20-
.readFile(Path.join(cwd, 'rush.json'), {encoding: 'utf8'})
22+
return readFilePromisifed(Path.join(cwd, 'rush.json'), {encoding: 'utf8'})
2123
.then((content) => jsonc.parse(content))
2224
.then(({projects}) => projects)
2325
.catch(() => []);

0 commit comments

Comments
 (0)