@guoyunhe/lint-action
v1.0.1
Published
Unified ESLint + Prettier action to compose lint and format commands
Downloads
17
Maintainers
Readme
@guoyunhe/lint-action
Unified ESLint + Prettier action to compose lint and format commands
Install
npm i @guoyunhe/lint-action
Usage
Usually used with commander
to make CLI tools:
#!/usr/bin/env node
import { Command } from 'commander';
import { lint } from '@guoyunhe/lint-action';
const program = new Command('my-scripts');
program
.command('lint')
.description('Check lint problems with ESLint')
.option('--fix', 'Fix lint problems automatically')
.action(lint);
program
.command('format')
.description('Format source code with Prettier and fix ESLint issues')
.action(() => lint({ fix: true }));