Commit graph

942 commits

Author SHA1 Message Date
Wenzhe Wang
e2a49271ac
feat(linter): add eslint(jest/no-export) (#925) 2023-09-17 22:40:29 +08:00
Wenzhe Wang
0f02d3783c
fix(semantic): make ExportDeclaration span accurate (#928) 2023-09-17 14:11:25 +00:00
Wenzhe Wang
eec9fd433a
feat(linter): add eslint(jest/no-mocks-import) (#924) 2023-09-17 20:11:52 +08:00
IWANABETHATGUY
d63d07a050
chore: 🤖 refactor crates/oxc_transformer/src/es2021/logical_assignment_operators.rs and fix typo (#927)
1. Fixing typo.
2. Making the code more expresisonful.
2023-09-17 19:58:10 +08:00
Boshen
5863f8ffdb
feat(transformer): logical assignment operators (#923) 2023-09-16 23:54:53 +08:00
Boshen
f4cea34534
feat(transformer): add babel conformance test suite (#920) 2023-09-16 18:50:51 +08:00
Devin-Yeung
4bf329e1cf
feat(linter): implement eslint-plugin-unicorn/no-thenable rule (#910)
related to #684
2023-09-16 18:10:49 +08:00
Boshen
70189f9758
refactor(ast): change the arguments order for some new functions 2023-09-16 16:07:52 +08:00
Boshen
419d5aa6ee
feat(transformer): transformer prototype (#918)
This PR introduces the oxc transformer.

The code is purposely arranged without any Rust trickery such as traits
and macros.
I intend to keep the code style this way until something blows up.

The next steps are:
* unit tests
* conformance tests with TypeScript and Babel
* benchmarks
2023-09-16 16:05:35 +08:00
Wenzhe Wang
91784515f0
feat(linter): add eslint-plugin-jest/no-jasmine-globals (#914) 2023-09-15 23:57:40 +08:00
Boshen
ceeee5909b
Remove HIR (#917)
closes #273
closes #814

HIR is removed from this PR, with the minifier being commented out.

HIR is a wonderful idea for compiling to lower languages, but after
sitting on it for a few months I found that it only adds confusion and
uncertainties to both myself and future contributors.

It also adds too much burden to maintainers if we plan to support more
downstream tools.

1 AST is the only way.
2023-09-15 23:48:32 +08:00
Boshen
38bbc96fb0
Release oxc v0.2.0 2023-09-14 23:41:44 +08:00
Boshen
f447cf3a3b
perf(lexer): only check the first lower case for match_keyword (#913) 2023-09-14 23:19:16 +08:00
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