Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 120

[*.md]
trim_trailing_whitespace = false
4 changes: 4 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

eval "$(devenv direnvrc)"
use devenv
4 changes: 0 additions & 4 deletions .eslintrc.json

This file was deleted.

20 changes: 8 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,21 @@ jobs:
steps:
- uses: actions/checkout@v5

# The action reads the pnpm version from the packageManager field in package.json.
- name: Install pnpm
uses: pnpm/action-setup@v6

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"

- name: Cache node modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: "pnpm"

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Run lint
run: npm run lint
run: pnpm run lint

- name: Run build
run: npm run build
run: pnpm run build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
# devenv
.devenv
.devenv.flake.nix
.pre-commit-config.yaml
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pnpm-lock.yaml
devenv.lock
4 changes: 0 additions & 4 deletions .prettierrc

This file was deleted.

18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Formats source code from stdin and writes the formatted code to stdout.
## Install

```sh
npm install
npm run build
npm link
pnpm install
pnpm run build
pnpm add --global "$PWD"
```

## Usage
Expand Down Expand Up @@ -46,3 +46,15 @@ open "Format JSON.shortcut"
```

To see all the options, run `format-code shortcuts --help`.

## Development

The project uses [devenv](https://devenv.sh) to install Node.js and pnpm. To
enter the dev shell, run:

```sh
devenv shell
```

If you use [direnv](https://direnv.net), run `direnv allow` one time. Then
direnv loads the dev shell when you enter the folder.
Loading
Loading