You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/cli/src/lingui-compile.ts
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ export type CliCompileOptions = {
22
22
watch?: boolean
23
23
namespace?: string
24
24
workersOptions: WorkersOptions
25
-
lintDirective?: string
25
+
outputPrefix?: string
26
26
}
27
27
28
28
exportasyncfunctioncommand(
@@ -114,7 +114,7 @@ type CliArgs = {
114
114
config?: string
115
115
debounce?: number
116
116
workers?: number
117
-
lintDirective?: string
117
+
outputPrefix?: string
118
118
}
119
119
120
120
if(require.main===module){
@@ -138,8 +138,8 @@ if (require.main === module) {
138
138
"Debounces compilation for given amount of milliseconds"
139
139
)
140
140
.option(
141
-
"--lint-directive <directive>",
142
-
"Add custom lint directive to the compiled files. Useful for enforcing linting rules on generated files. Defaults to 'eslint-disable'"
141
+
"--output-prefix <prefix>",
142
+
"Add a custom string to the beginning of compiled files (header/prefix). Useful for tools like linters or coverage directives. Defaults to '/*eslint-disable*/'"
143
143
)
144
144
.on("--help",function(){
145
145
console.log("\n Examples:\n")
@@ -171,7 +171,7 @@ if (require.main === module) {
Copy file name to clipboardExpand all lines: website/docs/ref/cli.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -172,7 +172,7 @@ lingui compile
172
172
[--namespace <namespace>]
173
173
[--watch [--debounce <delay>]]
174
174
[--workers]
175
-
[--lint-directive <directive>]
175
+
[--output-prefix <prefix>]
176
176
```
177
177
178
178
Once you have all the catalogs ready and translated, you can use this command to compile all the catalogs into minified JS/TS files. It compiles message catalogs located in the [`path`](/ref/conf#catalogs) directory and generates minified JavaScript files. The resulting file is a string that is parsed into a plain JS object using `JSON.parse`.
@@ -251,28 +251,31 @@ Worker threads can significantly improve performance on large projects. However,
251
251
252
252
A larger worker pool also increases memory usage. Adjust this value for your project to achieve the best performance.
Customize the lint directive added to the header of compiled message catalogs. By default, Lingui adds `/*eslint-disable*/` to prevent linters from reporting issues in generated files.
256
+
Adds a custom string to the beginning of compiled message catalogs (a header/prefix). By default, Lingui adds `/*eslint-disable*/` to prevent linters from reporting issues in generated files.
257
257
258
-
This option is useful when using different linters or tools that require specific directive formats.
258
+
Use this option forother tools that rely on header directives (e.g., different linters, coverage tools, or formatters). Provide the full prefix exactly as it should appearin the output.
259
259
260
-
**Default value:**`eslint-disable`
260
+
**Default value:**`/*eslint-disable*/`
261
261
262
262
**Examples:**
263
263
264
264
```shell
265
265
# For Oxlint
266
-
lingui compile --lint-directive "oxlint-disable"
266
+
lingui compile --output-prefix "/*oxlint-disable*/"
267
267
268
268
# For Biome
269
-
lingui compile --lint-directive "biome-ignore lint: auto-generated"
269
+
lingui compile --output-prefix "/*biome-ignore lint: auto-generated*/"
0 commit comments