Skip to content

Commit

Permalink
style: use prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Sep 20, 2024
1 parent bb8c207 commit 710765e
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 151 deletions.
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
*.md
**/*.gen.ts
node_modules
pnpm-lock.yaml
**/.docs
**/dist/**
49 changes: 0 additions & 49 deletions biome.json

This file was deleted.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
"dev": "pnpm nitro dev playground",
"dev:build": "pnpm nitro build playground",
"dev:start": "node playground/.output/server/index.mjs",
"lint": "eslint --cache . && biome check .",
"lint:fix": "eslint --cache --fix . && biome check . --write",
"lint": "eslint --cache . && prettier -c .",
"lint:fix": "eslint --cache --fix . && prettier -w .",
"nitro": "NODE_OPTIONS=\"--enable-source-maps\" jiti ./src/cli/index.ts",
"prepack": "pnpm build",
"gen-mirror": "pnpm jiti scripts/gen-mirror.ts",
Expand Down Expand Up @@ -172,7 +172,6 @@
"devDependencies": {
"@azure/functions": "^3.5.1",
"@azure/static-web-apps-cli": "^1.1.10",
"@biomejs/biome": "^1.9.2",
"@cloudflare/workers-types": "^4.20240919.0",
"@deno/types": "^0.0.1",
"@scalar/api-reference": "^1.25.13",
Expand Down
91 changes: 0 additions & 91 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions src/core/config/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ async function _loadUserConfig(
"nitropack/" + "presets"
)) as typeof import("nitropack/presets");

const loadedConfig = await (opts.watch
? watchConfig<NitroConfig & { _meta?: NitroPresetMeta }>
: loadConfig<NitroConfig & { _meta?: NitroPresetMeta }>)({
const loadedConfig = await (
opts.watch
? watchConfig<NitroConfig & { _meta?: NitroPresetMeta }>
: loadConfig<NitroConfig & { _meta?: NitroPresetMeta }>
)({
name: "nitro",
cwd: configOverrides.rootDir,
dotenv: configOverrides.dev,
Expand Down
1 change: 0 additions & 1 deletion src/core/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const suffixRegex =
/\.(connect|delete|get|head|options|patch|post|put|trace)(\.(dev|prod|prerender))?$/;

// prettier-ignore
// biome-ignore format: keep inline for better readability
type MatchedMethodSuffix = "connect" | "delete" | "get" | "head" | "options" | "patch" | "post" | "put" | "trace";
type MatchedEnvSuffix = "dev" | "prod" | "prerender";

Expand Down
2 changes: 0 additions & 2 deletions src/rollup/plugins/public-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,8 @@ export function readAsset (id) {
);

// prettier-ignore
// biome-ignore format: -
type _serveStaticAsKey = Exclude<typeof nitro.options.serveStatic, boolean> | "true" | "false";
// prettier-ignore
// biome-ignore format: -
const handlerName = readAssetHandler[nitro.options.serveStatic as _serveStaticAsKey] || "null";
const readAssetImport = `#nitro-internal-virtual/public-assets-${handlerName}`;

Expand Down
1 change: 0 additions & 1 deletion src/rollup/plugins/replace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export function replace(options: RollupReplaceOptions): Plugin {
renderChunk(code, chunk, options) {
if (!NO_REPLACE_RE.test(code)) {
// prettier-ignore
// biome-ignore format: keep ts-ignore working
// @ts-ignore
return (_plugin.renderChunk as () => any).call(this, code, chunk, options );
}
Expand Down
1 change: 0 additions & 1 deletion test/fixture/routes/assets/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export default eventHandler(async (event) => {
meta: await serverAssets.getMeta(key),
data: await serverAssets.getItem(key).then((r) =>
// prettier-ignore
// biome-ignore format: eslint compatibility
typeof r === "string" ? r.slice(0, 32) : (isPureObject(r) ? r : `<data>`)
),
};
Expand Down

0 comments on commit 710765e

Please sign in to comment.