https://github.com/guoyunhe/lint-action
Unified ESLint + Prettier action to compose lint and format commands
https://github.com/guoyunhe/lint-action
Last synced: 3 months ago
JSON representation
Unified ESLint + Prettier action to compose lint and format commands
- Host: GitHub
- URL: https://github.com/guoyunhe/lint-action
- Owner: guoyunhe
- License: gpl-3.0
- Created: 2023-01-30T02:47:36.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-30T06:31:17.000Z (over 2 years ago)
- Last Synced: 2025-02-13T21:18:22.309Z (4 months ago)
- Language: TypeScript
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# @guoyunhe/lint-action
Unified ESLint + Prettier action to compose lint and format commands
## Install
```bash
npm i @guoyunhe/lint-action
```## Usage
Usually used with `commander` to make CLI tools:
```ts
#!/usr/bin/env nodeimport { 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 }));
```