Skip to content

Commit ee1ced8

Browse files
committedMar 27, 2023
chore: fix lint issues
1 parent cc99946 commit ee1ced8

File tree

6 files changed

+19
-8
lines changed

6 files changed

+19
-8
lines changed
 

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"build": "pnpm unbuild",
2222
"dev": "pnpm unbuild test/fixture",
2323
"lint": "eslint --ext .ts,.js . && prettier -c src test",
24+
"lint:fix": "eslint --fix --ext .ts,.js . && prettier -w src test",
2425
"prepack": "pnpm unbuild",
2526
"release": "vitest run && changelogen --release && git push --follow-tags && npm publish",
2627
"stub": "pnpm unbuild --stub",

‎src/builder/plugins/esbuild.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const defaultLoaders: { [ext: string]: Loader } = {
1010
".ts": "ts",
1111
".js": "js",
1212
".tsx": "tsx",
13-
".jsx": "jsx"
13+
".jsx": "jsx",
1414
};
1515

1616
export interface Options {

‎src/builder/rollup.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,11 @@ export function getRollupOptions(ctx: BuildContext): RollupOptions {
270270
[ctx.pkg.name!]: ctx.options.rootDir,
271271
...ctx.options.alias,
272272
...(Array.isArray(ctx.options.rollup.alias.entries)
273-
? Object.fromEntries(ctx.options.rollup.alias.entries.map(entry => {
274-
return [entry.find, entry.replacement]
275-
}))
273+
? Object.fromEntries(
274+
ctx.options.rollup.alias.entries.map((entry) => {
275+
return [entry.find, entry.replacement];
276+
})
277+
)
276278
: ctx.options.rollup.alias.entries),
277279
},
278280
}),

‎src/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export interface BuildOptions {
6767
declaration?: boolean;
6868
outDir: string;
6969
stub: boolean;
70-
externals: (string|RegExp)[];
70+
externals: (string | RegExp)[];
7171
dependencies: string[];
7272
peerDependencies: string[];
7373
devDependencies: string[];

‎src/utils.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ export function extractExportFilenames(
163163
);
164164
}
165165

166-
export function arrayIncludes (arr: (string|RegExp)[], searchElement: string) {
167-
return arr.some(entry => entry instanceof RegExp ? entry.test(searchElement) : entry === searchElement);
166+
export function arrayIncludes(arr: (string | RegExp)[], searchElement: string) {
167+
return arr.some((entry) =>
168+
entry instanceof RegExp
169+
? entry.test(searchElement)
170+
: entry === searchElement
171+
);
168172
}

‎test/utils.test.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { describe, it, expect } from "vitest";
2-
import { arrayIncludes, extractExportFilenames, inferExportType } from "../src/utils";
2+
import {
3+
arrayIncludes,
4+
extractExportFilenames,
5+
inferExportType,
6+
} from "../src/utils";
37

48
describe("inferExportType", () => {
59
it("infers export type by condition", () => {

0 commit comments

Comments
 (0)
Please sign in to comment.