Skip to content

Commit 14db188

Browse files
committed
formating
1 parent a965f29 commit 14db188

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

.prettierrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"printWidth": 120,
2+
"printWidth": 200,
33
"tabWidth": 2,
44
"useTabs": false,
55
"semi": true,

src/node/cli.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
#!/usr/bin/env node
2-
3-
/* eslint no-console: 0 */
4-
52
import pangu from '.';
63

74
const usage = `
@@ -44,7 +41,7 @@ function printSpacingFile(path: string | undefined) {
4441
if (args.length === 0) {
4542
console.log(usage);
4643
} else {
47-
switch (args[0]) {
44+
switch (args[0]) {
4845
case '-h':
4946
case '--help':
5047
console.log(usage);

src/node/index.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
import { readFile } from "node:fs/promises";
2-
import { readFileSync } from "node:fs";
3-
import { Pangu } from "../shared";
1+
import { readFile } from 'node:fs/promises';
2+
import { readFileSync } from 'node:fs';
3+
4+
import { Pangu } from '../shared';
45

56
export class NodePangu extends Pangu {
67
async spacingFile(path: string) {
7-
const data = await readFile(path, "utf8");
8+
const data = await readFile(path, 'utf8');
89
return this.spacingText(data);
910
}
1011

1112
spacingFileSync(path: string) {
12-
return this.spacingText(readFileSync(path, "utf8"));
13+
return this.spacingText(readFileSync(path, 'utf8'));
1314
}
1415
}
1516

src/shared/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export class Pangu {
8989

9090
public spacingText(text: string) {
9191
if (typeof text !== 'string') {
92-
console.warn(`spacingText(text) only accepts string but got ${typeof text}`);
92+
console.warn(`spacingText(text) only accepts string but got ${typeof text}`);
9393
return text;
9494
}
9595

@@ -142,7 +142,7 @@ export class Pangu {
142142

143143
newText = newText.replace(CJK_SINGLE_QUOTE_BUT_POSSESSIVE, '$1 $2');
144144
newText = newText.replace(SINGLE_QUOTE_CJK, '$1 $2');
145-
newText = newText.replace(FIX_POSSESSIVE_SINGLE_QUOTE, "$1's");
145+
newText = newText.replace(FIX_POSSESSIVE_SINGLE_QUOTE, "$1's");
146146

147147
newText = newText.replace(HASH_ANS_CJK_HASH, '$1 $2$3$4 $5');
148148
newText = newText.replace(CJK_HASH, '$1 $2');

0 commit comments

Comments
 (0)