Skip to content

Commit 42159c1

Browse files
committed
Update syntax of executable file
1 parent 4def8a5 commit 42159c1

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Diff for: bin/lint

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/usr/bin/env node
22

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))
410
.env('PLUGIN')
511
.usage('$0', 'Lint a buildkite plugin')
612
.option('id', {
@@ -23,7 +29,7 @@ const argv = require('yargs')
2329
default: false
2430
})
2531
.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
2733
&& !yargs.id.startsWith('./') && !yargs.id.startsWith('/') && !yargs.id.startsWith('~/') ) {
2834
throw new Error(`--id can not end with -buildkite-plugin. Did you mean ${yargs.id.replace(/-buildkite-plugin$/, '')}?`)
2935
}
@@ -34,12 +40,12 @@ const argv = require('yargs')
3440
.version(false)
3541
.argv
3642

37-
const tap = require('tap')
43+
import { t as tap } from 'tap'
3844

3945
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),
4349
])
4450
.catch((err) => {
4551
tap.threw(err)

0 commit comments

Comments
 (0)