@naturalcycles/dev-lib 19.0.0 → 19.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lint.util.js +5 -5
- package/package.json +1 -1
package/dist/lint.util.js
CHANGED
|
@@ -108,7 +108,8 @@ export async function eslintAll(opt) {
|
|
|
108
108
|
async function runESLint(dir, eslintConfigPath, tsconfigPath, extensions = eslintExtensions.split(','), fix = true) {
|
|
109
109
|
if (!eslintConfigPath || !existsSync(dir))
|
|
110
110
|
return; // faster to bail-out like this
|
|
111
|
-
|
|
111
|
+
const eslintPath = findPackageBinPath('eslint', 'eslint');
|
|
112
|
+
await exec2.spawnAsync(eslintPath, {
|
|
112
113
|
args: [
|
|
113
114
|
`--config`,
|
|
114
115
|
eslintConfigPath,
|
|
@@ -156,7 +157,7 @@ export function stylelintAll() {
|
|
|
156
157
|
const config = [`./stylelint.config.js`].find(f => existsSync(f));
|
|
157
158
|
if (!config)
|
|
158
159
|
return;
|
|
159
|
-
//
|
|
160
|
+
// stylelint is never hoisted from dev-lib, so, no need to search for its path
|
|
160
161
|
exec2.spawn('stylelint', {
|
|
161
162
|
args: [fix ? `--fix` : '', `--allow-empty-input`, `--config`, config, ...stylelintPaths].filter(Boolean),
|
|
162
163
|
shell: false,
|
|
@@ -183,9 +184,8 @@ export function runCommitlintCommand() {
|
|
|
183
184
|
const env = {
|
|
184
185
|
GIT_BRANCH: git2.getCurrentBranchName(),
|
|
185
186
|
};
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
exec2.spawn(`node ./node_modules/.bin/commitlint --edit ${editMsg} --config ${config}`, {
|
|
187
|
+
const commitlintPath = findPackageBinPath('@commitlint/cli', 'commitlint');
|
|
188
|
+
exec2.spawn(`${commitlintPath} --edit ${editMsg} --config ${config}`, {
|
|
189
189
|
env,
|
|
190
190
|
passProcessEnv: true, // important to pass it through, to preserve $PATH
|
|
191
191
|
forceColor: false,
|