Skip to content

Commit 6e9ab06

Browse files
committed
style: remove semi
1 parent 9ce1c43 commit 6e9ab06

File tree

14 files changed

+106
-105
lines changed

14 files changed

+106
-105
lines changed

.prettierrc

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
11
{
22
"plugins": ["@trivago/prettier-plugin-sort-imports", "prettier-plugin-jsdoc"],
3+
"jsdocCapitalizeDescription": false,
4+
"jsdocSeparateReturnsFromParam": true,
5+
"jsdocSeparateTagGroups": true,
6+
"jsdocCommentLineStrategy": "multiline",
7+
"tsdoc": true,
38
"importOrder": [
49
"^vitest(/|$)",
5-
"^node:(.*)$",
10+
"^node:",
611
"<THIRD_PARTY_MODULES>",
7-
"^(?!.*/src(?:/|$)).*/__testutils__(?:/|$)",
8-
"^(?!.*/src(?:/|$)).*/__fixtures__(?:/|$)",
9-
"^(?!.*/src(?:/|$)).*/lib(?:/|$)",
10-
"^(?!.*/src(?:/|$)).*/types(?:/|$)",
11-
"^(?!.*/src(?:/|$)).*/errors(?:/|$)",
12-
"^(?!.*/src(?:/|$))../../../../../",
13-
"^(?!.*/src(?:/|$))../../../../",
14-
"^(?!.*/src(?:/|$))../../../",
15-
"^(?!.*/src(?:/|$))../../",
16-
"^(?!.*/src(?:/|$))../",
17-
"^(?!.*/src(?:/|$))./(.*/)+",
18-
"^(?!.*/src(?:/|$))./",
19-
"/src(?:/|$)"
12+
"^(?!.*/src(/|$)).*/__testutils__(/|$)",
13+
"^(?!.*/src(/|$)).*/__fixtures__(/|$)",
14+
"^(?!.*/src(/|$)).*/lib(/|$)",
15+
"^(?!.*/src(/|$)).*/types(/|$)",
16+
"^(?!.*/src(/|$)).*/errors(/|$)",
17+
"^(?!.*/src(/|$))../../../../../",
18+
"^(?!.*/src(/|$))../../../../",
19+
"^(?!.*/src(/|$))../../../",
20+
"^(?!.*/src(/|$))../../",
21+
"^(?!.*/src(/|$))../",
22+
"^(?!.*/src(/|$))./(.*/)+",
23+
"^(?!.*/src(/|$))./",
24+
"/src(/|$)"
2025
],
2126
"importOrderSeparation": true,
2227
"importOrderSortSpecifiers": true,
2328
"importOrderGroupNamespaceSpecifiers": true,
24-
"jsdocSeparateReturnsFromParam": true,
25-
"jsdocSeparateTagGroups": true,
26-
"jsdocCommentLineStrategy": "multiline",
27-
"tsdoc": true,
2829
"printWidth": 80,
2930
"useTabs": true,
30-
"semi": true,
31+
"semi": false,
3132
"singleQuote": false,
3233
"quoteProps": "as-needed",
3334
"jsxSingleQuote": false,

.size-limit.cjs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
const pkg = require("./package.json");
1+
const pkg = require("./package.json")
22

33
module.exports = [
44
...new Set([
55
pkg.main,
66
pkg.module,
77
...Object.values(pkg.exports).flatMap((exportValue) => {
88
if (typeof exportValue === "string") {
9-
return exportValue;
9+
return exportValue
1010
} else {
11-
return Object.values(exportValue);
11+
return Object.values(exportValue)
1212
}
1313
}),
1414
]),
1515
]
1616
.filter((path) => {
17-
return path && path !== "./package.json";
17+
return path && path !== "./package.json"
1818
})
1919
.map((path) => {
2020
return {
2121
path,
2222
modifyEsbuildConfig(config) {
23-
config.platform = "node";
23+
config.platform = "node"
2424

25-
return config;
25+
return config
2626
},
27-
};
28-
});
27+
}
28+
})

eslint.config.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import eslint from "@eslint/js";
2-
import prettier from "eslint-plugin-prettier/recommended";
3-
import tsdoc from "eslint-plugin-tsdoc";
4-
import tseslint from "typescript-eslint";
1+
import eslint from "@eslint/js"
2+
import prettier from "eslint-plugin-prettier/recommended"
3+
import tsdoc from "eslint-plugin-tsdoc"
4+
import tseslint from "typescript-eslint"
55

66
export default tseslint.config(
77
{
@@ -41,4 +41,4 @@ export default tseslint.config(
4141
"tsdoc/syntax": "warn",
4242
},
4343
},
44-
);
44+
)

package-lock.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"@types/fs-extra": "^11.0.4",
5757
"@vitest/coverage-v8": "^2.1.8",
5858
"eslint": "^9.16.0",
59+
"eslint-config-prettier": "^9.1.0",
5960
"eslint-plugin-prettier": "^5.2.1",
6061
"eslint-plugin-tsdoc": "^0.4.0",
6162
"prettier": "^3.4.1",

src/index.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
import type { Plugin } from "vite";
1+
import type { Plugin } from "vite"
22

3-
import { readPackageJSON } from "./lib/readPackageJSON";
3+
import { readPackageJSON } from "./lib/readPackageJSON"
44

5-
import type { Options } from "./types";
5+
import type { Options } from "./types"
66

