Skip to content

Commit 35a9b85

Browse files
authored
Lint staged (#4)
* Fix release README badge link * Add lint-staged config * Bump version
1 parent a9ee170 commit 35a9b85

6 files changed

Lines changed: 17 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
[![Audit](https://github.com/pi-base/dev/workflows/CodeQL/badge.svg?branch=main)](https://github.com/pi-base/dev/actions/workflows/codeql.yml)
55
[![Test](https://github.com/pi-base/dev/workflows/Test/badge.svg?branch=main)](https://github.com/pi-base/dev/actions/workflows/test.yml)
6-
[![Release](https://github.com/pi-base/dev/workflows/Release/badge.svg?branch=main)](https://github.com/pi-base/code/actions/workflows/release.yml)
6+
[![Release](https://github.com/pi-base/dev/actions/workflows/release.yml/badge.svg)](https://github.com/pi-base/dev/actions/workflows/release.yml)
77
[![NPM](https://img.shields.io/npm/v/@pi-base/dev?color=blue)](https://www.npmjs.com/package/@pi-base/dev)
88

9-
<div align="center">
9+
</div>
1010

1111
Shared developer tools for π-Base packages.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pi-base/dev",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "Developer utilities for pi-base packages",
55
"keywords": [
66
"Node"

src/cli.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ cli
2525
npx('eslint', '--fix', 'src/**/*.ts', '*.js')
2626
})
2727

28+
cli
29+
.command('lint-staged')
30+
.description('Run linter on staged files')
31+
.action(() => {
32+
npx('lint-staged')
33+
})
34+
2835
cli
2936
.command('lint:check')
3037
.description('Run linter')

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export { default as eslintConfig } from './eslint'
22
export { default as prettierConfig } from './prettier'
3+
export { default as lintStagedConfig } from './lint-staged'

src/lint-staged.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export default {
2+
'*.{js,ts}': ['pi-base-dev fmt', 'pi-base-dev lint'],
3+
'*.{yml,yaml,md,json}': 'pi-base-dev fmt',
4+
}

0 commit comments

Comments
 (0)