forked from oxc-project/oxc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCargo.toml
203 lines (191 loc) · 7.6 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
[workspace]
resolver = "2"
members = ["crates/*", "tasks/*", "napi/*", "wasm/*"]
exclude = ["tasks/lint_rules"]
[workspace.package]
authors = ["Boshen <[email protected]>", "Oxc contributors"]
categories = ["development-tools", "web-programming", "compilers"]
description = "A collection of JavaScript tools written in Rust."
edition = "2021"
homepage = "https://oxc-project.github.io"
keywords = ["JavaScript", "TypeScript", "parser", "linter", "minifier"]
license = "MIT"
repository = "https://github.com/oxc-project/oxc"
rust-version = "1.74"
# <https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html>
[workspace.lints.rust]
unsafe_code = "warn"
absolute_paths_not_starting_with_crate = "warn"
non_ascii_idents = "warn"
unit-bindings = "warn"
[workspace.lints.clippy]
all = { level = "warn" }
empty_docs = { level = "allow", priority = 1 } # from `Tsify`
# restriction
dbg_macro = "warn"
todo = "warn"
unimplemented = "warn"
# I like the explicitness of this rule as it removes confusion around `clone`.
# This increases readability, avoids `clone` mindlessly and heap allocating on 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"
impl_trait_in_params = "warn"
rc_buffer = "warn"
rc_mutex = "warn"
rest_pat_in_fully_bound_structs = "warn"
unnecessary_safety_comment = "warn"
undocumented_unsafe_blocks = "warn"
infinite_loop = "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
# This rule is too pedantic, I don't want to force this because naming things are hard.
module_name_repetitions = "allow"
# 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] every where also hinders readability.
must_use_candidate = "allow"
# used_underscore_binding= "allow"
doc_markdown = "allow"
# nursery
# `const` functions do not make sense for our project because this is not a `const` library.
# This rule also confuses new comers and forces them to add `const` blindlessly without any reason.
missing_const_for_fn = "allow"
# cargo
cargo = { level = "warn", priority = -1 }
multiple_crate_versions = "allow"
cargo_common_metadata = "allow" # TODO: fix this
[workspace.dependencies]
# publish = true
oxc = { version = "0.13.0", path = "crates/oxc" }
oxc_allocator = { version = "0.13.0", path = "crates/oxc_allocator" }
oxc_ast = { version = "0.13.0", path = "crates/oxc_ast" }
oxc_codegen = { version = "0.13.0", path = "crates/oxc_codegen" }
oxc_diagnostics = { version = "0.13.0", path = "crates/oxc_diagnostics" }
oxc_index = { version = "0.13.0", path = "crates/oxc_index" }
oxc_minifier = { version = "0.13.0", path = "crates/oxc_minifier" }
oxc_parser = { version = "0.13.0", path = "crates/oxc_parser" }
oxc_semantic = { version = "0.13.0", path = "crates/oxc_semantic" }
oxc_span = { version = "0.13.0", path = "crates/oxc_span" }
oxc_syntax = { version = "0.13.0", path = "crates/oxc_syntax" }
oxc_transformer = { version = "0.13.0", path = "crates/oxc_transformer" }
oxc_sourcemap = { version = "0.13.0", path = "crates/oxc_sourcemap" }
oxc_ast_macros = { version = "0.13.0", path = "crates/oxc_ast_macros" }
oxc_traverse = { version = "0.13.0", path = "crates/oxc_traverse" }
oxc_module_lexer = { version = "0.13.0", path = "crates/oxc_traverse" }
# publish = false
oxc_macros = { path = "crates/oxc_macros" }
oxc_linter = { path = "crates/oxc_linter" }
oxc_prettier = { path = "crates/oxc_prettier" }
oxc_tasks_common = { path = "tasks/common" }
napi = "2"
napi-derive = "2"
napi-build = "2"
assert-unchecked = "0.1.2"
allocator-api2 = "0.2.18"
bpaf = "0.9.11"
bitflags = "2.5.0"
bumpalo = "3.16.0"
convert_case = "0.6.0"
dashmap = "5.5.3"
flate2 = "1.0.29"
futures = "0.3.30"
glob = "0.3.1"
ignore = "0.4.22"
itertools = "0.12.1"
jemallocator = "0.5.4"
lazy_static = "1.4.0"
memoffset = "0.9.1"
miette = { version = "7.2.0", features = ["fancy-no-syscall"] }
mimalloc = "0.1.41"
num-bigint = "0.4.4"
num-traits = "0.2.18"
phf = "0.11"
pico-args = "0.5.0"
proc-macro2 = "1.0.81"
project-root = "0.2.2"
quote = "1.0.36"
rayon = "1.10.0"
regex = "1.10.4"
rustc-hash = "1.1.0"
ryu-js = "1.0.1"
ropey = "1.6.1"
seq-macro = "0.3.5"
serde = "1.0.199"
serde_json = "1.0.116"
syn = { version = "2.0.58", default-features = false }
tempfile = "3.10.1"
tokio = "1"
tower-lsp = "0.20.0"
trybuild = "1.0.93"
unicode-id-start = "1.1.2"
ureq = { version = "2.9.6", default-features = false }
url = "2.5.0"
walkdir = "2.5.0"
indexmap = "2.2.6"
static_assertions = "1.1.0"
tracing-subscriber = "0.3"
insta = "1.38.0"
mime_guess = "2.0.4"
language-tags = "0.3.2"
tsify = "0.4.5"
wasm-bindgen = "0.2"
serde-wasm-bindgen = "0.6.5"
handlebars = "5.1.2"
base64 = "0.22.0"
compact_str = "0.7.1"
console = "0.15.8"
encoding_rs = "0.8.34"
encoding_rs_io = "0.1.7"
env_logger = { version = "0.11.3", default-features = false }
globset = "0.4.14"
humansize = "2.1.3"
json-strip-comments = "1.0.2"
log = "0.4.21"
memchr = "2.7.2"
once_cell = "1.19.0"
ouroboros = "0.18.3"
owo-colors = "4.0.0"
oxc_resolver = "1.7.0"
petgraph = "0.6.4"
rust-lapper = "1.1.0"
similar = "2.5.0"
textwrap = "0.16.0"
unicode-width = "0.1.12"
saphyr = "0.0.1"
base64-simd = "0.8"
cfg-if = "1.0.0"
[workspace.metadata.cargo-shear]
ignored = ["napi", "oxc_traverse"]
[profile.dev]
# Disabling debug info speeds up local and CI builds,
# and we don't rely on it for debugging that much.
debug = false
[profile.release.package.oxc_wasm]
opt-level = 'z'
[profile.release]
# Configurations explicitly listed here for clarity.
# Using the best options for performance.
opt-level = 3
lto = "fat"
codegen-units = 1
strip = "symbols"
debug = false
panic = "abort" # Let it crash and force ourselves to write safe Rust.
# Use the `--profile release-debug` flag to show symbols in release mode.
# e.g. `cargo build --profile release-debug`
[profile.release-debug]
inherits = "release"
strip = false
debug = true