Skip to content

Commit c8afcb7

Browse files
authored
Merge pull request #4 from forge42dev/biome
The one where biome replaces eslint
2 parents 39b959d + 8ef3184 commit c8afcb7

34 files changed

Lines changed: 14524 additions & 16428 deletions

.eslintrc.cjs

Lines changed: 0 additions & 82 deletions
This file was deleted.

.github/workflows/validate.yml

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,15 @@ permissions:
1414
pull-requests: write
1515
jobs:
1616
lint:
17-
name: ESLint
17+
name: Biome lint
1818
runs-on: ubuntu-latest
1919
steps:
20-
- name: 🛑 Cancel Previous Runs
21-
uses: styfle/cancel-workflow-action@0.12.1
22-
23-
- name: ⬇️ Checkout repo
24-
uses: actions/checkout@v4
25-
26-
- name: ⎔ Setup node
27-
uses: actions/setup-node@v4
28-
with:
29-
node-version: 20
30-
31-
- name: 📥 Download deps
32-
uses: bahmutov/npm-install@v1
33-
with:
34-
useLockFile: false
35-
36-
- name: 🔬 Lint
37-
run: npm run lint:strict
20+
- name: ⬇️ Checkout repo
21+
uses: actions/checkout@v4
22+
- name: Setup Biome
23+
uses: biomejs/setup-biome@v2
24+
- name: Run Biome
25+
run: biome ci .
3826

3927
typecheck:
4028
name: 🔎 Type check

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npm run typecheck && npm run lint:strict
1+
npm run typecheck && npm run lint

.prettierignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"recommendations": ["codeforge.remix-forge"]
2+
"recommendations": ["codeforge.remix-forge", "biomejs.biome"]
33
}

.vscode/settings.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"editor.defaultFormatter": "biomejs.biome",
3+
"editor.formatOnSave": true,
4+
"editor.formatOnType": false,
5+
"editor.renderWhitespace": "all",
6+
"editor.rulers": [120, 160],
7+
"editor.codeActionsOnSave": {
8+
"source.fixAll": "always",
9+
"source.organizeImports": "never",
10+
"source.organizeImports.biome": "always",
11+
"quickfix.biome": "always"
12+
},
13+
"eslint.enable": false,
14+
"prettier.enable": false,
15+
"editor.insertSpaces": false,
16+
"editor.detectIndentation": false,
17+
"editor.tabSize": 2,
18+
"editor.trimAutoWhitespace": true,
19+
"workbench.colorCustomizations": {
20+
"editorWhitespace.foreground": "#333"
21+
},
22+
"files.trimTrailingWhitespace": true,
23+
"files.trimTrailingWhitespaceInRegexAndStrings": true,
24+
"files.trimFinalNewlines": true,
25+
"[yaml]": {
26+
"editor.defaultFormatter": "redhat.vscode-yaml"
27+
},
28+
"[typescriptreact]": {
29+
"editor.defaultFormatter": "biomejs.biome"
30+
},
31+
"[typescript]": {
32+
"editor.defaultFormatter": "biomejs.biome"
33+
}
34+
}

app/entry.client.tsx

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
1-
import { RemixBrowser } from "@remix-run/react";
2-
import { startTransition, StrictMode } from "react";
3-
import { hydrateRoot } from "react-dom/client";
4-
import i18n from "~/localization/i18n";
5-
import i18next from "i18next";
6-
import { I18nextProvider, initReactI18next } from "react-i18next";
7-
import LanguageDetector from "i18next-browser-languagedetector";
8-
import Backend from "i18next-http-backend";
9-
import { getInitialNamespaces } from "remix-i18next/client";
10-
import { resources } from "./localization/resource";
1+
import { RemixBrowser } from "@remix-run/react"
2+
import i18next from "i18next"
3+
import LanguageDetector from "i18next-browser-languagedetector"
4+
import Backend from "i18next-http-backend"
5+
import { StrictMode, startTransition } from "react"
6+
import { hydrateRoot } from "react-dom/client"
7+
import { I18nextProvider, initReactI18next } from "react-i18next"
8+
import { getInitialNamespaces } from "remix-i18next/client"
9+
import i18n from "~/localization/i18n"
10+
import { resources } from "./localization/resource"
1111

1212
async function hydrate() {
13-
// eslint-disable-next-line import/no-named-as-default-member
14-
await i18next
15-
.use(initReactI18next) // Tell i18next to use the react-i18next plugin
16-
.use(LanguageDetector) // Setup a client-side language detector
17-
.use(Backend) // Setup your backend
18-
.init({
19-
...i18n, // spread the configuration
20-
// This function detects the namespaces your routes rendered while SSR use
21-
ns: getInitialNamespaces(),
22-
backend: { loadPath: "/locales/{{lng}}/{{ns}}.json" },
23-
resources,
24-
detection: {
25-
// Here only enable htmlTag detection, we'll detect the language only
26-
// server-side with remix-i18next, by using the `<html lang>` attribute
27-
// we can communicate to the client the language detected server-side
28-
order: ["htmlTag"],
29-
// Because we only use htmlTag, there's no reason to cache the language
30-
// on the browser, so we disable it
31-
caches: [],
32-
},
33-
});
13+
// eslint-disable-next-line import/no-named-as-default-member
14+
await i18next
15+
.use(initReactI18next) // Tell i18next to use the react-i18next plugin
16+
.use(LanguageDetector) // Setup a client-side language detector
17+
.use(Backend) // Setup your backend
18+
.init({
19+
...i18n, // spread the configuration
20+
// This function detects the namespaces your routes rendered while SSR use
21+
ns: getInitialNamespaces(),
22+
backend: { loadPath: "/locales/{{lng}}/{{ns}}.json" },
23+
resources,
24+
detection: {
25+
// Here only enable htmlTag detection, we'll detect the language only
26+
// server-side with remix-i18next, by using the `<html lang>` attribute
27+
// we can communicate to the client the language detected server-side
28+
order: ["htmlTag"],
29+
// Because we only use htmlTag, there's no reason to cache the language
30+
// on the browser, so we disable it
31+
caches: [],
32+
},
33+
})
3434

35-
startTransition(() => {
36-
hydrateRoot(
37-
document,
38-
<I18nextProvider i18n={i18next}>
39-
<StrictMode>
40-
<RemixBrowser />
41-
</StrictMode>
42-
</I18nextProvider>
43-
);
44-
});
35+
startTransition(() => {
36+
hydrateRoot(
37+
document,
38+
<I18nextProvider i18n={i18next}>
39+
<StrictMode>
40+
<RemixBrowser />
41+
</StrictMode>
42+
</I18nextProvider>
43+
)
44+
})
4545
}
4646

4747
if (window.requestIdleCallback) {
48-
window.requestIdleCallback(hydrate);
48+
window.requestIdleCallback(hydrate)
4949
} else {
50-
// Safari doesn't support requestIdleCallback
51-
// https://caniuse.com/requestidlecallback
52-
window.setTimeout(hydrate, 1);
50+
// Safari doesn't support requestIdleCallback
51+
// https://caniuse.com/requestidlecallback
52+
window.setTimeout(hydrate, 1)
5353
}

0 commit comments

Comments
 (0)