Boshen
6670d94708
chore(rust): remove unnecessary clippy::non_upper_case_globals ( #1557 )
2023-11-27 14:31:38 +08:00
Shannon Rothe
0115314cf4
feat(ast/semantic): parse jsdoc on PropertyDefinition ( #1517 )
...
This should be enough to handle jsdoc comments on class
properties/fields.
See #1506
2023-11-23 18:30:14 +08:00
Boshen
128406a8ab
Rust v1.74.0 ( #1357 )
2023-11-16 15:21:45 +00:00
Boshen
be043c37e9
refactor(ast): VariableDeclarationKind::to_string -> as_str ( #1321 )
2023-11-14 15:28:13 +00:00
Boshen
5f316626f6
feat(prettier): add the basics of comment printing ( #1313 )
2023-11-14 12:32:03 +00:00
Dunqing
446ba169de
feat(ast): add to_string function to VariableDelcartionKind ( #1303 )
...
feat(ast): add to_string function to VariableDelcartionKind
fix: lint error
2023-11-14 20:22:56 +08:00
Boshen
203cf37695
feat(transformer/react): read comment pragma @jsxRuntime classic / automatic ( #1133 )
...
closes #1120
2023-11-03 11:10:11 +08:00
Boshen
69150d812c
refactor(transformer): move Semantic into Transformer ( #1130 )
2023-11-02 13:10:15 +08:00
Boshen
af1a76bafa
feat(transformer): implement some of needs_explicit_esm for typescript ( #1047 )
...
Co-authored-by: magic-akari <akari.ccino@gmail.com>
2023-10-24 17:30:01 +08:00
Boshen
a442fad3b7
feat(semantic): bind function expression name ( #1049 )
...
closes #1018
We'll eventually recover the mangling tests, which should cover this
change.
2023-10-24 17:25:12 +08:00
Cameron
c4a2084f27
fix(linter) Fix panic when linting declaration files ( #1014 )
...
When linting declaration files, it panics here
6628fc8d9c/crates/oxc_linter/src/rules/eslint/no_global_assign.rs (L57)
with this error:
```
index out of bounds: the len is 0 but the index is 0
```
Because it expects the array to have the root scope id inside (non zero
len)
0fcad27515/crates/oxc_semantic/src/scope.rs (L52-L54)
2023-10-21 09:25:32 +08:00
Boshen
dfee8539f0
feat(transformer): add utils to make logical_assignment_operators pass ( #1017 )
2023-10-20 16:27:23 +08:00
Boshen
678db1d955
feat(transformer): ES2020 Nullish Coalescing Operator ( #1004 )
...
The test runner needs an update for reading options.jon, which I'll work
on in the up coming PR.
2023-10-16 21:45:58 +08:00
Boshen
0f72066f2e
feat(transformer): finish 2016 exponentiation operator ( #996 )
2023-10-16 09:30:04 +08:00
Boshen
1661385c1a
feat(semantic): check non-simple lhs expression of assignment expression ( #994 )
2023-10-14 23:40:10 +08:00
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
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
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
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
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
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
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
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