Skip to content

Commit

Permalink
Merge pull request #9 from Marukome0743/main
Browse files Browse the repository at this point in the history
Add Biome
  • Loading branch information
Marukome0743 authored Dec 9, 2023
2 parents 082746c + c518d10 commit 46e094a
Show file tree
Hide file tree
Showing 12 changed files with 198 additions and 1,777 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ max_line_length = 0
trim_trailing_whitespace = false

[COMMIT_EDITMSG]
max_line_length = 0
max_line_length = 0
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
*.mts text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2

.vscode/launch.json linguist-generated
*.lockb binary diff=lockb
*.lockb binary diff=lockb
10 changes: 4 additions & 6 deletions .github/workflows/bun-types-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,23 @@ on:
- "tsconfig.json"
- "yarn.lock"
workflow_dispatch:

jobs:
build:
name: type-tests
runs-on: ubuntu-latest
outputs:
failing_tests: ${{ steps.test.outputs.failing_tests }}
failing_tests_count: ${{ steps.test.outputs.failing_tests_count }}

steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: bun i
- name: Format app
run: bun run lint
- name: Build app
run: bun run build
- name: Test app
Expand All @@ -65,7 +63,7 @@ jobs:
**[View test output](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})**
<sup>[#${{ github.sha }}](https://github.com/${{ github.repository }}/commits/${{ github.sha }})</sup>
- name: Uncomment on PR
if: steps.test.outputs.failing_tests == '' && github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v2
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Code quality

on:
push:
pull_request:

jobs:
quality:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Biome
uses: biomejs/setup-biome@v1
with:
version: latest
- name: Run Biome
run: biome ci .
17 changes: 7 additions & 10 deletions .github/workflows/node-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ on:
- "tsconfig.json"
- "yarn.lock"
workflow_dispatch:

jobs:
build:
name: build-app
runs-on: ubuntu-latest
outputs:
failing_tests: ${{ steps.test.outputs.failing_tests }}
failing_tests_count: ${{ steps.test.outputs.failing_tests_count }}

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -50,21 +50,18 @@ jobs:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Cache node_modules
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: node-cache-${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
node-cache-${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn --frozen-lockfile

- name: Format app
run: npm run lint


- name: Build app
run: npm run build --if-present

Expand All @@ -81,7 +78,7 @@ jobs:
**[View test output](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})**
<sup>[#${{ github.sha }}](https://github.com/${{ github.repository }}/commits/${{ github.sha }})</sup>
- name: Uncomment on PR
if: steps.test.outputs.failing_tests == '' && github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v2
Expand Down
11 changes: 2 additions & 9 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
{
"recommendations": [
"ms-vscode-remote.vscode-remote-extensionpack",
"ms-azuretools.vscode-docker",
"davidanson.vscode-markdownlint",
"editorconfig.editorconfig",
"eamodio.gitlens",
"github.vscode-github-actions"
]
}
"recommendations": ["biomejs.biome-nightly"]
}
16 changes: 8 additions & 8 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ export default function Home() {
target="_blank"
rel="noopener noreferrer"
>
<h2 className={`mb-3 text-2xl font-semibold`}>
<h2 className={'mb-3 text-2xl font-semibold'}>
Docs{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
<p className={'m-0 max-w-[30ch] text-sm opacity-50'}>
Find in-depth information about Next.js features and API.
</p>
</a>
Expand All @@ -63,13 +63,13 @@ export default function Home() {
target="_blank"
rel="noopener noreferrer"
>
<h2 className={`mb-3 text-2xl font-semibold`}>
<h2 className={'mb-3 text-2xl font-semibold'}>
Learn{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
<p className={'m-0 max-w-[30ch] text-sm opacity-50'}>
Learn about Next.js in an interactive course with&nbsp;quizzes!
</p>
</a>
Expand All @@ -80,13 +80,13 @@ export default function Home() {
target="_blank"
rel="noopener noreferrer"
>
<h2 className={`mb-3 text-2xl font-semibold`}>
<h2 className={'mb-3 text-2xl font-semibold'}>
Templates{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
<p className={'m-0 max-w-[30ch] text-sm opacity-50'}>
Explore starter templates for Next.js.
</p>
</a>
Expand All @@ -97,13 +97,13 @@ export default function Home() {
target="_blank"
rel="noopener noreferrer"
>
<h2 className={`mb-3 text-2xl font-semibold`}>
<h2 className={'mb-3 text-2xl font-semibold'}>
Deploy{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
<p className={'m-0 max-w-[30ch] text-sm opacity-50'}>
Instantly deploy your Next.js site to a shareable URL with Vercel.
</p>
</a>
Expand Down
37 changes: 37 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "https://biomejs.dev/schemas/1.4.1/schema.json",
"linter": {
"ignore": [".next", "node_modules"],
"rules": {
"nursery": {
"all": true
}
}
},
"formatter": {
"ignore": [".next", "node_modules"],
"indentStyle": "space"
},
"organizeImports": {
"enabled": true
},
"javascript": {
"parser": {
"unsafeParameterDecoratorsEnabled": true
},
"formatter": {
"quoteStyle": "single",
"semicolons": "asNeeded",
"indentStyle": "space"
}
},
"json": {
"parser": {
"allowComments": true
},
"formatter": {
"enabled": true,
"indentStyle": "space"
}
}
}
Binary file removed bun.lockb
Binary file not shown.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
"next": "14.0.4"
},
"devDependencies": {
"typescript": "^5",
"@biomejs/biome": "1.4.1",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.0.1",
"postcss": "^8",
"tailwindcss": "^3.3.6",
"eslint": "^8",
"eslint-config-next": "14.0.4"
"typescript": "^5"
}
}
Loading

0 comments on commit 46e094a

Please sign in to comment.