1
1
#!/usr/bin/env node
2
2
3
- const argv = require ( 'yargs' )
3
+ import yargs from 'yargs'
4
+
5
+ import yaml_linter from '../lib/linters/plugin-yaml-linter.js'
6
+ import example_linter from '../lib/linters/example-linter.js'
7
+ import readme_linter from '../lib/linters/readme-version-number-linter.js'
8
+
9
+ const argv = yargs ( process . argv . slice ( 2 ) )
4
10
. env ( 'PLUGIN' )
5
11
. usage ( '$0' , 'Lint a buildkite plugin' )
6
12
. option ( 'id' , {
@@ -23,7 +29,7 @@ const argv = require('yargs')
23
29
default : false
24
30
} )
25
31
. check ( yargs => {
26
- if ( yargs && yargs . id && yargs . id . endsWith ( '-buildkite-plugin' ) && yargs . id . indexOf ( '://' ) === - 1
32
+ if ( yargs && yargs . id && yargs . id . endsWith ( '-buildkite-plugin' ) && yargs . id . indexOf ( '://' ) === - 1
27
33
&& ! yargs . id . startsWith ( './' ) && ! yargs . id . startsWith ( '/' ) && ! yargs . id . startsWith ( '~/' ) ) {
28
34
throw new Error ( `--id can not end with -buildkite-plugin. Did you mean ${ yargs . id . replace ( / - b u i l d k i t e - p l u g i n $ / , '' ) } ?` )
29
35
}
@@ -34,12 +40,12 @@ const argv = require('yargs')
34
40
. version ( false )
35
41
. argv
36
42
37
- const tap = require ( 'tap' )
43
+ import { t as tap } from 'tap'
38
44
39
45
Promise . all ( [
40
- require ( '../lib/linters/plugin-yaml-linter' ) ( argv , tap ) ,
41
- require ( '../lib/linters/example-linter' ) ( argv , tap ) ,
42
- require ( '../lib/linters/readme-version-number-linter' ) ( argv , tap )
46
+ yaml_linter ( argv , tap ) ,
47
+ example_linter ( argv , tap ) ,
48
+ readme_linter ( argv , tap ) ,
43
49
] )
44
50
. catch ( ( err ) => {
45
51
tap . threw ( err )
0 commit comments