Commit graph

979 commits

Author SHA1 Message Date
Boshen
a6d8d05cd3
feat(cli): init miette everything else to reduce is_atty system calls 2023-09-14 22:46:06 +08:00
Boshen
7962e81a43
perf(lexer): remove an extra branch from identifier_name_handler (#912) 2023-09-14 22:42:38 +08:00
Boshen
9d7e1657e9
perf(cli): force terminal_links to reduce sys calls (#911)
terminal_links has auto detection on by default,
it will get repeatedly called from parser rewind
with a `is_atty` system call.

closes #906
2023-09-14 22:28:30 +08:00
Todor Andonov
dd74d93ac9
feat(linter): add no-console rule (#887)
implements #864
2023-09-14 19:15:09 +08:00
Wenzhe Wang
8c44a9e05a
feat(linter): add eslint-plugin-import/default (#895) 2023-09-14 16:18:40 +08:00
dependabot[bot]
e174c2f555
chore(deps): bump the dependencies group with 5 updates (#908) 2023-09-14 16:15:50 +08:00
Boshen
242c698d78
Release oxc_resolver v0.2.0 2023-09-14 15:36:41 +08:00
Boshen
4faf3c7976
feat(resolver): add more tracing events to resolver (#907) 2023-09-14 15:34:51 +08:00
Boshen
b7a0b4f27f
feat(resolver): add TsconfigNotFound error (#905) 2023-09-13 16:36:59 +08:00
Boshen
814f71c15e
feat(resolver): add tracing-subscriber feature (#904) 2023-09-13 16:36:24 +08:00
Boshen
a077e877ba
fix(resolver): fix tsconfig lookup when a directory is provided (#900) 2023-09-13 14:20:04 +08:00
Boshen
babbc47d61
perf(parser): lazily build trivia map instead of build in-place (#903)
closes #898
2023-09-12 23:23:56 +08:00
Boshen
95cae98e2b
perf(resolver): use system canonicalize to reduce total number of path hashes (#902) 2023-09-12 18:01:39 +08:00
Boshen
2e99af3f67
perf(resolver): used cached node_modules in package_resolve (#901) 2023-09-12 16:51:40 +08:00
Boshen
ad891c3af2
perf(resolver): do not search inside non-existent directories for scoped packages (#899) 2023-09-12 15:27:29 +08:00
Boshen
1793397f20
perf(parser): remove an extra branch from parse_member_expression_rhs hot path (#896) 2023-09-11 23:25:19 +08:00
Don Isaac
027a67d94c
feat(minifier): constant addition expression folding (#882)
Fold constant addition expressions. Handles string concatenation and
addition, both with implicit casting.

For example,
```ts
let x = 1 + 1
let y = "hello " + "world"
```
now becomes
```ts
let x = 2
let y = "hello world"
```

## Extra Goodies
- test(minifier): add `test_snapshot` helper to perform snapshot tests
with `insta`
- up(hir): implement `std::ops::Add` for `NumericValue`
- up(span): impl `TryFrom<Cow<'_, &str>>` for `Atom`
2023-09-11 10:38:35 +08:00
Boshen
f488e1f97f
feat(linter): eslint-plugin-import(no-cycle) (#890) 2023-09-10 22:58:45 +08:00
Wenzhe Wang
7a9f821b1d
chore: fix typo (#889) 2023-09-10 21:44:09 +08:00
Wenzhe Wang
9c46e7e7c5
perf(linter): early bail out if not jest fn (#885) 2023-09-10 17:05:57 +08:00
Don Isaac
35e18980dc
feat(linter): add typescript/no-explicit-any (#881)
Implements `no-explicit-any` from `typescript-eslint`. Replaces #519
since it appears abandoned.
2023-09-10 12:28:50 +08:00
Boshen
9ff12a9696
feat(linter): eslint-plugin-import/no-self-import (#878)
closes #440 #441
2023-09-10 00:12:26 +08:00
Boshen
4e5f63a67d
feat(linter): implement re-exports (#877) 2023-09-09 18:28:49 +08:00
Boshen
8ece5003a2
refactor(resolver): clean up load_alias (#875) 2023-09-09 15:32:32 +08:00
Boshen
7c8e6ab6f6
fix(parser): parse [+In] in object binding initializer (#874)
closes #873
2023-09-09 14:54:20 +08:00
Boshen
a2dbfeeb25
refactor: clean up fuzzer, move it to repo root (#872) 2023-09-09 11:58:32 +08:00
Boshen
6fdea7224a
perf(resolver): avoid double hashing by memoizing the hash (#871) 2023-09-09 10:56:43 +08:00
Boshen
d161de95b6
perf(resolver): optimize canonicalize (#870) 2023-09-08 23:03:39 +08:00
Boshen
86eb486a2f
perf(resolver): cache node_modules lookup (#869) 2023-09-08 20:23:01 +08:00
Wenzhe Wang
f93c8616e4
feat: add jest/no-interpolation-in-snapshots rule (#867) 2023-09-07 23:50:09 +08:00
Boshen
1b8e2c0e25 feat(linter): add eslint-plugin-import/named 2023-09-07 22:56:09 +08:00
Boshen
a358856da3 feat(linter): add current_working_directory to tester 2023-09-07 22:56:09 +08:00
Boshen
5f7a9c687c chore(linter): add fixtures for import plugin 2023-09-07 22:56:09 +08:00
Boshen
75d928a20d feat(syntax): add loaded_modules to ModuleRecord 2023-09-07 22:56:09 +08:00
Boshen
9ee75931ed feat(linter): add rule_path to tester so the file extension can be changed 2023-09-07 22:56:09 +08:00
Boshen
5bbad73db5
feat(resolver): tsconfig project references (#862)
closes #751
2023-09-07 14:01:48 +08:00
Wenzhe Wang
9679ca754c
feat(linter): add eslint-plugin-jest/no-done-callback rule (#846) 2023-09-06 22:10:45 +08:00
Boshen
ee54575ec1
feat(linter): add runner for import-plugin (#858) 2023-09-06 14:54:19 +08:00
Boshen
2c8fdbdba1
chore(linter): add linter name to all diagnostics 2023-09-06 11:33:43 +08:00
Boshen
2b60b8a289
fix(linter): fix incorrect behaviour for "-D correctness -A rule-name" 2023-09-06 11:16:07 +08:00
Boshen
b89e931b33
fix(cli): spawn linting in another thread so diagnostics can be printed immediately 2023-09-06 10:21:32 +08:00
Boshen
b8808a81cf
feat(cli): use parallel walker for directory traversal (#860) 2023-09-05 15:17:44 +08:00
u9g
ed60c106b4
fix(query): fix UnaryExpression.operator (#859) 2023-09-05 06:04:14 +00:00
Devin-Yeung
286049b17b
feat(linter): implement unicorn/no-unnecessary-await (#856)
related to #684
2023-09-04 23:04:51 +08:00
Wenzhe Wang
be1be2e13c
chore(linter): change no-disabled-tests error message's position (#857) 2023-09-04 23:03:39 +08:00
Boshen
812a2e9337
fix(formatter): add whitespace around binary operators
closes #855
2023-09-04 22:07:57 +08:00
Wenzhe Wang
f7232ed9e7
chore(linter): move all jest rules to restriction (#854) 2023-09-04 22:03:24 +08:00
dependabot[bot]
5defa2fa96
chore(deps): bump the dependencies group with 6 updates (#852) 2023-09-04 15:46:27 +08:00
Boshen
bcc069e847
Release oxc_resolver v0.1.0 2023-09-04 14:45:29 +08:00
Boshen
a47fb35c0e
fix(resolver): fix collision on hash entries (#850) 2023-09-04 14:04:39 +08:00
Yunfei He
5bf9dddaec
refactor(resolver): remove unnecessary RefCell (#849) 2023-09-04 13:27:22 +08:00
Wenzhe Wang
8588f8b9c6
chore(linter): downgrade category of expect-expect and no-alias-methods (#848)
There are too many errors(7000+) in vscode repo, so downgrade this rule.

And I think
[no-alias-methods](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-alias-methods.md)
is also too strict when it is placed in [style
config](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#style),
so change it also.
2023-09-03 18:28:40 +08:00
Boshen
6706541049
refactor(linter): remove complicated linter service setup 2023-09-03 18:14:05 +08:00
Boshen
b9bd5ff7ab
refactor(cli): collect all the paths before linting 2023-09-03 16:36:02 +08:00
Boshen
deb50e1a25
chore(semantic): return Arc<ModuleRecord> from semantic 2023-09-03 15:41:11 +08:00
Boshen
91f4896247
refactor(linter): clean up Test a bit 2023-09-03 15:36:46 +08:00
Boshen
ba54eb67b3
chore(semantic): use Arc<ModuleRecord> 2023-09-03 15:29:00 +08:00
Boshen
aa7b665fe9
feat(resolver): add thiserror (#847) 2023-09-03 14:50:31 +08:00
Devin-Yeung
a969f69627
perf(linter): parse ts-directive manually (#845) 2023-09-03 14:13:16 +08:00
Boshen
93adc9b9c2
Release oxc v0.1.3 2023-09-03 12:22:05 +08:00
Boshen
37bf4c4421
Release oxc v0.1.2 2023-09-03 11:30:44 +08:00
Boshen
7bcf2d7c43
chore(oxc): add features for semantic, formatter and minifier 2023-09-03 11:28:20 +08:00
Boshen
6f270f1198
perf(linter): swap the order of checks for no_caller (#844) 2023-09-03 10:19:27 +08:00
Yunfei He
815db57a25
fix(semantic): symbol of identifier of top level function declaration should be in the root scope (#843)
---------

Co-authored-by: Boshen <boshenc@gmail.com>
2023-09-03 10:16:47 +08:00
Boshen
d25355c9e8
perf(lexer): reduce an extra branch from peek (#841) 2023-09-03 00:02:42 +08:00
Boshen
53b094e46c
chore: clean up deps (#840) 2023-09-02 21:34:24 +08:00
Boshen
56aaf31fb1
refactor(benchmark): use codspeed for all benchmarks (#839) 2023-09-02 20:35:48 +08:00
Boshen
e4a3838ecb
chore(resolver): benchmark with codspeed (#838) 2023-09-02 18:27:37 +08:00
Boshen
6ed57532cd
fix(resolver): fix a case where ignored package has a fallback (#837) 2023-09-02 17:22:35 +08:00
Boshen
7f504961ec
fix(resolver): fix a case where an alias is part of a dashed package name (#836) 2023-09-02 16:37:07 +08:00
Boshen
9724365862
refactor(resolver): remove nodejs_resolver comparison
we no longer need to compare with nodejs_resolver
2023-09-02 15:12:26 +08:00
Boshen
bebdbfb9a6
feat(resolver): add tracing example 2023-09-02 15:12:25 +08:00
Boshen
d74da2f3bf
fix(resolver): fix cases with conflicting node_modules path (#835) 2023-09-02 14:45:10 +08:00
Wenzhe Wang
fa1d7da090
feat(linter): add eslint-plugin-jest/no-conditional-expect rule (#832)
port
[no-conditional-expect](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-conditional-expect.md)
2023-09-02 14:37:15 +08:00
Boshen
6ae6532245
fix(resolver): add test case for resolve_to_context (#834) 2023-09-02 12:03:07 +08:00
Boshen
47a076c226
feat(resolver): add an option to turn off builtin_modules (#833) 2023-09-02 11:38:03 +08:00
dependabot[bot]
8caf77300b
chore(deps): bump the dependencies group with 10 updates (#831) 2023-09-01 13:56:12 +08:00
Boshen
0921b733f7
deps: pin ezno-checker so dependabot can do its work 2023-09-01 12:18:05 +08:00
Boshen
693145107c
refactor(linter): less a global hashmap to reduce rule timer macro expansion (#822)
closes #819
2023-09-01 10:32:17 +08:00
Boshen
129191fc44
perf(resolver): stop descending into node_modules when possible (#821) 2023-09-01 10:18:59 +08:00
Boshen
777cc003a5
fix(resolver): resolve exports field that are directories (#820) 2023-08-31 16:10:03 +08:00
Boshen
92e7ecedc5
chore(linter): remove unmaintained typescript/isolated-declaration 2023-08-30 22:42:09 +08:00
Wenzhe Wang
7233aef0de
feat(linter): add eslint-plugin-jest/no_alias_method rule (#818)
port
[no_alias_method](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-alias-methods.md)
2023-08-30 22:38:01 +08:00
Boshen
e52157976f
fix(resolver): fix resolving package_self with the correct subpath 2023-08-30 19:05:33 +08:00
Boshen
c68bafe776
fix(resolver): correct behavior for enforceExtension 2023-08-30 18:28:07 +08:00
Boshen
589a4d6cd8
fix(resolver): do not resolve browser field that are strings (#816) 2023-08-30 14:00:59 +08:00
u9g
a38619b780
feat(vscode): Add linter plugin to vscode extension (#813) 2023-08-29 23:35:32 -04:00
Boshen
66e883ae8c
fix(resolver): make sure package name is valid when loading package self (#810) 2023-08-29 22:56:48 +08:00
u9g
05bb29a11e
feat(query): Add fields (#807)
```diff
+ Expression.or_value_at_declaration

+ Function.body

```
2023-08-28 13:56:05 +08:00
u9g
8f5cb4be8c
rename get_node_by_ident to get_declaration_of_variable (#806)
The previous function name wasn't really clear to me, I think this is
better.
2023-08-28 13:00:25 +08:00
EliLichtblau
6a9d57061c
TSTypeName change identifer name to identifier reference (#804)
When initially written types were not in the symbol table. Now that
types are in the symbol table it makes sense given
```ts
type A = 1
type B = A
```
that you can get to the symbol id for for A from type B = A.

Please correct me if I'm wrong about how I implemented this. I also
verified that occurrence (I believe this is the correct word) behaves
how I would expect.

```ts
type RecursiveType = string | {[x: string]: RecursiveType}
```
Does populate a reference.

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2023-08-28 11:42:21 +08:00
u9g
a44dde5303
feat(linter_plugin): Add linter plugin crate (#798)
Adds a `linter_plugin` crate which adds `oxc_query` support to any
`oxc_linter` consumers such as `oxc_cli` and `editor/vscode`
2023-08-28 11:40:00 +08:00
Wenzhe Wang
8b24052438
fix(linter): no-var-requires not warning if has bindings in ancestors (#799) 2023-08-28 11:24:17 +08:00
Boshen
dd7749f949
improve README (#800)
closes #686

Rendered: https://github.com/web-infra-dev/oxc/blob/readme/README.md

This is a refinement for the README, which should include information
for different interests: first time reader, explorer, rust crate / napi
user etc.
2023-08-27 22:36:17 +08:00
Wenzhe Wang
3721837e13
feat(linter): eslint-plugin-jest/expect-expect (#802)
Port [eslint-plugin-jest/expect-expect
](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/expect-expect.md)
2023-08-27 21:42:58 +08:00
Boshen
ed9e3e0774
refactor(linter): move the label message to help 2023-08-27 11:49:26 +08:00
Boshen
1f27426570
Release crates as v0.1.1 2023-08-26 17:53:11 +08:00
u9g
ad05e196cf
feat(query): Fix Spread typename (#797) 2023-08-26 10:50:21 +08:00
Boshen
c88823244e
fix(cli): correct ignore-pattern behavior; add more cli tests (#796) 2023-08-26 00:03:49 +08:00
Boshen
12798e075f
refactor: improve code coverage a little bit 2023-08-25 23:07:14 +08:00