We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5939971 commit b91ff29Copy full SHA for b91ff29
@commitlint/config-rush-scopes/index.js
@@ -1,7 +1,10 @@
1
const Path = require('path');
2
-const fs = require('fs/promises');
+const util = require('util');
3
+const fs = require('fs');
4
const jsonc = require('jsonc');
5
6
+const readFilePromisifed = util.promisify(fs.readFile);
7
+
8
module.exports = {
9
utils: {getPackages},
10
rules: {
@@ -16,8 +19,7 @@ function getPackages(context) {
16
19
const ctx = context || {};
17
20
const cwd = ctx.cwd || process.cwd();
18
21
- return fs
- .readFile(Path.join(cwd, 'rush.json'), {encoding: 'utf8'})
22
+ return readFilePromisifed(Path.join(cwd, 'rush.json'), {encoding: 'utf8'})
23
.then((content) => jsonc.parse(content))
24
.then(({projects}) => projects)
25
.catch(() => []);
0 commit comments