Skip to content

Commit 809cbc9

Browse files
committed
🎨 chore: reformat code with prettier
1 parent fee27bc commit 809cbc9

File tree

18 files changed

+29
-64
lines changed

18 files changed

+29
-64
lines changed

jest.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ import { Config } from '@umijs/test';
44
const config: Config.InitialOptions = {
55
...baseConfig,
66
projects: ['<rootDir>/packages/*/jest.config.ts'],
7-
collectCoverageFrom: [
8-
'<rootDir>/packages/*/src/**/*.ts',
9-
'<rootDir>/packages/*/src/**/*.tsx',
10-
],
7+
collectCoverageFrom: ['<rootDir>/packages/*/src/**/*.ts'],
118
coverageDirectory: '<rootDir>/coverage/',
129
};
1310

packages/changelog/.fatherrc.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import config from '../../.fatherrc'
1+
import config from '../../.fatherrc';
22

3-
export default config
3+
export default config;

packages/changelog/src/handleWriterOpts.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ export default (customConfig: CustomConfig): Options => ({
2323
mainTemplate: template,
2424
headerPartial: header,
2525
// 替换 commit.hbs 模板中的 gitUserInfo
26-
commitPartial: commit.replace(
27-
/{{gitUserInfo}}/g,
28-
customConfig.showAuthor ? author : '',
29-
),
26+
commitPartial: commit.replace(/{{gitUserInfo}}/g, customConfig.showAuthor ? author : ''),
3027
footerPartial: footer,
3128
});

packages/changelog/src/transformer/index.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,12 @@ import type { CommitTypes } from '@gitmoji/commit-types';
77

88
import types from '@gitmoji/commit-types';
99

10-
export default (customConfig: CustomConfig) => (
11-
commit: Commit,
12-
context: Context,
13-
) => {
10+
export default (customConfig: CustomConfig) => (commit: Commit, context: Context) => {
1411
let discard = true;
1512
const issues = [];
1613

1714
commit.notes.forEach((note) => {
18-
note.title = `${
19-
customConfig?.withEmoji === false ? '' : '💥 '
20-
}BREAKING CHANGES`;
15+
note.title = `${customConfig?.withEmoji === false ? '' : '💥 '}BREAKING CHANGES`;
2116

2217
discard = false;
2318
});
@@ -46,10 +41,7 @@ export default (customConfig: CustomConfig) => (
4641
}
4742

4843
if (customConfig.scopeDisplayName) {
49-
commit.scope = scopeMapDisplayName(
50-
commit.scope,
51-
customConfig.scopeDisplayName,
52-
);
44+
commit.scope = scopeMapDisplayName(commit.scope, customConfig.scopeDisplayName);
5345
}
5446

5547
if (typeof commit.hash === 'string') {

packages/changelog/test/index.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ describe('Gitmoji Commit Message Preset', () => {
1414
expect(log).toContain('amazing new module');
1515
expect(log).toContain('**compile**: avoid a bug');
1616
// expect(log).toContain('make it faster');
17-
expect(log).toContain(
18-
`, closes [#1](${repoURL}/issues/1) [#2](${repoURL}/issues/2)`,
19-
);
17+
expect(log).toContain(`, closes [#1](${repoURL}/issues/1) [#2](${repoURL}/issues/2)`);
2018
expect(log).toContain('New build system.');
2119
expect(log).toContain('Not backward compatible.');
2220
expect(log).toContain('**compile**: The Change is huge.');

packages/changelog/test/utils.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ import betterThanBefore from 'better-than-before';
66
import shell from 'shelljs';
77
import gitmojiChangelogConfig from '../src';
88

9-
export const conventionalChangelog = (
10-
done,
11-
testFn: (changelog: string) => void,
12-
) => {
9+
export const conventionalChangelog = (done, testFn: (changelog: string) => void) => {
1310
conventionalChangelogCore({
1411
config: gitmojiChangelogConfig as Options.Config,
1512
})
@@ -50,10 +47,7 @@ setups([
5047
':sparkles: feat: amazing new module',
5148
'BREAKING CHANGE: Not backward compatible.',
5249
]);
53-
gitDummyCommit([
54-
':bug: fix(compile): avoid a bug',
55-
'BREAKING CHANGE: The Change is huge.',
56-
]);
50+
gitDummyCommit([':bug: fix(compile): avoid a bug', 'BREAKING CHANGE: The Change is huge.']);
5751
gitDummyCommit(':zap: perf(ngOptions): make it faster');
5852
gitDummyCommit(':rewind: revert(ngOptions): bad commit');
5953
gitDummyCommit([':bug: fix(*): oops', ' closes #1, #2']);

packages/commit-types/.fatherrc.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import config from '../../.fatherrc'
1+
import config from '../../.fatherrc';
22

3-
export default config
3+
export default config;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import config from '../../.fatherrc'
1+
import config from '../../.fatherrc';
22

3-
export default config
3+
export default config;

packages/commitlint-config/test/index.test.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,13 @@ describe('valid commit', () => {
7171
expect(valid).toBeTruthy();
7272
});
7373
it('$ :lipstick: style(typography): 优化信息块和内联代码样式 -> passed', async () => {
74-
const { valid } = await lint(
75-
':lipstick: style(typography): 优化信息块和内联代码样式',
76-
);
74+
const { valid } = await lint(':lipstick: style(typography): 优化信息块和内联代码样式');
7775

7876
expect(valid).toBeTruthy();
7977
});
8078

8179
it('$ 💄 style(typography): 优化信息块和内联代码样式 -> passed', async () => {
82-
const { valid } = await lint(
83-
'💄 style(typography): 优化信息块和内联代码样式',
84-
);
80+
const { valid } = await lint('💄 style(typography): 优化信息块和内联代码样式');
8581

8682
expect(valid).toBeTruthy();
8783
});
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { default as commitlint } from '@commitlint/lint';
22
import config from '../src';
33

4-
export const lint = (input) =>
5-
commitlint(input, config.rules, config.parserPreset);
4+
export const lint = (input) => commitlint(input, config.rules, config.parserPreset);

0 commit comments

Comments
 (0)