Skip to content

Commit 35b5d3b

Browse files
authored
Merge pull request #540 from ixartz/Oxlint
feat: use Oxlint instead ESLint and use Ultracite preset
2 parents 32b2bc6 + b8e4f06 commit 35b5d3b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+16385
-21391
lines changed

.coderabbit.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ reviews:
1313
collapse_walkthrough: false
1414
path_instructions:
1515
- path: '**/*.{ts,tsx}'
16-
instructions:
17-
'Review the Typescript and React code for conformity with best practices in React, and Typescript. Highlight any deviations.'
16+
instructions: 'Review the Typescript and React code for conformity with best practices in React, and Typescript. Highlight any deviations.'
1817
auto_review:
1918
enabled: true
2019
ignore_title_keywords:

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com
1414

1515
# Database
1616
# Local database with PGLite, already included in the project, no Docker needed
17-
# Need a database for production? Check out https://www.prisma.io/?via=nextjsboilerplate
17+
# Need a database for production? Check out https://get.neon.com/BMFYNtx
1818
# Tested and compatible with Next.js Boilerplate
1919
DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:5432/postgres
2020

.env.production

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ NEXT_PUBLIC_LOGGING_LEVEL=info
3232

3333
# Database
3434
# Using an incorrect DATABASE_URL value, Next.js build will timeout and you will get the following error: "because it took more than 60 seconds"
35-
# Need a database for production? Check out https://www.prisma.io/?via=nextjsboilerplate
35+
# Need a database for production? Check out https://get.neon.com/BMFYNtx
3636
# Tested and compatible with Next.js Boilerplate
3737
# DATABASE_URL=postgresql://postgres@localhost:5432/postgres
3838

.github/actions/setup-project/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ runs:
3737
with:
3838
path: |
3939
.next
40+
next-env.d.ts
4041
key: nextjs-build-${{ inputs.node-version }}-${{ github.sha }}
4142
fail-on-cache-miss: true

.github/workflows/CI.yml

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -39,58 +39,48 @@ jobs:
3939
NEXT_PUBLIC_SENTRY_DISABLED: 'true' # Only upload Sentry source maps in deployment
4040
NEXT_PUBLIC_APP_URL: http://localhost:3008
4141

42-
- if: matrix.node-version == '22.x' && success()
42+
- if: matrix.node-version == '24.x' && success()
4343
name: Cache Next.js build output
4444
uses: actions/cache/save@v5
4545
with:
4646
path: |
4747
.next
48+
next-env.d.ts
4849
key: nextjs-build-${{ matrix.node-version }}-${{ github.sha }}
4950

50-
static:
51+
unit:
5152
strategy:
5253
matrix:
53-
node-version: [22.x]
54+
node-version: [24.x]
5455

55-
name: Run static checks
56+
name: Run unit tests
5657
runs-on: ubuntu-latest
5758
timeout-minutes: 10
5859

5960
steps:
6061
- uses: actions/checkout@v6
61-
with:
62-
fetch-depth: 0 # Retrieve Git history, needed to verify commits
6362

6463
- name: Set up Node.js environment
6564
uses: ./.github/actions/setup-project
6665
with:
6766
node-version: ${{ matrix.node-version }}
6867

69-
- if: github.event_name == 'pull_request'
70-
name: Validate all commits from PR
71-
run: npx commitlint --from $BASE_SHA --to $HEAD_SHA --verbose
72-
env:
73-
BASE_SHA: ${{ github.event.pull_request.base.sha }}
74-
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
75-
76-
- name: Linter
77-
run: npm run lint
78-
79-
- name: Type checking
80-
run: npm run check:types
81-
82-
- name: Check dependencies
83-
run: npm run check:deps
68+
- name: Run unit tests
69+
uses: docker://mcr.microsoft.com/playwright:v1.58.2
70+
with:
71+
args: npm run test -- --coverage
8472

85-
- name: I18n check
86-
run: npm run check:i18n
73+
- name: Upload coverage reports to Codecov
74+
uses: codecov/codecov-action@v5
75+
env:
76+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
8777

88-
unit:
78+
storybook:
8979
strategy:
9080
matrix:
91-
node-version: [22.x]
81+
node-version: [24.x]
9282

93-
name: Run unit tests
83+
name: Run Storybook
9484
runs-on: ubuntu-latest
9585
timeout-minutes: 10
9686

@@ -102,42 +92,52 @@ jobs:
10292
with:
10393
node-version: ${{ matrix.node-version }}
10494

105-
- name: Run unit tests
95+
- name: Run storybook tests
10696
uses: docker://mcr.microsoft.com/playwright:v1.58.2
10797
with:
108-
args: npm run test -- --coverage
109-
110-
- name: Upload coverage reports to Codecov
111-
uses: codecov/codecov-action@v5
112-
env:
113-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
98+
args: npm run storybook:test
11499

115-
storybook:
100+
static:
116101
strategy:
117102
matrix:
118-
node-version: [22.x]
103+
node-version: [24.x]
119104

120-
name: Run Storybook
105+
name: Run static checks
121106
runs-on: ubuntu-latest
122107
timeout-minutes: 10
108+
needs: [build]
123109

