File tree Expand file tree Collapse file tree 6 files changed +5445
-869
lines changed Expand file tree Collapse file tree 6 files changed +5445
-869
lines changed Original file line number Diff line number Diff line change 1
- # <img src =" https://raw.githubusercontent.com/Jinjiang/zhlint/master/logo.svg " style =" vertical-align : middle ;" > eslint-plugin-zhlint
1
+ # <img src =" https://raw.githubusercontent.com/Jinjiang/zhlint/master/docs/ logo.svg " style =" vertical-align : middle ;" > eslint-plugin-zhlint
2
2
3
3
Linting Chinese typographies in JavaScript/TypeScript with [ zhlint] ( https://github.com/Jinjiang/zhlint ) .
4
4
@@ -49,7 +49,10 @@ or with options:
49
49
"lintComments" : true ,
50
50
"lintStringLiterals" : true ,
51
51
"zhlint" : {
52
- "rules" : [" space-full-width-content" , " space-punctuation" ]
52
+ "rules" : {
53
+ "fullWidthPunctuation" : " ,。:;?!“”‘’()" ,
54
+ "unifiedPunctuation" : " traditional"
55
+ }
53
56
}
54
57
}
55
58
]
Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ function tryRunZhlint(
24
24
} ,
25
25
messageId : "zhlint" ,
26
26
data : {
27
- zhlintRuleName : validation . name ,
28
27
zhlintMsg : validation . message ,
29
28
} ,
30
29
fix ( fixer ) {
@@ -65,15 +64,23 @@ module.exports = {
65
64
} ,
66
65
] ,
67
66
messages : {
68
- zhlint : "[zhlint/{{ zhlintRuleName }} ] {{ zhlintMsg }}" ,
67
+ zhlint : "[zhlint] {{ zhlintMsg }}" ,
69
68
} ,
70
69
} ,
71
70
create ( context ) {
72
71
const sourceCode = context . getSourceCode ( ) ;
73
- const { zhlint : zhlintOptions , ...ruleOptions } = {
72
+ let { zhlint : zhlintOptions , ...ruleOptions } = {
74
73
lintComments : true ,
75
74
lintStringLiterals : true ,
76
75
...context . options [ 0 ] ,
76
+ zhlint : {
77
+ rules : {
78
+ preset : "default" ,
79
+ trimSpace : false , // disabled by default because of false positives
80
+ ...context . options [ 0 ] ?. zhlint ?. rules ,
81
+ } ,
82
+ ...context . options [ 0 ] ?. zhlint ,
83
+ } ,
77
84
} ;
78
85
return {
79
86
Program ( ) {
You can’t perform that action at this time.
0 commit comments