@node-rs/deno-lint
Version:
Deno lint binding for Node.js
27 lines • 1.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.cli = void 0;
const deno_lint_1 = require("@node-rs/deno-lint");
const clipanion_1 = require("clipanion");
class LintCommand extends clipanion_1.Command {
constructor() {
super(...arguments);
this.cwd = clipanion_1.Option.String({ required: false });
this.configPath = clipanion_1.Option.String('-c,--config', { required: false });
this.checkOnly = clipanion_1.Option.Boolean('--check-only', { required: false });
}
execute() {
var _a, _b;
const hasError = (0, deno_lint_1.denolint)((_a = this.cwd) !== null && _a !== void 0 ? _a : __dirname, (_b = this.configPath) !== null && _b !== void 0 ? _b : '.denolint.json');
return Promise.resolve(hasError && !this.checkOnly ? 1 : 0);
}
}
LintCommand.usage = {
description: 'deno lint [options] [path]',
};
exports.cli = new clipanion_1.Cli({
binaryLabel: 'deno-lint',
binaryVersion: require('./package.json').version,
});
exports.cli.register(LintCommand);
//# sourceMappingURL=cli.js.map