124110
steps:
125111
- uses: actions/checkout@v6
112+
with:
113+
fetch-depth: 0 # Retrieve Git history, needed to verify commits
126114

127115
- name: Set up Node.js environment
128116
uses: ./.github/actions/setup-project
129117
with:
130118
node-version: ${{ matrix.node-version }}
119+
restore-nextjs-cache: true
131120

132-
- name: Run storybook tests
133-
uses: docker://mcr.microsoft.com/playwright:v1.58.2
134-
with:
135-
args: npm run storybook:test
121+
- if: github.event_name == 'pull_request'
122+
name: Validate all commits from PR
123+
run: npx commitlint --from $BASE_SHA --to $HEAD_SHA --verbose
124+
env:
125+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
126+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
127+
128+
- name: Linter
129+
run: npm run lint
130+
131+
- name: Check dependencies
132+
run: npm run check:deps
133+
134+
- name: I18n check
135+
run: npm run check:i18n
136136

137137
e2e:
138138
strategy:
139139
matrix:
140-
node-version: [22.x]
140+
node-version: [24.x]
141141

142142
name: Run E2E tests
143143
runs-on: ubuntu-latest

.github/workflows/checkly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
test-e2e:
1212
strategy:
1313
matrix:
14-
node-version: [22.x]
14+
node-version: [24.x]
1515
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
1616

1717
# Only run when the deployment was successful

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
release:
1313
strategy:
1414
matrix:
15-
node-version: [22.x]
15+
node-version: [24.x]
1616

1717
name: Create a new release
1818
runs-on: ubuntu-latest

.oxfmtrc.jsonc

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Ultracite oxfmt Configuration
2+
// https://oxc.rs/docs/guide/usage/formatter/config-file-reference.html
3+
{
4+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
5+
"arrowParens": "always",
6+
"bracketSameLine": false,
7+
"bracketSpacing": true,
8+
"endOfLine": "lf",
9+
"experimentalSortImports": {
10+
"ignoreCase": true,
11+
"newlinesBetween": false,
12+
"order": "asc"
13+
},
14+
"experimentalSortPackageJson": true,
15+
"jsxSingleQuote": false,
16+
"printWidth": 80,
17+
"quoteProps": "as-needed",
18+
"semi": true,
19+
"singleQuote": true,
20+
"tabWidth": 2,
21+
"trailingComma": "es5",
22+
"useTabs": false,
23+
"ignorePatterns": ["migrations/*", "*.md"],
24+
"sortTailwindcss": {
25+
"stylesheet": "src/styles/global.css"
26+
},
27+
// Keep JSON/JSONC output consistent between the CLI and VS Code, more info at https://github.com/oxc-project/oxc-vscode/issues/140
28+
"overrides": [
29+
{
30+
"files": ["**/*.json", "**/*.jsonc"],
31+
"options": {
32+
"trailingComma": "none"
33+
}
34+
}
35+
]
36+
}

.oxlintrc.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"extends": [
4+
"./node_modules/ultracite/config/oxlint/core/.oxlintrc.json",
5+
"./node_modules/ultracite/config/oxlint/next/.oxlintrc.json",
6+
"./node_modules/ultracite/config/oxlint/react/.oxlintrc.json"
7+
],
8+
"rules": {
9+
"no-warning-comments": "off", // Allow TODO and FIXME comments
10+
"no-inline-comments": "off",
11+
12+
"sort-keys": "off",
13+
"func-style": "off",
14+
15+
"typescript/no-unsafe-assignment": "off",
16+
"typescript/no-unsafe-member-access": "off",
17+
"typescript/no-unsafe-call": "off",
18+
"typescript/strict-boolean-expressions": "off",
19+
"typescript/consistent-type-definitions": ["error", "type"], // Use `type` instead of `interface`
20+
"typescript/no-misused-promises": "off", // React Hook Form's handleSubmit returns a Promise-typed handler
21+
22+
"react-perf/jsx-no-new-function-as-prop": "off",
23+
24+
"unicorn/filename-case": "off", // Impossible to enforce consistent filename case due to multiple conventions
25+
26+
// --- JSDoc Rules ---
27+
"jsdoc/require-param": "error",
28+
"jsdoc/require-param-description": "error",
29+
"jsdoc/require-returns": "error",
30+
"jsdoc/require-returns-description": "error"
31+
},
32+
"options": {
33+
"reportUnusedDisableDirectives": "error"
34+
}
35+
}

.storybook/main.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
import type { StorybookConfig } from '@storybook/nextjs-vite';
22

33
const config: StorybookConfig = {
4-
stories: [
5-
'../src/**/*.mdx',
6-
'../src/**/*.stories.@(js|jsx|mjs|ts|tsx)',
7-
],
8-
addons: [
9-
'@storybook/addon-docs',
10-
'@storybook/addon-a11y',
11-
],
4+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5+
addons: ['@storybook/addon-docs', '@storybook/addon-a11y'],
126
framework: {
137
name: '@storybook/nextjs-vite',
148
options: {},
159
},
16-
staticDirs: [
17-
'../public',
18-
],
10+
staticDirs: ['../public'],
1911
features: {
2012
experimentalRSC: true,
2113
},

0 commit comments

Comments
 (0)