@frozenproductions/niteo 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +458 -0
- package/Cargo.toml +13 -0
- package/LICENSE +21 -0
- package/README.md +119 -0
- package/bin/niteo.js +51 -0
- package/package.json +27 -0
- package/scripts/build-binary.js +23 -0
- package/src/app.rs +132 -0
- package/src/cli.rs +43 -0
- package/src/config.rs +989 -0
- package/src/discovery.rs +42 -0
- package/src/git.rs +63 -0
- package/src/main.rs +13 -0
- package/src/report.rs +490 -0
- package/src/rules/max_directory_depth.rs +125 -0
- package/src/rules/max_file_exports.rs +478 -0
- package/src/rules/max_items_per_directory.rs +145 -0
- package/src/rules/min_items_per_directory.rs +146 -0
- package/src/rules/no_barrel_files.rs +284 -0
- package/src/rules/no_comments.rs +222 -0
- package/src/rules/no_console.rs +242 -0
- package/src/rules/no_debugger.rs +209 -0
- package/src/rules/no_default_export.rs +241 -0
- package/src/rules/no_duplicate_file_names.rs +196 -0
- package/src/rules/no_empty_directories.rs +467 -0
- package/src/rules/no_empty_interface.rs +280 -0
- package/src/rules/no_enums.rs +208 -0
- package/src/rules/no_eval.rs +268 -0
- package/src/rules/no_export_star.rs +252 -0
- package/src/rules/no_inline_types.rs +367 -0
- package/src/rules/no_interface.rs +570 -0
- package/src/rules/no_large_file.rs +98 -0
- package/src/rules/no_logic_in_barrel.rs +346 -0
- package/src/rules/no_logic_in_domain.rs +987 -0
- package/src/rules/no_mutable_exports.rs +253 -0
- package/src/rules/no_upward_import.rs +427 -0
- package/src/rules/prefer_satisfies.rs +319 -0
- package/src/rules.rs +247 -0
package/Cargo.lock
ADDED
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "aho-corasick"
|
|
7
|
+
version = "1.1.4"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"memchr",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
[[package]]
|
|
15
|
+
name = "anstream"
|
|
16
|
+
version = "1.0.0"
|
|
17
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
18
|
+
checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d"
|
|
19
|
+
dependencies = [
|
|
20
|
+
"anstyle",
|
|
21
|
+
"anstyle-parse",
|
|
22
|
+
"anstyle-query",
|
|
23
|
+
"anstyle-wincon",
|
|
24
|
+
"colorchoice",
|
|
25
|
+
"is_terminal_polyfill",
|
|
26
|
+
"utf8parse",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[[package]]
|
|
30
|
+
name = "anstyle"
|
|
31
|
+
version = "1.0.14"
|
|
32
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
33
|
+
checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000"
|
|
34
|
+
|
|
35
|
+
[[package]]
|
|
36
|
+
name = "anstyle-parse"
|
|
37
|
+
version = "1.0.0"
|
|
38
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
39
|
+
checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e"
|
|
40
|
+
dependencies = [
|
|
41
|
+
"utf8parse",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[[package]]
|
|
45
|
+
name = "anstyle-query"
|
|
46
|
+
version = "1.1.5"
|
|
47
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
48
|
+
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
|
|
49
|
+
dependencies = [
|
|
50
|
+
"windows-sys",
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
[[package]]
|
|
54
|
+
name = "anstyle-wincon"
|
|
55
|
+
version = "3.0.11"
|
|
56
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
57
|
+
checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
|
|
58
|
+
dependencies = [
|
|
59
|
+
"anstyle",
|
|
60
|
+
"once_cell_polyfill",
|
|
61
|
+
"windows-sys",
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
[[package]]
|
|
65
|
+
name = "anyhow"
|
|
66
|
+
version = "1.0.102"
|
|
67
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
68
|
+
checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c"
|
|
69
|
+
|
|
70
|
+
[[package]]
|
|
71
|
+
name = "bstr"
|
|
72
|
+
version = "1.12.1"
|
|
73
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
74
|
+
checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab"
|
|
75
|
+
dependencies = [
|
|
76
|
+
"memchr",
|
|
77
|
+
"serde",
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
[[package]]
|
|
81
|
+
name = "clap"
|
|
82
|
+
version = "4.6.1"
|
|
83
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
84
|
+
checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51"
|
|
85
|
+
dependencies = [
|
|
86
|
+
"clap_builder",
|
|
87
|
+
"clap_derive",
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
[[package]]
|
|
91
|
+
name = "clap_builder"
|
|
92
|
+
version = "4.6.0"
|
|
93
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
94
|
+
checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f"
|
|
95
|
+
dependencies = [
|
|
96
|
+
"anstream",
|
|
97
|
+
"anstyle",
|
|
98
|
+
"clap_lex",
|
|
99
|
+
"strsim",
|
|
100
|
+
]
|
|
101
|
+
|
|
102
|
+
[[package]]
|
|
103
|
+
name = "clap_derive"
|
|
104
|
+
version = "4.6.1"
|
|
105
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
106
|
+
checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9"
|
|
107
|
+
dependencies = [
|
|
108
|
+
"heck",
|
|
109
|
+
"proc-macro2",
|
|
110
|
+
"quote",
|
|
111
|
+
"syn",
|
|
112
|
+
]
|
|
113
|
+
|
|
114
|
+
[[package]]
|
|
115
|
+
name = "clap_lex"
|
|
116
|
+
version = "1.1.0"
|
|
117
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
118
|
+
checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9"
|
|
119
|
+
|
|
120
|
+
[[package]]
|
|
121
|
+
name = "colorchoice"
|
|
122
|
+
version = "1.0.5"
|
|
123
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
124
|
+
checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"
|
|
125
|
+
|
|
126
|
+
[[package]]
|
|
127
|
+
name = "crossbeam-deque"
|
|
128
|
+
version = "0.8.6"
|
|
129
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
130
|
+
checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51"
|
|
131
|
+
dependencies = [
|
|
132
|
+
"crossbeam-epoch",
|
|
133
|
+
"crossbeam-utils",
|
|
134
|
+
]
|
|
135
|
+
|
|
136
|
+
[[package]]
|
|
137
|
+
name = "crossbeam-epoch"
|
|
138
|
+
version = "0.9.18"
|
|
139
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
140
|
+
checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
|
|
141
|
+
dependencies = [
|
|
142
|
+
"crossbeam-utils",
|
|
143
|
+
]
|
|
144
|
+
|
|
145
|
+
[[package]]
|
|
146
|
+
name = "crossbeam-utils"
|
|
147
|
+
version = "0.8.21"
|
|
148
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
149
|
+
checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
|
|
150
|
+
|
|
151
|
+
[[package]]
|
|
152
|
+
name = "equivalent"
|
|
153
|
+
version = "1.0.2"
|
|
154
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
155
|
+
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
|
156
|
+
|
|
157
|
+
[[package]]
|
|
158
|
+
name = "globset"
|
|
159
|
+
version = "0.4.18"
|
|
160
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
161
|
+
checksum = "52dfc19153a48bde0cbd630453615c8151bce3a5adfac7a0aebfbf0a1e1f57e3"
|
|
162
|
+
dependencies = [
|
|
163
|
+
"aho-corasick",
|
|
164
|
+
"bstr",
|
|
165
|
+
"log",
|
|
166
|
+
"regex-automata",
|
|
167
|
+
"regex-syntax",
|
|
168
|
+
]
|
|
169
|
+
|
|
170
|
+
[[package]]
|
|
171
|
+
name = "hashbrown"
|
|
172
|
+
version = "0.17.1"
|
|
173
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
174
|
+
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
|
|
175
|
+
|
|
176
|
+
[[package]]
|
|
177
|
+
name = "heck"
|
|
178
|
+
version = "0.5.0"
|
|
179
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
180
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
181
|
+
|
|
182
|
+
[[package]]
|
|
183
|
+
name = "ignore"
|
|
184
|
+
version = "0.4.25"
|
|
185
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
186
|
+
checksum = "d3d782a365a015e0f5c04902246139249abf769125006fbe7649e2ee88169b4a"
|
|
187
|
+
dependencies = [
|
|
188
|
+
"crossbeam-deque",
|
|
189
|
+
"globset",
|
|
190
|
+
"log",
|
|
191
|
+
"memchr",
|
|
192
|
+
"regex-automata",
|
|
193
|
+
"same-file",
|
|
194
|
+
"walkdir",
|
|
195
|
+
"winapi-util",
|
|
196
|
+
]
|
|
197
|
+
|
|
198
|
+
[[package]]
|
|
199
|
+
name = "indexmap"
|
|
200
|
+
version = "2.14.0"
|
|
201
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
202
|
+
checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9"
|
|
203
|
+
dependencies = [
|
|
204
|
+
"equivalent",
|
|
205
|
+
"hashbrown",
|
|
206
|
+
]
|
|
207
|
+
|
|
208
|
+
[[package]]
|
|
209
|
+
name = "is_terminal_polyfill"
|
|
210
|
+
version = "1.70.2"
|
|
211
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
212
|
+
checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
|
|
213
|
+
|
|
214
|
+
[[package]]
|
|
215
|
+
name = "itoa"
|
|
216
|
+
version = "1.0.18"
|
|
217
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
218
|
+
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
|
219
|
+
|
|
220
|
+
[[package]]
|
|
221
|
+
name = "log"
|
|
222
|
+
version = "0.4.29"
|
|
223
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
224
|
+
checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
|
|
225
|
+
|
|
226
|
+
[[package]]
|
|
227
|
+
name = "memchr"
|
|
228
|
+
version = "2.8.0"
|
|
229
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
230
|
+
checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
|
|
231
|
+
|
|
232
|
+
[[package]]
|
|
233
|
+
name = "niteo"
|
|
234
|
+
version = "0.1.0"
|
|
235
|
+
dependencies = [
|
|
236
|
+
"anyhow",
|
|
237
|
+
"clap",
|
|
238
|
+
"ignore",
|
|
239
|
+
"serde",
|
|
240
|
+
"serde_json",
|
|
241
|
+
"toml",
|
|
242
|
+
]
|
|
243
|
+
|
|
244
|
+
[[package]]
|
|
245
|
+
name = "once_cell_polyfill"
|
|
246
|
+
version = "1.70.2"
|
|
247
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
248
|
+
checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
|
|
249
|
+
|
|
250
|
+
[[package]]
|
|
251
|
+
name = "proc-macro2"
|
|
252
|
+
version = "1.0.106"
|
|
253
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
254
|
+
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
|
|
255
|
+
dependencies = [
|
|
256
|
+
"unicode-ident",
|
|
257
|
+
]
|
|
258
|
+
|
|
259
|
+
[[package]]
|
|
260
|
+
name = "quote"
|
|
261
|
+
version = "1.0.45"
|
|
262
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
263
|
+
checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
|
|
264
|
+
dependencies = [
|
|
265
|
+
"proc-macro2",
|
|
266
|
+
]
|
|
267
|
+
|
|
268
|
+
[[package]]
|
|
269
|
+
name = "regex-automata"
|
|
270
|
+
version = "0.4.14"
|
|
271
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
272
|
+
checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f"
|
|
273
|
+
dependencies = [
|
|
274
|
+
"aho-corasick",
|
|
275
|
+
"memchr",
|
|
276
|
+
"regex-syntax",
|
|
277
|
+
]
|
|
278
|
+
|
|
279
|
+
[[package]]
|
|
280
|
+
name = "regex-syntax"
|
|
281
|
+
version = "0.8.10"
|
|
282
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
283
|
+
checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
|
|
284
|
+
|
|
285
|
+
[[package]]
|
|
286
|
+
name = "same-file"
|
|
287
|
+
version = "1.0.6"
|
|
288
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
289
|
+
checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
|
|
290
|
+
dependencies = [
|
|
291
|
+
"winapi-util",
|
|
292
|
+
]
|
|
293
|
+
|
|
294
|
+
[[package]]
|
|
295
|
+
name = "serde"
|
|
296
|
+
version = "1.0.228"
|
|
297
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
298
|
+
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
|
|
299
|
+
dependencies = [
|
|
300
|
+
"serde_core",
|
|
301
|
+
"serde_derive",
|
|
302
|
+
]
|
|
303
|
+
|
|
304
|
+
[[package]]
|
|
305
|
+
name = "serde_core"
|
|
306
|
+
version = "1.0.228"
|
|
307
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
308
|
+
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
|
|
309
|
+
dependencies = [
|
|
310
|
+
"serde_derive",
|
|
311
|
+
]
|
|
312
|
+
|
|
313
|
+
[[package]]
|
|
314
|
+
name = "serde_derive"
|
|
315
|
+
version = "1.0.228"
|
|
316
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
317
|
+
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
|
|
318
|
+
dependencies = [
|
|
319
|
+
"proc-macro2",
|
|
320
|
+
"quote",
|
|
321
|
+
"syn",
|
|
322
|
+
]
|
|
323
|
+
|
|
324
|
+
[[package]]
|
|
325
|
+
name = "serde_json"
|
|
326
|
+
version = "1.0.150"
|
|
327
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
328
|
+
checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9"
|
|
329
|
+
dependencies = [
|
|
330
|
+
"itoa",
|
|
331
|
+
"memchr",
|
|
332
|
+
"serde",
|
|
333
|
+
"serde_core",
|
|
334
|
+
"zmij",
|
|
335
|
+
]
|
|
336
|
+
|
|
337
|
+
[[package]]
|
|
338
|
+
name = "serde_spanned"
|
|
339
|
+
version = "1.1.1"
|
|
340
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
341
|
+
checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26"
|
|
342
|
+
dependencies = [
|
|
343
|
+
"serde_core",
|
|
344
|
+
]
|
|
345
|
+
|
|
346
|
+
[[package]]
|
|
347
|
+
name = "strsim"
|
|
348
|
+
version = "0.11.1"
|
|
349
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
350
|
+
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
|
|
351
|
+
|
|
352
|
+
[[package]]
|
|
353
|
+
name = "syn"
|
|
354
|
+
version = "2.0.117"
|
|
355
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
356
|
+
checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
|
|
357
|
+
dependencies = [
|
|
358
|
+
"proc-macro2",
|
|
359
|
+
"quote",
|
|
360
|
+
"unicode-ident",
|
|
361
|
+
]
|
|
362
|
+
|
|
363
|
+
[[package]]
|
|
364
|
+
name = "toml"
|
|
365
|
+
version = "1.1.2+spec-1.1.0"
|
|
366
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
367
|
+
checksum = "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee"
|
|
368
|
+
dependencies = [
|
|
369
|
+
"indexmap",
|
|
370
|
+
"serde_core",
|
|
371
|
+
"serde_spanned",
|
|
372
|
+
"toml_datetime",
|
|
373
|
+
"toml_parser",
|
|
374
|
+
"toml_writer",
|
|
375
|
+
"winnow",
|
|
376
|
+
]
|
|
377
|
+
|
|
378
|
+
[[package]]
|
|
379
|
+
name = "toml_datetime"
|
|
380
|
+
version = "1.1.1+spec-1.1.0"
|
|
381
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
382
|
+
checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7"
|
|
383
|
+
dependencies = [
|
|
384
|
+
"serde_core",
|
|
385
|
+
]
|
|
386
|
+
|
|
387
|
+
[[package]]
|
|
388
|
+
name = "toml_parser"
|
|
389
|
+
version = "1.1.2+spec-1.1.0"
|
|
390
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
391
|
+
checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526"
|
|
392
|
+
dependencies = [
|
|
393
|
+
"winnow",
|
|
394
|
+
]
|
|
395
|
+
|
|
396
|
+
[[package]]
|
|
397
|
+
name = "toml_writer"
|
|
398
|
+
version = "1.1.1+spec-1.1.0"
|
|
399
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
400
|
+
checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db"
|
|
401
|
+
|
|
402
|
+
[[package]]
|
|
403
|
+
name = "unicode-ident"
|
|
404
|
+
version = "1.0.24"
|
|
405
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
406
|
+
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
|
407
|
+
|
|
408
|
+
[[package]]
|
|
409
|
+
name = "utf8parse"
|
|
410
|
+
version = "0.2.2"
|
|
411
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
412
|
+
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
|
413
|
+
|
|
414
|
+
[[package]]
|
|
415
|
+
name = "walkdir"
|
|
416
|
+
version = "2.5.0"
|
|
417
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
418
|
+
checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
|
|
419
|
+
dependencies = [
|
|
420
|
+
"same-file",
|
|
421
|
+
"winapi-util",
|
|
422
|
+
]
|
|
423
|
+
|
|
424
|
+
[[package]]
|
|
425
|
+
name = "winapi-util"
|
|
426
|
+
version = "0.1.11"
|
|
427
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
428
|
+
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
|
|
429
|
+
dependencies = [
|
|
430
|
+
"windows-sys",
|
|
431
|
+
]
|
|
432
|
+
|
|
433
|
+
[[package]]
|
|
434
|
+
name = "windows-link"
|
|
435
|
+
version = "0.2.1"
|
|
436
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
437
|
+
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
|
438
|
+
|
|
439
|
+
[[package]]
|
|
440
|
+
name = "windows-sys"
|
|
441
|
+
version = "0.61.2"
|
|
442
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
443
|
+
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
|
|
444
|
+
dependencies = [
|
|
445
|
+
"windows-link",
|
|
446
|
+
]
|
|
447
|
+
|
|
448
|
+
[[package]]
|
|
449
|
+
name = "winnow"
|
|
450
|
+
version = "1.0.3"
|
|
451
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
452
|
+
checksum = "0592e1c9d151f854e6fd382574c3a0855250e1d9b2f99d9281c6e6391af352f1"
|
|
453
|
+
|
|
454
|
+
[[package]]
|
|
455
|
+
name = "zmij"
|
|
456
|
+
version = "1.0.21"
|
|
457
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
458
|
+
checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
|
package/Cargo.toml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "niteo"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
edition = "2024"
|
|
5
|
+
license = "MIT"
|
|
6
|
+
|
|
7
|
+
[dependencies]
|
|
8
|
+
anyhow = "1.0.102"
|
|
9
|
+
clap = { version = "4.6.1", features = ["derive"] }
|
|
10
|
+
ignore = "0.4.23"
|
|
11
|
+
serde = { version = "1.0.228", features = ["derive"] }
|
|
12
|
+
serde_json = "1.0.150"
|
|
13
|
+
toml = "1.1.2"
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 FrozenProductions
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Niteo
|
|
2
|
+
|
|
3
|
+
Niteo is a standalone Rust CLI for structural linting in TypeScript projects.
|
|
4
|
+
|
|
5
|
+
It is intended to check project shape and source structure rather than formatting. The current alpha build only covers a small part of that goal, so treat it as an experiment and development preview.
|
|
6
|
+
|
|
7
|
+
## Status
|
|
8
|
+
|
|
9
|
+
Niteo is in alpha.
|
|
10
|
+
|
|
11
|
+
Do not use it as a production quality linter yet. The rule set is small, the output format may change, configuration is not stable, and some intended project guidance is not implemented. It is useful right now for testing the direction of the tool and contributing early feedback.
|
|
12
|
+
|
|
13
|
+
## What It Does Today
|
|
14
|
+
|
|
15
|
+
Niteo is being built around a few core jobs:
|
|
16
|
+
|
|
17
|
+
- scan TypeScript project files
|
|
18
|
+
- apply structural linting rules
|
|
19
|
+
- read project-level configuration
|
|
20
|
+
- print terminal reports that are useful during development
|
|
21
|
+
|
|
22
|
+
Exact rules, configuration options, and report details are still changing during alpha.
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
After publishing the npm package, run it with `npx`:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
npx @frozenproductions/niteo lint
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The npm package builds the Rust binary during installation, so Rust and Cargo must be installed on the machine running `npx`.
|
|
33
|
+
|
|
34
|
+
For local development, run it from source:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
cargo run -- lint
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
For local development, you can also build the binary:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
cargo build
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Then run:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
./target/debug/niteo lint
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Usage
|
|
53
|
+
|
|
54
|
+
Scan the default project root:
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
npx @frozenproductions/niteo lint
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Generate a starter config:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
npx @frozenproductions/niteo init
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Scan a specific root:
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
npx @frozenproductions/niteo lint --root src
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Restrict the scan to a path:
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
npx @frozenproductions/niteo lint --scope src/components
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Show help:
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
npx @frozenproductions/niteo --help
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Configuration
|
|
85
|
+
|
|
86
|
+
Niteo looks for `niteo.toml` in the current workspace.
|
|
87
|
+
|
|
88
|
+
You can generate a starter config with:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
npx @frozenproductions/niteo init
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The config format is not stable yet, so prefer generating it from the CLI instead of copying old examples.
|
|
95
|
+
|
|
96
|
+
## Current Limitations
|
|
97
|
+
|
|
98
|
+
- The rule set is incomplete.
|
|
99
|
+
- Some checks may be shallow while the project is still being shaped.
|
|
100
|
+
- The config shape may change.
|
|
101
|
+
- The report format may change.
|
|
102
|
+
- It has not been tested across large real-world codebases.
|
|
103
|
+
- It should not replace ESLint, TypeScript, or existing CI checks.
|
|
104
|
+
|
|
105
|
+
## Development
|
|
106
|
+
|
|
107
|
+
Useful commands:
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
cargo fmt
|
|
111
|
+
cargo check
|
|
112
|
+
cargo test
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The project currently keeps the CLI, config loading, file discovery, rule checks, and reporting in separate modules.
|
|
116
|
+
|
|
117
|
+
## License
|
|
118
|
+
|
|
119
|
+
No license has been added yet.
|
package/bin/niteo.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { existsSync } = require("node:fs");
|
|
4
|
+
const { dirname, join, resolve } = require("node:path");
|
|
5
|
+
const { spawnSync } = require("node:child_process");
|
|
6
|
+
|
|
7
|
+
const packageRoot = resolve(__dirname, "..");
|
|
8
|
+
const binaryName = process.platform === "win32" ? "niteo.exe" : "niteo";
|
|
9
|
+
const binaryPath = join(packageRoot, "target", "release", binaryName);
|
|
10
|
+
|
|
11
|
+
function run(command, args, options) {
|
|
12
|
+
const result = spawnSync(command, args, {
|
|
13
|
+
cwd: packageRoot,
|
|
14
|
+
stdio: "inherit",
|
|
15
|
+
...options,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
if (result.error) {
|
|
19
|
+
console.error(result.error.message);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (result.signal) {
|
|
24
|
+
console.error(`niteo terminated by signal ${result.signal}`);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
process.exit(result.status ?? 1);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (!existsSync(binaryPath)) {
|
|
32
|
+
const buildResult = spawnSync("cargo", ["build", "--release"], {
|
|
33
|
+
cwd: packageRoot,
|
|
34
|
+
stdio: "inherit",
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
if (buildResult.error) {
|
|
38
|
+
console.error("failed to build niteo; install Rust and Cargo, then try again");
|
|
39
|
+
console.error(buildResult.error.message);
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (buildResult.status !== 0) {
|
|
44
|
+
process.exit(buildResult.status ?? 1);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
run(binaryPath, process.argv.slice(2), {
|
|
49
|
+
cwd: process.cwd(),
|
|
50
|
+
env: process.env,
|
|
51
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@frozenproductions/niteo",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Standalone Rust CLI for TypeScript structural linting.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"private": false,
|
|
7
|
+
"bin": {
|
|
8
|
+
"niteo": "bin/niteo.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"bin",
|
|
12
|
+
"scripts",
|
|
13
|
+
"src",
|
|
14
|
+
"Cargo.toml",
|
|
15
|
+
"Cargo.lock",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"postinstall": "node ./scripts/build-binary.js",
|
|
20
|
+
"build:binary": "cargo build --release",
|
|
21
|
+
"check": "cargo check",
|
|
22
|
+
"test": "cargo test"
|
|
23
|
+
},
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=18"
|
|
26
|
+
}
|
|
27
|
+
}
|