Skip to content

Commit 0cd35e5

Browse files
committed
wip: testing changes to fix issue with lint.ts not running correctly
1 parent 3d2e8d1 commit 0cd35e5

File tree

5 files changed

+375
-200
lines changed

5 files changed

+375
-200
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"./package.json": "./package.json",
2525
"bin": {
26-
"matrixai-lint": "dist/bin/lint.js"
26+
"matrixai-lint": "./dist/bin/lint.js"
2727
},
2828
"scripts": {
2929
"prepare": "tsc -p ./tsconfig.build.json",

src/bin/lint.ts

+14-10
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import url from 'node:url';
55
import process from 'node:process';
66
import childProcess from 'node:child_process';
77
import { runESLint } from '../runners/runESlint.js';
8-
8+
console.log("running custom linter");
99

1010
function commandExists(cmd: string): boolean {
11-
const whichCmd = process.platform === 'win32' ? 'where' : 'which';
12-
const result = childProcess.spawnSync(whichCmd, [cmd], { stdio: 'ignore' });
13-
return result.status === 0;
11+
const whichCmd = process.platform === 'win32' ? 'where' : 'which';
12+
const result = childProcess.spawnSync(whichCmd, [cmd], { stdio: 'ignore' });
13+
return result.status === 0;
1414
}
1515

1616
const projectPath = path.dirname(
@@ -42,7 +42,7 @@ async function main(argv = process.argv) {
4242
eslintArgs.push('--fix');
4343
}
4444
console.error('Running eslint:');
45-
await runESLint({fix});
45+
await runESLint({ fix });
4646
console.error(['eslint', ...eslintArgs].join(' '));
4747
childProcess.execFileSync('eslint', eslintArgs, {
4848
stdio: ['inherit', 'inherit', 'inherit'],
@@ -77,9 +77,11 @@ async function main(argv = process.argv) {
7777
cwd: projectPath,
7878
});
7979
} else {
80-
console.warn('Skipping shellcheck: find or shellcheck not found in environment.');
80+
console.warn(
81+
'Skipping shellcheck: find or shellcheck not found in environment.',
82+
);
8183
}
82-
84+
8385
// Linting markdown
8486
const prettierArgs = [
8587
!fix ? '--check' : '--write',
@@ -102,7 +104,9 @@ export default main;
102104

103105
if (import.meta.url.startsWith('file:')) {
104106
const modulePath = url.fileURLToPath(import.meta.url);
105-
if (process.argv[1] === modulePath) {
106-
void main();
107-
}
107+
void main();
108+
// if (process.argv[1] === modulePath) {
109+
// console.log("try run main");
110+
// void main();
111+
// }
108112
}

src/configs/matrixai-config-bundle.js

-182
This file was deleted.

0 commit comments

Comments
 (0)