Skip to content

Commit

Permalink
chore: update biome settings
Browse files Browse the repository at this point in the history
  • Loading branch information
iorate committed Jun 15, 2024
1 parent e427bdc commit 1367ca2
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: pnpm install

- name: Check
run: pnpm check
run: pnpm check-ci

- name: Test
run: pnpm test
Expand Down
3 changes: 0 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
},
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
Expand Down
18 changes: 15 additions & 3 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,22 @@
"linter": {
"rules": {
"correctness": {
"noUnusedImports": "warn",
"noUnusedVariables": "warn",
"useHookAtTopLevel": "warn"
"noUnusedImports": "error",
"noUnusedVariables": "error",
"useHookAtTopLevel": "error"
},
"nursery": {
"useImportExtensions": "error"
}
}
},
"css": {
"formatter": {
"enabled": true,
"indentStyle": "space"
},
"linter": {
"enabled": true
}
}
}
6 changes: 3 additions & 3 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ pre-commit:
parallel: true
commands:
biome:
glob: "*.{js,cjs,mjs,ts,cts,mts,jsx,tsx,json,jsonc}"
run: pnpm biome check --apply --no-errors-on-unmatched {staged_files}
glob: "*.{js,cjs,mjs,ts,cts,mts,jsx,tsx,json,jsonc,css}"
run: pnpm biome check --write --no-errors-on-unmatched {staged_files}
stage_fixed: true
prettier:
glob: "*.{css,yml,yaml,md,markdown}"
glob: "*.{yml,yaml,md,markdown}"
run: pnpm prettier --write {staged_files}
stage_fixed: true
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@
"scripts": {
"build": "tsx scripts/build.ts",
"check": "pnpm run /^check:/",
"check:biome": "biome check .",
"check:biome": "biome check",
"check:prettier": "prettier --check .",
"check:tsc": "tsc",
"check-ci": "pnpm run /^check-ci:/",
"check-ci:biome": "biome ci --reporter=github",
"check-ci:prettier": "prettier --check .",
"check-ci:tsc": "tsc",
"fix": "pnpm run /^fix:/",
"fix:biome": "biome check --apply .",
"fix:biome": "biome check --write",
"fix:prettier": "prettier --write .",
"generate-ruleset-parser": "lezer-generator src/scripts/ruleset/ruleset.grammar -o src/scripts/ruleset/parser.js --noTerms",
"generate-third-party-notices": "tsx scripts/generate-third-party-notices.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/options/from-now.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dayjs from "dayjs";
import dayjsRelativeTime from "dayjs/plugin/relativeTime";
import { useEffect, useState } from "react";
import "../dayjs-locales";
import "../dayjs-locales.ts";
import { translate } from "../locales.ts";

dayjs.extend(dayjsRelativeTime);
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/options/set-interval-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useState } from "react";
import { ControlLabel, LabelWrapper } from "../components/label.tsx";
import { Row, RowItem } from "../components/row.tsx";
import { useClassName } from "../components/utilities.ts";
import "../dayjs-locales";
import "../dayjs-locales.ts";
import { saveToLocalStorage } from "../local-storage.ts";
import { translate } from "../locales.ts";
import { useOptionsContext } from "./options-context.tsx";
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/options/sync-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
import { Text } from "../components/text.tsx";
import { TextArea } from "../components/textarea.tsx";
import { usePrevious } from "../components/utilities.ts";
import "../dayjs-locales";
import "../dayjs-locales.ts";
import { getWebsiteURL, translate } from "../locales.ts";
import { addMessageListeners, sendMessage } from "../messages.ts";
import { supportedClouds } from "../supported-clouds.ts";
Expand Down

0 comments on commit 1367ca2

Please sign in to comment.