@@ -5,12 +5,12 @@ import url from 'node:url';
5
5
import process from 'node:process' ;
6
6
import childProcess from 'node:child_process' ;
7
7
import { runESLint } from '../runners/runESlint.js' ;
8
-
8
+ console . log ( "running custom linter" ) ;
9
9
10
10
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 ;
14
14
}
15
15
16
16
const projectPath = path . dirname (
@@ -42,7 +42,7 @@ async function main(argv = process.argv) {
42
42
eslintArgs . push ( '--fix' ) ;
43
43
}
44
44
console . error ( 'Running eslint:' ) ;
45
- await runESLint ( { fix} ) ;
45
+ await runESLint ( { fix } ) ;
46
46
console . error ( [ 'eslint' , ...eslintArgs ] . join ( ' ' ) ) ;
47
47
childProcess . execFileSync ( 'eslint' , eslintArgs , {
48
48
stdio : [ 'inherit' , 'inherit' , 'inherit' ] ,
@@ -77,9 +77,11 @@ async function main(argv = process.argv) {
77
77
cwd : projectPath ,
78
78
} ) ;
79
79
} 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
+ ) ;
81
83
}
82
-
84
+
83
85
// Linting markdown
84
86
const prettierArgs = [
85
87
! fix ? '--check' : '--write' ,
@@ -102,7 +104,9 @@ export default main;
102
104
103
105
if ( import . meta. url . startsWith ( 'file:' ) ) {
104
106
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
+ // }
108
112
}
0 commit comments