@@ -66,7 +66,7 @@ for await (const dir of directories) {
66
66
Array . isArray ( enablers ) && enablers . length > 0
67
67
? [
68
68
...parseFragment (
69
- "This plugin is enabled when there's a match in `dependencies` or `devDependencies` in `package.json`:"
69
+ "This plugin is enabled automatically when there's a match in `dependencies` or `devDependencies` in `package.json`:"
70
70
) ,
71
71
u (
72
72
'list' ,
@@ -77,19 +77,19 @@ for await (const dir of directories) {
77
77
]
78
78
: typeof enablers === 'string'
79
79
? parseFragment ( enablers )
80
- : [ u ( 'paragraph' , [ u ( 'text' , 'N/A ' ) ] ) ] ;
80
+ : [ u ( 'paragraph' , [ u ( 'text' , 'This plugin is always enabled. ' ) ] ) ] ;
81
81
82
82
const notes = note ? [ u ( 'heading' , { depth : 2 } , [ u ( 'text' , 'Note' ) ] ) , ...parseFragment ( note ) ] : [ ] ;
83
83
84
84
const defaultConfig = hasDefaultConfig
85
85
? [
86
86
u ( 'heading' , { depth : 2 } , [ u ( 'text' , 'Default configuration' ) ] ) ,
87
- ...parseFragment ( 'This configuration is added automatically if the plugin is enabled :' ) ,
87
+ ...parseFragment ( 'If enabled, this configuration is added automatically:' ) ,
88
88
u ( 'code' , {
89
- lang : 'json title="knip.json" ' , // TODO How to set attributes/properties/props properly?
89
+ lang : 'json' , // TODO How to set attributes/properties/props properly?
90
90
value : JSON . stringify ( { [ pluginName ] : defaults } , null , 2 ) ,
91
91
} ) ,
92
- ...parseFragment ( 'Your custom `config` or `entry` options override default values, they are not merged.' ) ,
92
+ ...parseFragment ( 'Custom `config` or `entry` options override default values, they are not merged.' ) ,
93
93
...parseFragment (
94
94
'See [Plugins](../../explanations/plugins) for more details about plugins and their `entry` and `config` options.'
95
95
) ,
@@ -99,16 +99,21 @@ for await (const dir of directories) {
99
99
const argsText = args
100
100
? [
101
101
...parseFragment (
102
- `## Shell commands\n\nThis plugin adds argument parsing for the <code>${ args . binaries ? args . binaries . join ( ' and ' ) : pluginName } </code> binary. Configuration:`
102
+ `## Shell commands\n\nThis plugin adds argument parsing for the <code>${ args . binaries ? args . binaries . join ( ' and ' ) : pluginName } </code>
103
+ ${ args . binaries && args . binaries . length > 1 ? 'binaries' : 'binary' } . Configuration:`
103
104
) ,
104
105
...parseFragment (
105
106
`\`\`\`\n${ Object . entries ( args )
106
107
. filter ( ( [ key ] ) => key !== 'binaries' )
107
108
. map (
108
- ( [ key , value ] ) => `${ key } : ${ typeof value === 'function' ? value . toString ( ) : JSON . stringify ( value ) } `
109
+ ( [ key , value ] ) =>
110
+ `${ key } : ${ typeof value === 'function' ? value . toString ( ) : JSON . stringify ( value ) . replace ( / ( [ , : ] ) / g, '$1 ' ) } `
109
111
)
110
112
. join ( '\n' ) } \n\`\`\``
111
113
) ,
114
+ ...parseFragment (
115
+ 'The configuration was generated from source code. Also see [Script Parser](../../features/script-parser).'
116
+ ) ,
112
117
]
113
118
: [ ] ;
114
119
0 commit comments