File tree Expand file tree Collapse file tree 4 files changed +10
-12
lines changed Expand file tree Collapse file tree 4 files changed +10
-12
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "printWidth" : 120 ,
2
+ "printWidth" : 200 ,
3
3
"tabWidth" : 2 ,
4
4
"useTabs" : false ,
5
5
"semi" : true ,
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env node
2
-
3
- /* eslint no-console: 0 */
4
-
5
2
import pangu from '.' ;
6
3
7
4
const usage = `
@@ -44,7 +41,7 @@ function printSpacingFile(path: string | undefined) {
44
41
if ( args . length === 0 ) {
45
42
console . log ( usage ) ;
46
43
} else {
47
- switch ( args [ 0 ] ) {
44
+ switch ( args [ 0 ] ) {
48
45
case '-h' :
49
46
case '--help' :
50
47
console . log ( usage ) ;
Original file line number Diff line number Diff line change 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' ;
4
5
5
6
export class NodePangu extends Pangu {
6
7
async spacingFile ( path : string ) {
7
- const data = await readFile ( path , " utf8" ) ;
8
+ const data = await readFile ( path , ' utf8' ) ;
8
9
return this . spacingText ( data ) ;
9
10
}
10
11
11
12
spacingFileSync ( path : string ) {
12
- return this . spacingText ( readFileSync ( path , " utf8" ) ) ;
13
+ return this . spacingText ( readFileSync ( path , ' utf8' ) ) ;
13
14
}
14
15
}
15
16
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ export class Pangu {
89
89
90
90
public spacingText ( text : string ) {
91
91
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 } ` ) ;
93
93
return text ;
94
94
}
95
95
@@ -142,7 +142,7 @@ export class Pangu {
142
142
143
143
newText = newText . replace ( CJK_SINGLE_QUOTE_BUT_POSSESSIVE , '$1 $2' ) ;
144
144
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" ) ;
146
146
147
147
newText = newText . replace ( HASH_ANS_CJK_HASH , '$1 $2$3$4 $5' ) ;
148
148
newText = newText . replace ( CJK_HASH , '$1 $2' ) ;
You can’t perform that action at this time.
0 commit comments