Skip to content

Commit

Permalink
fix: added prettier eslint plugin and cleaned up scripts + workflow s…
Browse files Browse the repository at this point in the history
…ince it runs automatically now
  • Loading branch information
michaelbrusegard committed Jan 27, 2024
1 parent ac2a877 commit 4651d39
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 17 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const config = {
'next/core-web-vitals',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:prettier/recommended',
],
rules: {
// These opinionated rules are enabled in stylistic-type-checked above.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Lint and Format
name: Lint

on: push
jobs:
lint-and-format:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -11,4 +11,3 @@ jobs:
bun-version: 1.0.24
- run: bun install
- run: bun lint
- run: bun format
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,16 @@ bun run start

To check linting, formatting or types you run the respective command:

Linting:
Check linting and formatting:

```bash
bun run lint
bun lint
```

Formatting:
Check types:

```bash
bun run format
```

Types:

```bash
bun run type
bun type-check
```

If you are using vscode and are experiencing issues with types, you can restart the typescript server by pressing `cmd + shift + p` and then type `TypeScript: Restart TS Server` (You need to have a typescript file open for this to work).
Expand Down
Binary file modified bun.lockb
Binary file not shown.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@
"build": "next build",
"dev": "next dev",
"lint": "next lint",
"format": "prettier --check '**/*.{js,cjs,ts,tsx}'",
"type": "tsc --noEmit",
"type-check": "tsc --noEmit",
"start": "next start"
},
"lint-staged": {
"*.{js,cjs,ts,tsx}": [
"eslint --fix",
"prettier --write"
"eslint --fix"
]
},
"dependencies": {
Expand Down Expand Up @@ -54,6 +52,8 @@
"@typescript-eslint/parser": "^6.11.0",
"eslint": "^8.54.0",
"eslint-config-next": "^14.0.4",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"husky": "^8.0.0",
"lint-staged": "^15.2.0",
"postcss": "^8.4.31",
Expand Down

0 comments on commit 4651d39

Please sign in to comment.