Commit graph

123 commits

Author SHA1 Message Date
Cameron
3af35b8048
feat(linter) eslint-unicorn catch error name (#984) 2023-10-12 11:06:46 +01:00
Boshen
903854dac0
refactor(ast): fix the lifetime annotations around Vist and VisitMut (#973) 2023-10-10 17:05:48 +08:00
Boshen
ef8aaa7bf1
feat(minifier): re-enable mangler (#972) 2023-10-10 14:32:58 +08:00
Boshen
0fcad27515 use enter / leave scope from ast visit in SemanticBuilder 2023-10-09 09:59:14 +08:00
Boshen
55b2f031df
feat(minifier): partially re-enable minifier (#963)
closes #949
closes #950
closes #951

All minifier tests are disable from this PR.

We are going to fix the compilation errors first, then the behavioral
errors.
2023-10-08 11:06:42 +08:00
Boshen
817f8c295e
ci: turn off doc tests because they are slow to compile and run (#961) 2023-10-07 17:01:23 +08:00
Don Isaac
b4b39b8aa6
test(semantic): add scoping test cases (#954)
Add test cases to `oxc_semantic` that check scope flag behavior.

Also contains these tweaks:
- fix: allow disabling `with_module` on `SourceType`
- refactor: move `SymbolTester` to a separate file
- chore: add `Expect` trait & implement it on `SymbolTester`
2023-10-03 18:16:01 +13:00
cin
24539545a9
feat(linter): add no-redeclare rule. (#683)
Close: #615 #520 
Rule: [Docs](https://eslint.org/docs/latest/rules/no-redeclare)
2023-09-23 23:54:54 +12:00
Wenzhe Wang
0f02d3783c
fix(semantic): make ExportDeclaration span accurate (#928) 2023-09-17 14:11:25 +00:00
Boshen
38bbc96fb0
Release oxc v0.2.0 2023-09-14 23:41:44 +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
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
75d928a20d feat(syntax): add loaded_modules to ModuleRecord 2023-09-07 22:56:09 +08:00
Boshen
ee54575ec1
feat(linter): add runner for import-plugin (#858) 2023-09-06 14:54:19 +08:00
Boshen
deb50e1a25
chore(semantic): return Arc<ModuleRecord> from semantic 2023-09-03 15:41:11 +08:00
Boshen
ba54eb67b3
chore(semantic): use Arc<ModuleRecord> 2023-09-03 15:29:00 +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
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
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
Boshen
1f27426570
Release crates as v0.1.1 2023-08-26 17:53:11 +08:00
Yunfei He
e7c2313817
feat(ast): add SymbolId and ReferenceId (#755)
Closes #510
2023-08-19 18:09:47 +08:00
Boshen
2f48bdf26f
fix(parser,semantic): make semantic own Trivias (#711)
closes #708

Making the parser return Rc<Trivias> is not a good API, and ideally
`Semantic` should just own `Trivias` so it can process or mutate it.
2023-08-10 15:30:32 +08:00
Don Isaac
38fb4c296a
test(semantic): test harness (#679)
A test harness for checking results of semantic analysis.

I got tired of writing ad-hoc test cases when finding bugs in semantic
analysis, so I made this.
2023-08-07 10:43:05 +08:00
Makoto Tateno
c5ff534b08
feat(semantic): add node_id to Reference (#689)
Closes #685 

Intend to use this in the following ways in #672.
```rs
let node = ctx.nodes().get_node(reference.node_id());
if !self.type_of && has_typeof_operator(node, ctx) {
    return;
}
```
2023-08-05 12:45:22 +08:00
EliLichtblau
5e54bd0537
Adding types to the symbol table - consistent export type sample rule implemented (#667)
Fixes 11 TS conformance tests and 18 babel tests.

Adds types to the symbol table functionally conformant to TS behavior
but symbol flags implemented slightly differently.

Symbol redeclaration check is also not entirely conformant but fixing
this seems like a separate PR.

For testing purposes - consistent-export-type was also implemented
(WIP).
2023-07-31 12:33:47 +08:00
Don Isaac
d3accc1ee3
fix(semantic): nested references (#661)
Addresses #660
2023-07-31 12:29:15 +08:00
Boshen
1012d8300c
chore: release crates as v0.1.0 2023-07-27 13:54:17 +08:00
Boshen
d587065436
chore(rust): update crate info, add minimal rust-version, add categories 2023-07-27 13:33:18 +08:00
Matthew "strager" Glazar
ad00720d75 refactor: avoid unstable let_chains
The let_chains Rust feature is unstable, preventing Oxc from using a
stable Rust compiler. Refactor the code to avoid let_chains.
2023-07-27 09:44:57 +08:00
Don Isaac
87e65ac0f7
refactor(semantic): symbol declarations and references (#594) 2023-07-24 10:55:56 +08:00
Boshen
2e32140450
publish: bump all crates to v0.0.7 2023-07-06 14:27:13 +08:00
Boshen
e25f6e2dd4
chore(rust): rust cargo fmt and fix clippy warnings 2023-07-04 15:41:30 +08:00
Boshen
17a73b1eef
refactor(ast): move ModuleRecord to oxc_syntax 2023-07-03 22:54:27 +08:00
Boshen
c5402c1cae
feat(linter): implement no-import-assign (nursery) 2023-07-01 11:20:31 +08:00
Predrag Gruevski
e468cae404
Replace [dev_dependencies] with newer [dev-dependencies] syntax. (#501) 2023-06-30 10:38:08 +08:00
Boshen
2ad1339b4e
feat(linter): implement require_yield 2023-06-28 22:24:30 +08:00
Boshen
662229ab69
refactor(semantic): use std::cell:OnceCell instead of the crate version 2023-06-26 21:48:55 +08:00
Yagiz Nizipli
3656802fd4
feat: add eslint no-setter-return rule (#434)
Co-authored-by: Boshen <boshenc@gmail.com>
2023-06-24 22:08:41 +08:00
Maneren
b31819d7a1
feat(cli): Basic recursive implementation of module based linting (#468) 2023-06-23 08:26:05 +08:00
Boshen
19b839efe9
perf(semantic): use IndexVec instead of indextree for ast nodes (#462) 2023-06-20 15:21:58 +08:00
Boshen
d30735677b
refactor(semantic): merge semantic2 crate into semantic crate (#460) 2023-06-19 20:20:59 +08:00
Boshen
57a2706c21
refactor(semantic): remove the unused mangler from oxc_semantic 2023-06-12 21:35:16 +08:00
Boshen
0dc6e025a1
refactor(semantic): move ScopeId and ScopeFlags to oxc_syntax 2023-06-12 21:10:38 +08:00
Boshen
dcb38f2277
refactor(semantic): move SymbolId and SymbolFlags to oxc_syntax 2023-06-12 20:55:16 +08:00
Boshen
664ff0cc17
fix(semantic): fix typos s/resovling/resolving 2023-06-09 10:33:48 +08:00
Boshen
180eac5523
refactor(rust): fix clippy errors 2023-06-02 10:09:32 +08:00
Boshen
a31c7ac77a
refactor(index): use static_assertions 2023-05-24 22:53:11 +08:00
Boshen
30fc21ce54
refactor(index): use index_vec crate (#383) 2023-05-24 21:45:06 +08:00