forked from oxc-project/oxc
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCargo.toml
341 lines (312 loc) · 10.9 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
[profile]
[profile.coverage]
codegen-units = 256 # Compile faster
debug-assertions = true # Make sure `debug_assert!`s pass
inherits = "release"
lto = "thin" # Faster compile time with thin LTO
opt-level = 2 # Compile faster
overflow-checks = true # Catch arithmetic overflow errors
[profile.dev]
debug = false
[profile.dev.package]
[profile.dev.package.insta]
opt-level = 3
[profile.dev.package.oxc_ast_macros]
opt-level = 1
[profile.dev.package.oxc_macros]
opt-level = 1
[profile.dev.package.similar]
opt-level = 3
[profile.dev-no-debug-assertions]
debug-assertions = false
inherits = "dev"
[profile.release]
codegen-units = 1
debug = false # Set to `true` for debug information
lto = "fat"
opt-level = 3
panic = "abort" # Let it crash and force ourselves to write safe Rust
strip = "symbols" # Set to `false` for debug information
[profile.release.package]
[profile.release.package.oxc_wasm]
opt-level = 'z'
[profile.release-with-debug]
debug = true # Include maximum amount of debug information
inherits = "release"
strip = false # Keep debug information in binary
[workspace]
resolver = "3"
members = ["apps/*", "crates/*", "napi/*", "tasks/*", "wasm/*"]
exclude = ["tasks/lint_rules", "tasks/e2e"]
[workspace.package]
authors = ["Boshen <[email protected]>", "Oxc contributors"]
categories = ["compilers", "development-tools", "web-programming"]
homepage = "https://oxc.rs"
keywords = ["JavaScript", "TypeScript", "linter", "minifier", "parser"]
license = "MIT"
repository = "https://github.com/oxc-project/oxc"
description = "A collection of JavaScript tools written in Rust."
edition = "2024"
# MSRV Policy N-2 (12 weeks) starting from v1.87.0
# Balance between the core contributors enjoying the latest version of rustc, while waiting for dependents to catch up.
rust-version = "1.85.0"
# <https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html>
[workspace.lints.rust]
absolute_paths_not_starting_with_crate = "warn"
non_ascii_idents = "warn"
unit-bindings = "warn"
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage)', 'cfg(coverage_nightly)'] }
tail_expr_drop_order = "warn"
unsafe_op_in_unsafe_fn = "warn"
unused_unsafe = "allow"
[workspace.lints.clippy]
all = { level = "warn", priority = -1 }
empty_docs = { level = "allow", priority = 1 } # From `Tsify`
# restriction
dbg_macro = "warn"
todo = "warn"
unimplemented = "warn"
print_stdout = "warn" # Must be opt-in
print_stderr = "warn" # Must be opt-in
allow_attributes = "warn"
# I like the explicitness of this rule as it removes confusion around `clone`.
# This increases readability, avoids `clone` mindlessly and heap allocating by accident.
clone_on_ref_ptr = "warn"
# These two are mutually exclusive, I like `mod.rs` files for better fuzzy searches on module entries.
self_named_module_files = "warn" # "-Wclippy::mod_module_files"
empty_drop = "warn"
empty_structs_with_brackets = "warn"
exit = "warn"
filetype_is_file = "warn"
get_unwrap = "warn"
rc_buffer = "warn"
rc_mutex = "warn"
rest_pat_in_fully_bound_structs = "warn"
unnecessary_safety_comment = "warn"
undocumented_unsafe_blocks = "allow" # FIXME
infinite_loop = "warn"
map_with_unused_argument_over_ranges = "warn"
unused_result_ok = "warn"
pathbuf_init_then_push = "warn"
# I want to write the best Rust code so pedantic is enabled.
# We should only disable rules globally if they are either false positives, chaotic, or does not make sense.
pedantic = { level = "warn", priority = -1 }
# Allowed rules
# pedantic
# All triggers are mostly ignored in our codebase, so this is ignored globally.
struct_excessive_bools = "allow"
too_many_lines = "allow"
# `#[must_use]` is creating too much noise for this codebase, it does not add much value
# except nagging the programmer to add a `#[must_use]` after clippy has been run.
# Having `#[must_use]` everywhere also hinders readability.
must_use_candidate = "allow"
# Too annoying, we import by name anyway.
wildcard_imports = "allow"
# used_underscore_binding= "allow"
doc_markdown = "allow"
# nursery
nursery = { level = "warn", priority = -1 }
# `const` functions do not make sense for our project because this is not a `const` library.
# This rule also confuses newcomers and forces them to add `const` blindlessly without any reason.
missing_const_for_fn = "allow"
option_if_let_else = "allow"
or_fun_call = "allow"
cognitive_complexity = "allow"
non_send_fields_in_send_ty = "allow"
use_self = "allow"
significant_drop_tightening = "allow"
branches_sharing_code = "allow"
fallible_impl_from = "allow"
useless_let_if_seq = "allow"
impl_trait_in_params = "allow"
significant_drop_in_scrutinee = "warn"
iter_on_single_items = "warn"
unused_peekable = "warn"
too_long_first_doc_paragraph = "warn"
suspicious_operation_groupings = "warn"
redundant_clone = "warn"
# cargo
cargo = { level = "warn", priority = -1 }
multiple_crate_versions = "allow"
cargo_common_metadata = "allow" # FIXME
doc_lazy_continuation = "allow" # FIXME
[workspace.dependencies]
# publish = true
oxc = { version = "0.52.0", path = "crates/oxc" }
oxc_allocator = { version = "0.52.0", path = "crates/oxc_allocator" }
oxc_ast = { version = "0.52.0", path = "crates/oxc_ast" }
oxc_ast_macros = { version = "0.52.0", path = "crates/oxc_ast_macros" }
oxc_cfg = { version = "0.52.0", path = "crates/oxc_cfg" }
oxc_codegen = { version = "0.52.0", path = "crates/oxc_codegen" }
oxc_data_structures = { version = "0.52.0", path = "crates/oxc_data_structures" }
oxc_diagnostics = { version = "0.52.0", path = "crates/oxc_diagnostics" }
oxc_ecmascript = { version = "0.52.0", path = "crates/oxc_ecmascript" }
oxc_estree = { version = "0.52.0", path = "crates/oxc_estree" }
oxc_isolated_declarations = { version = "0.52.0", path = "crates/oxc_isolated_declarations" }
oxc_mangler = { version = "0.52.0", path = "crates/oxc_mangler" }
oxc_minifier = { version = "0.52.0", path = "crates/oxc_minifier" }
oxc_napi = { version = "0.52.0", path = "crates/oxc_napi" }
oxc_parser = { version = "0.52.0", path = "crates/oxc_parser" }
oxc_parser_napi = { version = "0.52.0", path = "napi/parser" }
oxc_regular_expression = { version = "0.52.0", path = "crates/oxc_regular_expression" }
oxc_semantic = { version = "0.52.0", path = "crates/oxc_semantic" }
oxc_span = { version = "0.52.0", path = "crates/oxc_span" }
oxc_syntax = { version = "0.52.0", path = "crates/oxc_syntax" }
oxc_transform_napi = { version = "0.52.0", path = "napi/transform" }
oxc_transformer = { version = "0.52.0", path = "crates/oxc_transformer" }
oxc_traverse = { version = "0.52.0", path = "crates/oxc_traverse" }
# publish = false
oxc_linter = { path = "crates/oxc_linter" }
oxc_macros = { path = "crates/oxc_macros" }
oxc_prettier = { path = "crates/oxc_prettier" }
oxc_tasks_common = { path = "tasks/common" }
oxc_tasks_transform_checker = { path = "tasks/transform_checker" }
# Relaxed version so the user can decide which version to use.
napi = "3.0.0-alpha"
napi-build = "2"
napi-derive = "3.0.0-alpha"
# Relaxed version so the user can decide which version to use.
indexmap = "2"
proc-macro2 = "1"
quote = "1"
rustc-hash = "2"
serde = "1"
serde_json = "1"
syn = { version = "2", default-features = false }
unicode-id-start = "1"
#
oxc-browserslist = "2.0.0"
oxc_index = "3"
oxc_resolver = "4"
oxc_sourcemap = "2"
#
allocator-api2 = "0.2.21"
assert-unchecked = "0.1.2"
base64 = "0.22.1"
bitflags = "2.8.0"
bpaf = "0.9.16"
bumpalo = "3.17.0"
compact_str = "0.8.1"
console = "0.15.10"
console_error_panic_hook = "0.1.7"
convert_case = "0.7.1"
cow-utils = "0.1.3"
criterion2 = { version = "3.0.0", default-features = false }
encoding_rs = "0.8.35"
encoding_rs_io = "0.1.7"
env_logger = { version = "0.11.6", default-features = false }
fast-glob = "0.4.3"
fixedbitset = "0.5.7"
flate2 = "1.0.35"
futures = "0.3.31"
globset = "0.4.15"
handlebars = "6.3.1"
hashbrown = { version = "0.15.2", default-features = false }
humansize = "2.1.3"
ignore = "0.4.23"
insta = "1.42.1"
itertools = "0.14.0"
itoa = "1.0.14"
jemallocator = "0.5.4"
json-strip-comments = "1.0.4"
language-tags = "0.3.2"
lazy_static = "1.5.0"
log = "0.4.25"
markdown = "1.0.0-alpha.22"
memchr = "2.7.4"
miette = { package = "oxc-miette", version = "1.0.2", features = ["fancy-no-syscall"] }
mimalloc = "0.1.43"
nonmax = "0.5.5"
num-bigint = "0.4.6"
num-traits = "0.2.19"
papaya = "0.2.0"
petgraph = "0.7.1"
phf = "0.11.3"
pico-args = "0.5.0"
prettyplease = "0.2.29"
project-root = "0.2.2"
quote = { version = "1" }
rayon = { version = "1.10.0" }
regex = { version = "1.11.1" }
ropey = { version = "1.6.1" }
rust-lapper = "1.1.0"
rustc-hash = "2"
ryu-js = "1.0.1"
saphyr = { version = "0.0.3" }
schemars = { version = "0.8.21" }
self_cell = { version = "1.1.0" }
seq-macro = "0.3.5"
serde = { version = "1" }
serde-wasm-bindgen = "0.6.5"
serde_json = { version = "1" }
sha1 = { version = "0.10.6" }
simdutf8 = { version = "0.1.5", features = ["aarch64_neon"] }
similar = "2.7.0"
similar-asserts = "1.6.1"
tempfile = "3.16.0"
tokio = "1.43.0"
tower-lsp = "0.20.0"
tracing-subscriber = "0.3.19"
tsify = "0.4.5"
ureq = { version = "3.0.5", default-features = false }
walkdir = "2.5.0"
wasm-bindgen = "0.2.100"
[workspace.lints]
[workspace.lints.clippy]
all = { level = "warn", priority = -1 }
allow_attributes = "warn"
cargo = { level = "warn", priority = -1 }
cargo_common_metadata = "allow" # FIXME
clone_on_ref_ptr = "warn"
dbg_macro = "warn"
doc_lazy_continuation = "allow" # FIXME
doc_markdown = "allow"
empty_docs = { level = "allow", priority = 1 } # From `Tsify`
empty_drop = "warn"
empty_structs_with_brackets = "warn"
exit = "warn"
filetype_is_file = "warn"
get_unwrap = "warn"
impl_trait_in_params = "warn"
infinite_loop = "warn"
map_with_unused_argument_over_ranges = "warn"
missing_const_for_fn = "allow"
multiple_crate_versions = "allow"
must_use_candidate = "allow"
pathbuf_init_then_push = "warn"
pedantic = { level = "warn", priority = -1 }
print_stderr = "warn" # Must be opt-in
print_stdout = "warn" # Must be opt-in
rc_buffer = "warn"
rc_mutex = "warn"
rest_pat_in_fully_bound_structs = "warn"
self_named_module_files = "warn" # "-Wclippy::mod_module_files"
struct_excessive_bools = "allow"
todo = "warn"
too_many_lines = "allow"
undocumented_unsafe_blocks = "warn"
unimplemented = "warn"
unnecessary_safety_comment = "warn"
unused_result_ok = "warn"
wildcard_imports = "allow"
[workspace.lints.rust]
absolute_paths_not_starting_with_crate = "warn"
non_ascii_idents = "warn"
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(coverage)',
'cfg(coverage_nightly)',
] }
unit-bindings = "warn"
[workspace.metadata]
[workspace.metadata.cargo-shear]
ignored = ["napi", "oxc_transform_napi", "oxc_parser_napi", "prettyplease"]
[workspace.package]
authors = ["Boshen <[email protected]>", "Oxc contributors"]
categories = ["compilers", "development-tools", "web-programming"]
description = "A collection of JavaScript tools written in Rust."
edition = "2024"
homepage = "https://oxc.rs"
keywords = ["JavaScript", "TypeScript", "linter", "minifier", "parser"]
license-file = "LICENSE"
repository = "https://github.com/oxc-project/oxc"
rust-version = "1.85.0"