Skip to content

Commit a7382e9

Browse files
committed
style: eslint 格式化
1 parent 5737bd5 commit a7382e9

File tree

5 files changed

+21
-9
lines changed

5 files changed

+21
-9
lines changed

eslint.config.js

+16
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@ export default antfu(
1818
singleline: { delimiter: 'semi', requireLast: false },
1919
multilineDetection: 'brackets',
2020
}],
21+
'style/brace-style': ['warn', '1tbs'],
22+
'style/padded-blocks': 'off',
23+
'no-console': 'off',
24+
'unused-imports/no-unused-vars': [
25+
'error',
26+
{
27+
vars: 'all',
28+
args: 'none',
29+
argsIgnorePattern: '^_',
30+
caughtErrors: 'all',
31+
caughtErrorsIgnorePattern: '^_',
32+
destructuredArrayIgnorePattern: '^_',
33+
varsIgnorePattern: '^_',
34+
ignoreRestSiblings: true,
35+
},
36+
],
2137
},
2238
},
2339
{

pnpm-workspace.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
packages:
2-
- '.'
3-
- 'playground'
2+
- .
3+
- playground

src/context.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,7 @@ function uniquePagesOptions(options: PagesJsonPage[], merge = true): PagesJsonPa
272272
const cached = store.get(opt.path) || {} as PagesJsonPage;
273273
if (merge) {
274274
store.set(opt.path, deepMerge(cached, opt));
275-
}
276-
else {
275+
} else {
277276
store.set(opt.path, opt);
278277
}
279278
}

src/page.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export interface DefinePageOptions extends Partial<PagesJsonPage> {
3636
tabbar?: DefineTabbarOptions;
3737
}
3838

39-
// eslint-disable-next-line unused-imports/no-unused-vars
4039
export function definePage(options: MaybePromiseCallable<DefinePageOptions>) {
4140
}
4241

@@ -125,8 +124,7 @@ export class Page {
125124
options: this.options,
126125
hasChanged,
127126
};
128-
}
129-
catch (err: any) {
127+
} catch (err: any) {
130128
const msg = `Read page options fail in ${absolutePath}\n${err.message}`;
131129
debug.error(msg);
132130
throw err;

src/utils/object.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ export function deepMerge<T extends Record<string, any> = any>(...objs: T[]): T
55
for (const [key, val] of Object.entries(obj)) {
66
if (isObject(val)) {
77
result[key] = deepMerge(result[key], val);
8-
}
9-
else {
8+
} else {
109
result[key] = val;
1110
}
1211
}

0 commit comments

Comments
 (0)