7-
import { extendConfigPlugin, moveTypeDeclarationsPlugin } from "./plugins";
7+
import { extendConfigPlugin, moveTypeDeclarationsPlugin } from "./plugins"
88

99
const DEFAULT_OPTIONS = {
1010
dts: true,
1111
internalDependencies: [],
1212
srcDir: "src",
13-
};
13+
}
1414

1515
const sdkPlugin = (rawOptions?: Partial<Options>): (Plugin | null)[] => {
1616
const options: Options = {
1717
...DEFAULT_OPTIONS,
1818
packageJSON: rawOptions?.packageJSON || readPackageJSON(),
1919
...rawOptions,
20-
};
20+
}
2121

22-
return [extendConfigPlugin(options), moveTypeDeclarationsPlugin(options)];
23-
};
22+
return [extendConfigPlugin(options), moveTypeDeclarationsPlugin(options)]
23+
}
2424

25-
export default sdkPlugin;
26-
export { Options };
25+
export default sdkPlugin
26+
export { Options }

src/lib/builtins.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
** Core logic from https://github.com/sindresorhus/builtin-modules
33
** Many thanks to @sindresorhus
44
*/
5-
import Module from "node:module";
5+
import Module from "node:module"
66

7-
const ignoreList = ["sys"];
7+
const ignoreList = ["sys"]
88

99
export const builtins = Module.builtinModules
1010
.filter(
1111
(x) =>
1212
!/^_|^(internal|v8|node-inspect)\/|\//.test(x) && !ignoreList.includes(x),
1313
)
14-
.sort();
14+
.sort()

src/lib/readPackageJSON.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
import * as fs from "node:fs";
2-
import * as path from "node:path";
1+
import * as fs from "node:fs"
2+
import * as path from "node:path"
33

4-
import type { PackageJSON } from "../types";
4+
import type { PackageJSON } from "../types"
55

66
export const readPackageJSON = (rootDir = process.cwd()): PackageJSON => {
77
try {
8-
const blob = fs.readFileSync(path.resolve(rootDir, "package.json"), "utf8");
8+
const blob = fs.readFileSync(path.resolve(rootDir, "package.json"), "utf8")
99

10-
return JSON.parse(blob);
10+
return JSON.parse(blob)
1111
} catch {
1212
if (rootDir === "/") {
1313
throw new Error(
1414
`Could not locate \`package.json\` in \`${process.cwd()}\` or its parent directories.`,
15-
);
15+
)
1616
}
1717

18-
return readPackageJSON(path.resolve(rootDir, ".."));
18+
return readPackageJSON(path.resolve(rootDir, ".."))
1919
}
20-
};
20+
}

src/plugins/extendConfig.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import * as path from "node:path";
1+
import * as path from "node:path"
22

3-
import typescript from "@rollup/plugin-typescript";
4-
import { defuFn } from "defu";
5-
import renameNodeModules from "rollup-plugin-rename-node-modules";
6-
import type { Plugin, UserConfig } from "vite";
7-
import { defineConfig } from "vite";
3+
import typescript from "@rollup/plugin-typescript"
4+
import { defuFn } from "defu"
5+
import renameNodeModules from "rollup-plugin-rename-node-modules"
6+
import type { Plugin, UserConfig } from "vite"
7+
import { defineConfig } from "vite"
88

9-
import { builtins } from "../lib/builtins";
9+
import { builtins } from "../lib/builtins"
1010

11-
import type { Options } from "../types";
11+
import type { Options } from "../types"
1212

1313
export const extendConfigPlugin = (options: Options): Plugin => {
1414
const getDefaultConfig = (userConfig: UserConfig) =>
@@ -20,15 +20,15 @@ export const extendConfigPlugin = (options: Options): Plugin => {
2020
fileName: (format) => {
2121
switch (format) {
2222
case "es": {
23-
return "[name].js";
23+
return "[name].js"
2424
}
2525

2626
case "cjs": {
27-
return "[name].cjs";
27+
return "[name].cjs"
2828
}
2929
}
3030

31-
throw new Error(`Unsupported format: ${format}`);
31+
throw new Error(`Unsupported format: ${format}`)
3232
},
3333
},
3434
rollupOptions: {
@@ -69,18 +69,18 @@ export const extendConfigPlugin = (options: Options): Plugin => {
6969
minify: false,
7070
sourcemap: true,
7171
},
72-
});
72+
})
7373

7474
return {
7575
name: "sdk:extend-config",
7676
config: (userConfig, env) => {
7777
// Disable config extension in test otherwise coverage runs twice because of Vitest's watcher, see:
7878
// https://github.com/vitest-dev/vitest/blob/main/packages/vitest/src/node/core.ts#L382-L426
7979
if (env.mode === "test") {
80-
return;
80+
return
8181
}
8282

83-
return defuFn(userConfig, getDefaultConfig(userConfig));
83+
return defuFn(userConfig, getDefaultConfig(userConfig))
8484
},
85-
};
86-
};
85+
}
86+
}

src/plugins/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export { extendConfigPlugin } from "./extendConfig";
2-
export { moveTypeDeclarationsPlugin } from "./moveTypeDeclarations";
1+
export { extendConfigPlugin } from "./extendConfig"
2+
export { moveTypeDeclarationsPlugin } from "./moveTypeDeclarations"

0 commit comments

Comments
 (0)