Dunqing
d8864c15b0
fix(tasks/transform_conformance): only the filtered test cases should be included when passing a filter ( #1197 )
2023-11-08 17:03:01 +08:00
Dunqing
7d85492a03
feat(transformer/react-jsx): support the sourceType is a script ( #1192 )
2023-11-08 15:15:00 +08:00
Dunqing
28c0b85646
feat(transformer/react-jsx): support @jsxFrag annotation ( #1189 )
2023-11-08 11:35:40 +08:00
Dunqing
633c469d2d
feat(transformer/react-jsx): support @jsx annotation ( #1182 )
2023-11-07 20:30:26 +08:00
Dunqing
3cb7c0b199
feat(transformer/react-jsx): support pragmaFrag option ( #1181 )
2023-11-07 10:34:15 +00:00
Dunqing
4ed0813f9b
feat(transformer/react-jsx): support pragma option ( #1180 )
2023-11-07 18:26:54 +08:00
Dunqing
bf23d87848
feat(transformer/react-jsx): support @jsxImportSource annotation ( #1179 )
2023-11-07 17:29:38 +08:00
Dunqing
f0e452a599
feat(transformer): support importSource option in react_jsx ( #1115 )
2023-11-07 16:42:08 +08:00
Wenzhe Wang
6a03775c49
chore(benchmark): reopen jest and jsx-a11y for benchmark ( #1169 )
2023-11-07 10:48:16 +08:00
Boshen
38c90db0fe
ci: check unused dependencies via cargo machete ( #1143 )
2023-11-04 14:45:44 +00:00
Wenzhe Wang
f71cb9f1da
feat(transform): support TemplateLiteral of babel/plugin-transform-template-literals ( #1132 )
...
Co-authored-by: Boshen <boshenc@gmail.com>
2023-11-03 22:19:44 +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
Trevor Manz
8f5e9831df
feat(rulegen): Add jsx-a11y rulegen ( #1119 )
...
Adds the `just new-jsx-a11y-rule` for bootstrapping
`eslint-plugin-jsx-a11y` linting rules.
One tricky thing about the tests in that repo is that the aren't
provided as array expressions
(e.g., `[case0, case1, case2, ...]`) but rather separate arguments to
`[].concat()`
(e.g., `[].concat(case0, case1, case2, ...)`). There is probably a more
elegant way to match
these expressions, but this is what I came up with.
The other thing I introduced in this PR is prefer Rust's raw strings
(`r#`) when generating the
test cases. Sometimes running `just new-*` spit out unescaped back
quotes, which caused issues.
2023-10-31 13:18:48 +08:00
Wenzhe Wang
8105ee5872
feat(tasks): skip cases start with dot ( #1114 )
...
0effd92d88/packages/babel-helper-fixtures/src/index.ts (L223)
2023-10-30 23:34:43 +08:00
Boshen
a455c81db6
fix(linter): revert changes to JSX attribute strings ( #1101 )
2023-10-30 15:26:04 +08:00
dependabot[bot]
bf1e3b5440
chore(deps): bump the dependencies group with 4 updates ( #1100 )
2023-10-30 15:09:28 +08:00
Boshen
262631da62
feat(transformer/react): implement fixup_whitespace_and_decode_entities ( #1091 )
2023-10-29 18:11:51 +08:00
Boshen
fe1bbaf0d4
chore(codegen): update snapshot ( #1090 )
2023-10-29 16:04:04 +08:00
Boshen
1051f15005
feat(transformer/jsx): escape xhtml in jsx attributes ( #1088 )
2023-10-29 15:16:50 +08:00
Boshen
1ad2dca45a
fix(transformer/react_jsx): add imports to the top body ( #1087 )
2023-10-29 15:05:52 +08:00
Boshen
e8a4e81298
feat(transformer): implement some of jsx decode entities ( #1086 )
2023-10-29 14:57:39 +08:00
Wenzhe Wang
094dfa5604
feat: support filter exec snap ( #1084 )
...
Co-authored-by: Boshen <boshenc@gmail.com>
2023-10-29 05:39:32 +00:00
Boshen
fe4a5ed535
fix(transformer): fix position of inserted react import statement ( #1082 )
2023-10-28 23:05:02 +08:00
Boshen
0856111bea
feat(transformer): implement more of react transform attributes ( #1081 )
2023-10-28 22:47:39 +08:00
Boshen
96332c85c6
feat(transformer): import jsxs when children is static ( #1080 )
2023-10-28 17:25:25 +08:00
Boshen
c7a04f42e7
refactor(transformer): remove returning None from transform functions ( #1079 )
2023-10-28 16:55:38 +08:00
Boshen
d411258be4
feat(transformer): finish transform jsx attribute value ( #1078 )
2023-10-28 16:46:33 +08:00
Boshen
5fb27fbe8a
feat(transformer): implement key extraction for react automatic ( #1077 )
2023-10-28 16:34:54 +08:00
Boshen
394ed358f6
feat(transformer): implement react get_attribute_name ( #1076 )
2023-10-28 16:25:03 +08:00
Boshen
f60fd65f65
feat(transfomer): implement react has_key_after_props_spread ( #1075 )
2023-10-28 16:17:11 +08:00
Boshen
d6ba8910ba
feat(transformer): add props null to React.createElement ( #1074 )
2023-10-28 15:59:46 +08:00
Boshen
e16e7e44e0
feat(transformer): implement react transform attributes ( #1071 )
2023-10-28 02:12:23 +00:00
Wenzhe Wang
b5bfc361fc
feat(transform): transform jsx element name ( #1070 )
2023-10-27 08:13:40 +08:00
Boshen
d8f1a7fce6
feat(transformer): start implementing react jsx transform ( #1057 )
2023-10-26 17:27:05 +08:00
magic-akari
1b64e48ee1
feat(transformer): strip implicit type import for typescript ( #1058 )
2023-10-26 11:07:30 +08:00
Wenzhe Wang
ae74e08141
chore(tasks): only use bun to run babel exec.js ( #1060 )
2023-10-25 22:33:20 +08:00
Dunqing
8816649e3c
feat(rulegen): escape from “ to \” ( #1059 )
2023-10-25 22:31:09 +08:00
Wenzhe Wang
7192520d2b
feat(transformer_conformance): use bun to run babel exec.js test cases ( #1012 )
...
closes #999
Co-authored-by: Boshen <boshenc@gmail.com>
2023-10-25 03:06:07 +00: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
Boshen
854b55a3e6
feat(codegen): json strings proposal ( #1039 )
2023-10-23 18:29:30 +08:00
Boshen
befc26a440
chore(transform_conformance): remove the duplicated test case
2023-10-23 17:22:27 +08:00
Boshen
a75582046b
refactor(codegen): do not use (code, option) tuple if there are no configurations ( #1038 )
...
closes #1035
2023-10-23 16:40:56 +08:00
Cameron
72cf9ec725
chore(rulegen) Add rule gen for react rules ( #1023 )
2023-10-21 22:39:19 +08:00
Boshen
d31a667e23
feat(transformer): drop this parameter from typescript functions ( #1019 )
2023-10-20 23:15:06 +08:00
Boshen
5e083b156c
refactor(transform_conformance): remove the Failed: prefix from snapshot
2023-10-20 16:49:04 +08:00
Boshen
4c4ccc6577
feat(transform_conformance): remove legacy decorator tests
2023-10-20 16:47:58 +08:00
Boshen
dfee8539f0
feat(transformer): add utils to make logical_assignment_operators pass ( #1017 )
2023-10-20 16:27:23 +08:00
Boshen
46a5c42c75
refactor(transformer): add TransformerCtx struct for easier access to symbols and scopes
2023-10-19 16:19:27 +08:00
Boshen
4b719026bf
feat(transform_conformance): handle non-existent output.js ( #1007 )
2023-10-17 20:44:35 +08:00
Boshen
052661d75e
refactor(transform_conformance): improve report format
2023-10-17 17:41:34 +08:00
Boshen
3605f7c0fc
fix(transform_conformance): fix for codecov
2023-10-17 15:34:50 +08:00
Boshen
1b3b100475
feat(transformer_conformance): read plugins options from babel options.json ( #1006 )
...
This PR correctly handles babel `options.json` such as
https://github.com/babel/babel/blob/main/packages/babel-plugin-transform-nullish-coalescing-operator/test/fixtures/assumption-noDocumentAll/options.json
2023-10-17 14:52:51 +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
Wenzhe Wang
0e9104477f
feat: adjust the order of print semicolon ( #1003 )
...
Add a number of semicolons to our minifier test cases.
2023-10-16 21:33:15 +08:00
Boshen
eaeb63072f
refactor(clippy): allow struct_excessive_bools
2023-10-16 15:18:07 +08:00
Boshen
c060621512
feat(transformer): add unit tests and test coverage ( #1001 )
2023-10-16 14:07:29 +08:00
Boshen
cc6c52e536
fix(benchmark): bench the whole transformation pipeline ( #998 )
2023-10-16 13:17:15 +08:00
Boshen
0f72066f2e
feat(transformer): finish 2016 exponentiation operator ( #996 )
2023-10-16 09:30:04 +08:00
Wenzhe Wang
6c18b3e8ec
feat(codegen): beauty class print ( #995 )
2023-10-15 16:37:01 +08:00
Boshen
1661385c1a
feat(semantic): check non-simple lhs expression of assignment expression ( #994 )
2023-10-14 23:40:10 +08:00
Boshen
801d78a3c6
refactor(minifier): make the minifier api only accept an ast ( #990 )
2023-10-14 00:51:29 +08:00
Boshen
f32bf27106
fix(codegen): fix some typescript codegen problems ( #989 )
2023-10-13 16:23:48 +08:00
Boshen
b9d0d57fa2
feat(transform_conformance): improve how snapshot is displayed
2023-10-13 13:44:45 +08:00
Boshen
a6ea901254
feat(coverage): add typescript to codegen tests ( #988 )
2023-10-13 13:42:54 +08:00
Boshen
e0ca09b1c9
feat(codegen): implement the basics of non-minifying codegen ( #987 )
2023-10-13 13:34:21 +08:00
Boshen
ce79bc12ab
feat(transform_conformance): move Formatter to codegen ( #986 )
2023-10-12 15:13:14 +08:00
Boshen
809f050a5f
feat(codegen): move minifying printer to codegen crate ( #985 )
2023-10-12 14:56:30 +08:00
Boshen
8c12dff8a3
perf: speed tasks run by using a global allocator
2023-10-11 20:30:30 +08:00
magic-akari
dc08c949a2
feat(transformer): RegexpFlags ( #977 )
...
Co-authored-by: Boshen <boshenc@gmail.com>
2023-10-11 07:15:19 -05:00
Boshen
eaa0c58e24
feat(linter): eslint-plugin-unicorn(filename-case) ( #978 )
2023-10-11 15:23:17 +08:00
Boshen
d5fb3d43ab
chore(coverage): remove regex-v-flag feature from parser tests ( #975 )
...
A regex parser is required to implement this.
Relates #385
2023-10-11 06:18:22 +08:00
Boshen
822f4e1468
chore: remove tasks/transform_conformance/README.md
...
use issue instead https://github.com/web-infra-dev/oxc/issues/974
2023-10-10 21:01:34 +08:00
Boshen
903854dac0
refactor(ast): fix the lifetime annotations around Vist and VisitMut ( #973 )
2023-10-10 17:05:48 +08:00
Boshen
c38a00b453
chore(minsize): disable the test as it is broken right now
2023-10-10 15:53:55 +08:00
Boshen
ef8aaa7bf1
feat(minifier): re-enable mangler ( #972 )
2023-10-10 14:32:58 +08:00
Wenzhe Wang
09df8e609a
feat(transform): sticky-regex ( #968 )
2023-10-09 19:12:14 +08:00
dependabot[bot]
4ce525c66d
chore(deps): bump the dependencies group with 4 updates ( #970 )
...
Bumps the dependencies group with 4 updates:
[num-traits](https://github.com/rust-num/num-traits ),
[proc-macro2](https://github.com/dtolnay/proc-macro2 ),
[syn](https://github.com/dtolnay/syn ) and
[similar](https://github.com/mitsuhiko/similar ).
Updates `num-traits` from 0.2.16 to 0.2.17
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-num/num-traits/blob/master/RELEASES.md ">num-traits's
changelog</a>.</em></p>
<blockquote>
<h1>Release 0.2.17 (2023-10-07)</h1>
<ul>
<li><a
href="https://redirect.github.com/rust-num/num-traits/pull/286 ">Fix a
doc warning about custom classes with newer rustdoc.</a></li>
</ul>
<p><strong>Contributors</strong>: <a
href="https://github.com/robamu "><code>@robamu</code></a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="0a27d8c95a "><code>0a27d8c</code></a>
Merge <a
href="https://redirect.github.com/rust-num/num-traits/issues/289 ">#289</a></li>
<li><a
href="34e309a918 "><code>34e309a</code></a>
Release 0.2.17</li>
<li><a
href="ef36d69f7c "><code>ef36d69</code></a>
Merge <a
href="https://redirect.github.com/rust-num/num-traits/issues/286 ">#286</a></li>
<li><a
href="d9d94f8a51 "><code>d9d94f8</code></a>
Bugfix for text codeblock in documentation.</li>
<li>See full diff in <a
href="https://github.com/rust-num/num-traits/compare/num-traits-0.2.16...num-traits-0.2.17 ">compare
view</a></li>
</ul>
</details>
<br />
Updates `proc-macro2` from 1.0.67 to 1.0.69
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/proc-macro2/releases ">proc-macro2's
releases</a>.</em></p>
<blockquote>
<h2>1.0.69</h2>
<ul>
<li>Fix Span::source_text() bug causing panics or incorrect source text
(<a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/410 ">#410</a>)</li>
</ul>
<h2>1.0.68</h2>
<ul>
<li>Fix panic in Span::source_text() when source contains multibyte
characters (<a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/408 ">#408</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="937bbcdcc1 "><code>937bbcd</code></a>
Release 1.0.69</li>
<li><a
href="42dc36efce "><code>42dc36e</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/412 ">#412</a>
from dtolnay/sourcetext</li>
<li><a
href="6461c2dd60 "><code>6461c2d</code></a>
Add out-of-order call to source_text test</li>
<li><a
href="c4c3251c57 "><code>c4c3251</code></a>
Explain source_text implementation approach</li>
<li><a
href="31b14c30f2 "><code>31b14c3</code></a>
Cache byte offsets computed from a char index</li>
<li><a
href="0e154618a1 "><code>0e15461</code></a>
Make FileInfo mut in source_text to allow amortization of char
indices</li>
<li><a
href="90b8e1eb01 "><code>90b8e1e</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/411 ">#411</a>
from dtolnay/sourcetext</li>
<li><a
href="137ae0a341 "><code>137ae0a</code></a>
Fix source_text treating span.lo as byte offset not char index</li>
<li><a
href="4c0bd28a61 "><code>4c0bd28</code></a>
Add regression test for issue 410</li>
<li><a
href="12eddc03a4 "><code>12eddc0</code></a>
Reword explanation of SourceMap initial value</li>
<li>Additional commits viewable in <a
href="https://github.com/dtolnay/proc-macro2/compare/1.0.67...1.0.69 ">compare
view</a></li>
</ul>
</details>
<br />
Updates `syn` from 2.0.37 to 2.0.38
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/syn/releases ">syn's
releases</a>.</em></p>
<blockquote>
<h2>2.0.38</h2>
<ul>
<li>Fix <em>"method 'peek' has an incompatible type for
trait"</em> error when defining <code>bool</code> as a custom
keyword (<a
href="https://redirect.github.com/dtolnay/syn/issues/1518 ">#1518</a>,
thanks <a
href="https://github.com/Vanille-N "><code>@Vanille-N</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="43632bfb6c "><code>43632bf</code></a>
Release 2.0.38</li>
<li><a
href="abd2c214b4 "><code>abd2c21</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/syn/issues/1518 ">#1518</a>
from Vanille-N/master</li>
<li><a
href="6701e6077e "><code>6701e60</code></a>
Absolute path to <code>bool</code> in
<code>custom_punctuation.rs</code></li>
<li><a
href="7313d24239 "><code>7313d24</code></a>
Resolve single_match_else pedantic clippy lint in code generator</li>
<li><a
href="67ab64f3c0 "><code>67ab64f</code></a>
Include unexpected token in the test failure message</li>
<li><a
href="137ae33486 "><code>137ae33</code></a>
Check no remaining token after the first literal</li>
<li><a
href="258e9e8a11 "><code>258e9e8</code></a>
Ignore single_match_else pedantic clippy lint in test</li>
<li><a
href="92fd50ee8c "><code>92fd50e</code></a>
Test docs.rs documentation build in CI</li>
<li>See full diff in <a
href="https://github.com/dtolnay/syn/compare/2.0.37...2.0.38 ">compare
view</a></li>
</ul>
</details>
<br />
Updates `similar` from 2.2.1 to 2.3.0
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/mitsuhiko/similar/blob/main/CHANGELOG.md ">similar's
changelog</a>.</em></p>
<blockquote>
<h2>2.3.0</h2>
<ul>
<li>Added support for <code>Change::value_ref</code> and
<code>Change::value_mut</code>.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="47f46257d4 "><code>47f4625</code></a>
2.3.0</li>
<li><a
href="3319f77693 "><code>3319f77</code></a>
Downgrade msrv lock file</li>
<li><a
href="d21e126057 "><code>d21e126</code></a>
Use Cargo.lock.msrv</li>
<li><a
href="86f68a6394 "><code>86f68a6</code></a>
Make clippy happy</li>
<li><a
href="e85ddb0d18 "><code>e85ddb0</code></a>
Added value_ref and value_mut</li>
<li><a
href="de455873da "><code>de45587</code></a>
Spelling and grammar fixes (<a
href="https://redirect.github.com/mitsuhiko/similar/issues/49 ">#49</a>)</li>
<li><a
href="9f76d88c3d "><code>9f76d88</code></a>
fix some english things (<a
href="https://redirect.github.com/mitsuhiko/similar/issues/48 ">#48</a>)</li>
<li><a
href="e575b88ca1 "><code>e575b88</code></a>
Update GitHub Actions CI (<a
href="https://redirect.github.com/mitsuhiko/similar/issues/47 ">#47</a>)</li>
<li><a
href="ae815d13ea "><code>ae815d1</code></a>
Remove mention of Hunt–McIlroy / Hunt–Szymanski</li>
<li>See full diff in <a
href="https://github.com/mitsuhiko/similar/compare/2.2.1...2.3.0 ">compare
view</a></li>
</ul>
</details>
<br />
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-09 14:56:00 +08:00
Boshen
7e84369cad
refactor(resolver): move tests folder to fixtures ( #964 )
2023-10-08 13:29:02 +08:00
magic-akari
9ad2634091
feat(transformer): Class Static Block ( #962 )
2023-10-08 08:16:40 +08:00
magic-akari
21066a9ad7
feat(transformer): Shorthand Properties ( #960 )
2023-10-07 17:02:45 +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
Boshen
b46f34e096
chore: bump submodules and snapshots
2023-10-06 16:15:35 +13:00
Cameron
5b1e1e5408
feat(parser): TypeScript 5.2 ( #811 )
...
- adds support for [Using
Declarations](https://devblogs.microsoft.com/typescript/announcing-typescript-5-2/#using-declarations-and-explicit-resource-management )
Closes #786
2023-10-05 12:52:14 +13:00
IWANABETHATGUY
266253c142
fix: ts parsing error ( #940 )
...
Fixed https://github.com/web-infra-dev/oxc/issues/932
2023-09-29 22:02:56 +13:00
Boshen
8553817bc9
chore(transform_conformance): update test cases and README regarding regex
2023-09-18 17:49:36 +08:00
Boshen
5973e5aede
feat(transformer): setup typescript and react transformers ( #930 )
2023-09-18 16:56:41 +08:00
Boshen
46d2623c1f
feat(transform_conformance): add jsx and ts tests
2023-09-18 15:35:02 +08:00
Boshen
4e036630ed
feat(transform_conformance): add all babel tests
2023-09-17 09:56:13 +08:00
Boshen
5863f8ffdb
feat(transformer): logical assignment operators ( #923 )
2023-09-16 23:54:53 +08:00
Boshen
1bb649243a
feat(transformer_conformance): group tests in the snapshot ( #922 )
2023-09-16 21:29:21 +08:00
Boshen
7172953fe9
feat(transformer_conformance): snapshot passed and failed tests ( #921 )
2023-09-16 20:58:31 +08:00
Boshen
8f59eb0960
chore(transformer): add feature list to README
2023-09-16 18:51:00 +08:00
Boshen
f4cea34534
feat(transformer): add babel conformance test suite ( #920 )
2023-09-16 18:50:51 +08:00
Boshen
540fa03ec0
feat(benchmark): add transformer benchmark ( #919 )
2023-09-16 17:09:27 +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
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
a9d36f158f
chore(benchmark): turn on all lints ( #892 )
...
closes #888
2023-09-10 23:16:39 +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
7c8e6ab6f6
fix(parser): parse [+In] in object binding initializer ( #874 )
...
closes #873
2023-09-09 14:54:20 +08:00
Boshen
a6db5e696c
chore(resolver): add more alias data to benchmark ( #868 )
2023-09-08 00:08:26 +08:00
Boshen
ee54575ec1
feat(linter): add runner for import-plugin ( #858 )
2023-09-06 14:54:19 +08:00
Boshen
4ada0ecbb8
chore(resolver): add more benchmark data ( #853 )
2023-09-04 22:02:48 +08:00
dependabot[bot]
5defa2fa96
chore(deps): bump the dependencies group with 6 updates ( #852 )
2023-09-04 15:46:27 +08:00
Boshen
da44fd8999
feat(benchmark): add linter benchmark ( #842 )
2023-09-03 09:55:01 +08:00
Boshen
53b094e46c
chore: clean up deps ( #840 )
2023-09-02 21:34:24 +08:00
Boshen
2ba18e073c
fix(benchmark): use different data sets for benchmark and minifier test
2023-09-02 20:56:45 +08:00
Boshen
56aaf31fb1
refactor(benchmark): use codspeed for all benchmarks ( #839 )
2023-09-02 20:35:48 +08:00
dependabot[bot]
8caf77300b
chore(deps): bump the dependencies group with 10 updates ( #831 )
2023-09-01 13:56:12 +08:00
Boshen
75af639d4a
chore(rust): remove unicode support from regex for smaller binary size ( #823 )
2023-09-01 12:42:58 +08:00
Boshen
00ed939cbc
feat(coverage): init git submodules if they are empty ( #808 )
...
closes #805
2023-08-29 13:35:32 +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
阿良仔
0fef2d317a
chore: proxy detection for all tasks ( #801 )
...
related PR: #740
2023-08-27 17:24:28 +08:00
Boshen
24c56a8b53
Revert "fix(tasks): use the current working directory if project rood is not found"
...
This reverts commit 971f597036 .
2023-08-25 12:56:12 +08:00
Boshen
971f597036
fix(tasks): use the current working directory if project rood is not found
2023-08-25 12:27:55 +08:00
Boshen
2f0ff28f47
Rust 1.72.0 ( #784 )
2023-08-24 23:02:19 +08:00
Boshen
b2db6f7ef1
chore(benchmark): remove the measurement_time
2023-08-24 14:31:19 +08:00
EYHN
1781318f44
fix(rulegen): handle join('\n') style test code ( #763 )
...
# 1. Support join('\n')
I'm trying to run `just new-rule no-unexpected-multiline`, It found
rulegen not support test code pieced together using `array.json("\n")`,
like
```js
{
code: [
"const x = aaaa<",
" test",
">/*",
"test",
"*/`foo`"
].join("\n")
}
```
I found this kind of code widely in the eslint codebase, so it will be
great if we can support this.

# 2. remove extra `,`
And I found when meet unsupported code, rulegen will generate an extra
`,`, so I added a filter at
45cf5fc3da/tasks/rulegen/src/main.rs (L363)
# 3. handle escape string
The escape `/` and trailing `/` in the javascript code will break
rulegen. example: `"\"abc\\\n(123)\""`
I made the following changes:
```diff
- test_code.replace('\n', "\n\t\t\t")
+ test_code.replace('\n', "\n\t\t\t").replace('\\', "\\\\").replace('\"', "\\\"")
```
2023-08-19 23:19:51 +08:00
Yunfei He
e7c2313817
feat(ast): add SymbolId and ReferenceId ( #755 )
...
Closes #510
2023-08-19 18:09:47 +08:00
阿良仔
5a73f0e1b5
feat(formatter): add EndOfLine ( #747 )
2023-08-17 19:04:23 +08:00
Kei Sakamoto
2fde2255f9
feat(linter): implement eslint-plugin-unicorn/no-instanceof-array ( #752 )
...
implement
[eslint-plugin-unicorn/no-instanceof-array](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-instanceof-array.md ).
Related issue: #684
2023-08-17 17:08:03 +08:00
Devin-Yeung
c0b06a5700
feat(rulegen): automatically detect proxy ( #740 )
...
detect `HTTP_PROXY/HTTPS_PROXY/ALL_PROXY` environments automatically,
since visiting https://raw.githubusercontent.com sometimes need proxy,
upstream PR
[algesten/ureq#649 ](https://github.com/algesten/ureq/pull/649 )
2023-08-15 13:32:09 +08:00
Sg
fae9a7c28b
feat(formatter): add "Quote Props" option ( #652 )
...
For #634 .
This PR prepares for the fix of #634 , adding an option to formatter to
control whether to quote object properties. After this PR, the rulegen
script can use oxc-formatter to output JSON-like object literal.
The `Quote Props` option is from Prettier. For detail:
https://prettier.io/docs/en/options.html#quote-props
> Change when properties in objects are quoted.
> Valid options:
> "as-needed" - Only add quotes around object properties where required.
> "consistent" - If at least one property in an object requires quotes,
quote all properties.
> "preserve" - Respect the input use of quotes in object properties.
---------
Co-authored-by: Don Isaac <donald.isaac@gmail.com>
2023-08-15 11:40:38 +08:00
Devin-Yeung
a041fbd96b
fix(rulegen): import thiserror correctly ( #735 )
...
close #734
2023-08-14 10:20:25 +08:00
Wenzhe Wang
0c645170a8
feat(linter): valid-describe-callback(eslint-plugin-jest) ( #706 )
2023-08-12 16:47:49 +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
Alexandr Metreniuc
f8358a148a
feat(linter): @typescript-eslint/no-namespace ( #703 )
2023-08-09 23:02:24 +08:00
Wenzhe Wang
de110828cc
fix(task): update taggedTemplateExpression template ( #676 )
...
For generate test cases like:
```js
{
code: dedent`
afterAll(async (done) => {
await myAsyncTask();
done();
});
`,
errors: [{ messageId: 'useAwaitInsteadOfCallback', line: 1, column: 17 }],
},
```
2023-08-02 11:46:15 +08:00
Don Isaac
e7d8d4ba46
feat(linter): enable module record builder
2023-08-02 11:44:27 +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
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
Boshen
a55ba5941c
refactor(benchmark): use iter_with_large_drop ( #587 )
...
This also removes `black_box`, since criterion always black boxes the values for us
2023-07-23 11:35:16 +08:00
Boshen
2330099a34
deps(rust): bump dependencies
2023-07-21 11:38:12 +08:00
Boshen
38e11956be
chore(rust): rust version 1.71.0 nightly
2023-07-13 23:10:10 +08:00
Don Isaac
fd899be4a9
feat(minifier): compress undefined variable declarations ( #532 )
2023-07-10 10:33:42 +08:00
Boshen
e25f6e2dd4
chore(rust): rust cargo fmt and fix clippy warnings
2023-07-04 15:41:30 +08:00
Wenzhe Wang
a0eba67ad9
feat(tasks): support init jest lint rule ( #513 )
2023-07-04 14:53:29 +08:00
Boshen
c5402c1cae
feat(linter): implement no-import-assign (nursery)
2023-07-01 11:20:31 +08:00
Boshen
06764f8574
chore(tasks): add swc-7187 test case
2023-06-30 16:41:52 +08:00
Boshen
9ca942ab2e
fix(tasks): save eslint files to the eslint/ directory
2023-06-28 20:48:51 +08:00
Wenzhe Wang
a32320646d
feat(minfier): try fold and or operator ( #472 )
2023-06-28 14:58:55 +08:00
阿良仔
1182985bb0
feat(minifier): implement try_fold_shift ( #478 )
...
* feat: implement `try_fold_shift`
* update minsize
2023-06-27 04:44:23 +08:00
Wenzhe Wang
cb94937ba6
feat(minifier): fold string string comparison ( #471 )
2023-06-26 22:37:50 +08:00
Wenzhe Wang
b8f5e3ad92
feat(minifier): try reduce void ( #457 )
2023-06-23 00:10:46 +08:00
Boshen
925cee20c1
feat(parser): parse TypeScript this function parameter ( #464 )
2023-06-20 21:56:28 +08:00
Boshen
d30735677b
refactor(semantic): merge semantic2 crate into semantic crate ( #460 )
2023-06-19 20:20:59 +08:00
Boshen
0d5db3d2f7
feat(benchmark): add bench semantic
2023-06-19 18:30:30 +08:00
Wenzhe Wang
5d10f96051
feat(minifier): try fold unary expression ( #430 )
2023-06-16 00:08:14 +08:00
u9g
db624da84d
Reimplement more of the closure var rename step ( #447 )
...
Co-authored-by: Boshen <boshenc@gmail.com>
closes #442
2023-06-15 23:37:04 +08:00
Boshen
bad8bfcf16
ci: run conformance tests and bail if there are outdated snapshots ( #444 )
2023-06-14 21:44:10 +08:00
Boshen
a79480b078
feat(minifier): separate mangler pass ( #439 )
2023-06-14 10:46:13 +08:00
Carter Snook
c0726e444f
feat(lexer): use linear lexing on WASM ( #436 )
...
Co-authored-by: Boshen <boshenc@gmail.com>
2023-06-13 15:18:02 +08:00
Boshen
243e48ac09
fix(coverage): make ignoring "literals/regexp" work on Windows
2023-06-13 14:31:59 +08:00
Carter Snook
a518bcbb3b
fix(tasks/rulegen): use correct Span import ( #433 )
2023-06-12 11:09:02 +08:00
Boshen
5c91fd54e3
feat(minifier): print [-In] Context ( #428 )
2023-06-11 16:44:48 +08:00
Boshen
b26900f8c4
fix(rulegen): fix ureq not working without tls
2023-06-09 12:43:41 +08:00
Boshen
1ed8df2d83
feat(parser): parse const type parameter from TypeScript v5.0 ( #416 )
2023-06-08 22:26:35 +08:00
Wenzhe Wang
7c79fbc026
feat(minifier): try fold typeof ( #408 )
2023-06-07 10:44:28 +08:00
Wenzhe Wang
ddc129262d
feat(minifer): minify number ( #405 )
2023-06-03 21:24:39 +08:00
Boshen
f8125af850
feat(minimizer): print parentheses
2023-06-01 22:45:26 +08:00
Wenzhe Wang
4109c8b8a5
feat(parser): distinguish exponential number ( #399 )
2023-06-01 15:15:22 +08:00
Boshen
895d26ebf9
chore(coverage): update snapshot
2023-06-01 14:28:00 +08:00
Boshen
6ef839b781
chore(rust): bump deps
2023-05-31 16:34:28 +08:00
Wenzhe Wang
a20d5b55cd
feat(minifier): may add space before binaryOperator ( #380 )
2023-05-27 19:18:06 +08:00
Wenzhe Wang
a0b9628177
feat(minifer): distinguish-op-lessthan ( #391 )
2023-05-27 17:04:54 +08:00
Boshen
829f945479
chore(minifier): add a few passing tests
2023-05-27 12:27:25 +08:00
Boshen
8ea9e38ee5
feat(minifier): remove redundant curly braces from block statements ( #390 )
2023-05-27 10:52:15 +08:00
Boshen
a7f8b66618
chore: bump submodules
2023-05-25 22:48:10 +08:00
Boshen
ee6f18091b
chore(minsize): add newlines in between for better diff
2023-05-25 22:42:11 +08:00
Boshen
c4a67b6cfb
feat(minifier): fold return undefined to return ( #387 )
2023-05-25 22:37:55 +08:00
Boshen
b6d9104a52
chore(coverage): remove catch_unwind
...
There's a stack overflow in one of the files, I think this is one of the cause?
2023-05-25 21:22:00 +08:00
Boshen
c613583544
chore(coverage): bump coverage status
2023-05-25 18:46:48 +08:00
Boshen
4414f3e071
chore(just): add command for updating submodules
2023-05-25 18:40:35 +08:00
Boshen
a31c7ac77a
refactor(index): use static_assertions
2023-05-24 22:53:11 +08:00
Boshen
f5b57944e2
feat(minifier): print shorter numbers ( #381 )
2023-05-24 22:03:50 +08:00
Boshen
1d617e64ff
ci: sleep 15s before running the benchmark ( #382 )
2023-05-24 21:12:33 +08:00
Yoni Feng
c1d1846714
Add Brotli size to minsize task output ( #377 )
2023-05-23 17:00:49 +08:00
Boshen
dee09da60b
feat(minifier): implement peephole reorder constant expression from closure compiler ( #376 )
2023-05-23 12:29:29 +08:00
Boshen
827cef3311
chore(minsize): use default version of flate2 (removes 2 extra dependencies)
2023-05-23 00:32:00 +08:00
Boshen
42dd639e74
chore(minsize): update snapshot
2023-05-22 12:29:52 +08:00
Boshen
bedce7dc65
chore(benchmark): sync js versions to privatenumber/minification-benchmarks
2023-05-22 12:23:24 +08:00
Boshen
009fc5f285
feat(minifier): minify Infinity
2023-05-21 22:01:47 +08:00
Boshen
a8641b9921
chore(parser): move inline tests to snapshot testing
2023-05-21 12:05:25 +08:00
Boshen
ad2835f11b
chore(rustfmt): run cargo fmt
2023-05-21 11:52:26 +08:00
Boshen
fc7a374e7c
feat(coverage): add a directory for tests
...
closes #363
2023-05-20 23:02:30 +08:00
Boshen
df06c3a51a
feat(benchmark): add minifier to benchmark ( #365 )
2023-05-20 22:31:04 +08:00
Boshen
f8828db68c
feat(semantic2): slot based mangler ( #364 )
2023-05-20 19:00:57 +08:00
Wenzhe Wang
9678832f2b
fix: add parens for unary expression ( #362 )
2023-05-17 10:13:48 +08:00
Boshen
a0b09a3f27
refactor(ast): remove RestElement from BindingPattern
2023-05-16 22:25:52 +08:00
Wenzhe Wang
bd56bb7abe
fix(minifier): break directive prologue ( #360 )
2023-05-16 21:35:58 +08:00
Boshen
af95b59a0e
feat(ast): split Property into ObjectProperty and BindingProperty ( #361 )
2023-05-16 15:51:50 +08:00
Boshen
5be0d1b9fa
fix(hir): bring back ParenthesizedExpression as it caused too much chaos
2023-05-14 22:54:57 +08:00
Boshen
dc768ba8ad
feat(minifier): turn on mangle by default
2023-05-14 18:33:29 +08:00
Boshen
2914b439b3
feat(semantic2): add slot based mangler
2023-05-14 18:21:07 +08:00
Wenzhe Wang
e6737fdc48
fix(minifier): continue compress left expr ( #356 )
2023-05-14 13:03:34 +08:00
Boshen
d14329e74e
feat(semantic2): bind identifiers
2023-05-13 22:58:42 +08:00
Boshen
d0bc5ac023
refactor: separate semantic interface
2023-05-13 21:59:42 +08:00
Boshen
6db5f4e59b
fix(minifier): print SequenceExpression and ObjectExpression with parens
2023-05-13 21:57:02 +08:00
Boshen
1f5fa8d6cb
feat: reimplement semantic builder ( #354 )
2023-05-13 15:20:00 +08:00
Wenzhe Wang
7b834d4bd9
fix(minifier): not merge different kinds of declarations. ( #353 )
2023-05-13 10:51:10 +08:00
Boshen
14720e7c69
refactor: move SourceType from oxc_ast to oxc_span ( #351 )
...
related #350
2023-05-12 23:16:14 +08:00
Boshen
ec092eab01
deps(rust): bump dependencies
2023-05-12 11:23:41 +08:00
Boshen
7f93e58f10
chore: remove all #[must_use]
2023-05-11 21:08:00 +08:00
Boshen
7496bb521f
fix(minifier): print if.consequent correctly ( #349 )
2023-05-11 11:00:49 +08:00
Boshen
25a359bdd7
fix(benchmark): fix AstLower benchmark taking up too much memory
2023-05-11 10:42:55 +08:00
Boshen
48e524ddcf
feat(ast_lower): scope tree ( #344 )
2023-05-10 22:38:34 +08:00
Boshen
60485669bb
ci: cache release for benchmark, benchmark use fewer files ( #345 )
2023-05-10 22:13:11 +08:00
Boshen
6924e59c5c
chore: remove unused dependencies found by cargo-machete
2023-05-10 19:22:22 +08:00
Boshen
0a445b4556
chore(coverage): run typescript tests for formatter
2023-05-09 23:19:35 +08:00
Boshen
8161ac2800
refactor: clean up Cargo.toml (put features table on top)
2023-05-09 21:53:47 +08:00
Boshen
e753a886d2
fix(minifier): add parentheses to CallExpression on FunctionExpression
2023-05-08 23:04:35 +08:00
Wenzhe Wang
52aa59bb38
feat(semantic): early check of simple assignment ( #340 )
2023-05-07 23:05:08 +08:00
Boshen
f4d04c1443
refactor(coverage): use ast.json() method for serialization test
2023-05-07 22:23:31 +08:00
Boshen
e897306f3d
chore(coverage): test serialization on ast and hir ( #339 )
2023-05-07 22:05:45 +08:00
Boshen
ddf4ac9cc2
refactor(formatter): remove whitespace minification from formatter ( #337 )
2023-05-07 17:58:57 +08:00
Boshen
c2428d8abd
chore: rename oxc_printer to oxc_formatter ( #336 )
2023-05-07 17:47:13 +08:00
Boshen
e07c9c5b03
chore(benchmark): disable benchmarking ast_lower
2023-05-07 17:23:50 +08:00
Boshen
86c01c7fb8
feat(minifier): use hir ( #335 )
2023-05-07 17:23:00 +08:00
Boshen
72ba29f88b
feat(hir): complete first iteration of ast lowering ( #327 )
2023-05-06 19:13:44 +08:00
Wenzhe Wang
638576c323
fix(ast): replace ArrayElementType ( #330 )
2023-05-04 20:33:58 +08:00
Boshen
38831b3e41
fix(benchmark): parser benchmark should include allocator drop time ( #334 )
2023-05-04 20:26:27 +08:00
Boshen
f0066ea4cc
refactor: unify the usage of std::fmt import
2023-04-27 22:21:59 +08:00
Boshen
cd276c2850
feat: add oxc_span crate ( #323 )
2023-04-27 21:51:15 +08:00
Boshen
1004a1d197
chore: clean up workspace dependencies ( #320 )
2023-04-27 11:38:39 +08:00
Boshen
7aca953635
ci: add cargo deny
2023-04-22 22:35:19 +08:00
Boshen
4801e68b56
chore: bump deps ( #311 )
2023-04-22 22:09:53 +08:00
Boshen
080baaa2db
chore: use taplo to reformat toml files
2023-04-22 15:58:59 +08:00
Boshen
7f946fb75d
chore: bump nightly to nightly-2023-04-20 ( #304 )
2023-04-20 23:35:38 +08:00
Boshen
c14c82b15d
feat(printer,semantic): mangler ( #285 )
...
closes #284
2023-04-18 21:32:35 +08:00
Boshen
4d4fb3ac7f
chore: update submodule and snapshots
2023-04-18 21:12:18 +08:00
Shannon Rothe
20755a969a
feat(cli): add --rules CLI flag ( #290 )
2023-04-18 15:54:44 +08:00
Boshen
92ba59443c
feat(tasks): add minifier coverage test ( #292 )
2023-04-17 21:30:04 +08:00
Boshen
f79f0eb631
refactor(oxc_ast): change SourceType::with_ methods to return Self
2023-04-16 21:32:00 +08:00
Boshen
6d96748e24
fix(coverage): do not run compiler tests in code coverage due to stack overflow
2023-04-15 18:24:38 +08:00
Boshen
4939eeab6a
refactor(oxc_ast): cleanup docs and exports
2023-04-15 18:02:17 +08:00
Boshen
65e8fcd51b
chore(coverage): include conformance tests from the compiler directory
2023-04-15 17:28:25 +08:00
Boshen
cfe3dd0869
chore: rust taplo format
2023-04-15 14:14:11 +08:00
Boshen
f1dcc5429e
refactor(tasks): clean up code around code coverage
2023-04-15 13:53:57 +08:00
Boshen
4c5ece9386
chore(tasks): remove minsize from unit tests as it is too slow
2023-04-15 13:41:52 +08:00
Boshen
919feb2691
fix(coverage): remove jsx tests from babel printing tests
2023-04-15 13:22:09 +08:00
Boshen
6c5db48185
refactor(coverage): change Option<BabelOptions> to BabelOptions
2023-04-15 13:14:44 +08:00
Boshen
b851035293
feat(coverage): add jsx printing tests ( #279 )
...
closes #261
2023-04-15 12:31:37 +08:00
Boshen
ffe12b30bc
chore: change libs CDN from unstable unpkg to stable jsdelivr
2023-04-14 23:27:16 +08:00
Boshen
9eec306818
chore(minifier): add SemanticBuilder to minifier example
...
so we can start measuring perf
2023-04-14 13:21:04 +08:00
Boshen
a7cd845fff
feat: add cargo minsize task for tracking minification size ( #276 )
...
* feat: add `cargo minsize` task for tracking minification size
* add gzip
2023-04-14 13:07:37 +08:00
Boshen
d117ce20a1
refactor(benchmark): add more benchmark files
2023-04-13 22:16:48 +08:00
Boshen
62bb985434
ci: use cargo-llvm-cov for code coverage ( #274 )
2023-04-11 16:03:07 +08:00
Boshen
aedaa1a110
refactor(linter,semantic): move syntax check from linter to semantic ( #272 )
...
Syntax checker is part of semantic analyzer,
it doesn't make sense for the user to add a linter just for semantic errors
2023-04-10 12:23:53 +08:00
Boshen
dc090208c4
fix(parser): fix crashing on empty ParenthesizedExpression with comments ( #263 )
...
relates #232
2023-04-06 17:16:15 +08:00
Boshen
0674899b88
Fuzz async ( #257 )
...
* fix(parser): parse `async(...null)` as call expression
relates #255
* fix(parser): parse `null?async():null`
relates #255
2023-04-05 14:36:37 +08:00
Boshen
1c2acd121c
refactor(parser): clean up parsing of ForStatement ( #251 )
...
closes #176
2023-04-04 22:36:35 +08:00
Boshen
236d53ad9d
fix(parser): fix panic on multi-byte char in ExpectCatchFinally error
2023-04-02 20:09:38 +08:00
Boshen
abcda95e8e
deps: bump deps
2023-04-02 16:48:45 +08:00
Boshen
8833a84840
feat(coverage): read typescript dts option in babel
2023-04-02 16:41:53 +08:00
Boshen
f5c7b3751c
fix(coverage): babel plugin option can be an array
2023-04-02 16:41:53 +08:00
Boshen
7db1643425
fix(parser): allow non-last rest element in ambient contexts
2023-04-02 16:41:53 +08:00
Boshen
be9b3f9acc
feat(coverage): add babel parser option allow_return_outside_function
2023-04-02 16:41:53 +08:00
Boshen
e6079a1b4e
feat(coverage): read jsx attribute from typescript files
2023-04-02 16:41:53 +08:00
Boshen
adedc1a405
feat(parser): parse jsx element and fragment in JSXAttributeValue
2023-04-02 16:41:53 +08:00
Boshen
1130f48278
feat(parser): parse ts satisfies operator
2023-04-02 16:41:53 +08:00
Boshen
90e2d386d7
fix(parser): do not check static prototype in ambient contexts
2023-04-02 16:41:53 +08:00
Boshen
a62c9335a2
fix(parser): fix remaining errors around auto accessors
2023-04-02 16:41:53 +08:00
Boshen
adef772d6c
refactor: clean up code around code coverage
2023-04-01 15:59:42 +08:00
Boshen
174330561c
fix(parser): fix panic on multi-byte characaters ( #233 )
...
* fix(oxc_parser): fix panic when EOF on a multi-byte character
relates #232
* fix(parser): fix panic on multi-byte char in private identifer
relates #232
2023-04-01 13:34:18 +08:00
Boshen
4ccb9e806b
chore(coverage): remove mention of git submodule update --remote in README
...
We want people to use --init.
2023-04-01 10:57:25 +08:00
Boshen
f8790d4b89
feat(semantic): can turned off ModuleRecordBuilder
...
relates to #224
2023-04-01 00:41:52 +08:00
Boshen
05f163f2f7
fix(coverage): fix lint on cfg feature
2023-04-01 00:02:58 +08:00
Boshen
d232199e1c
refactor(parser): return Rc<Trivias> from TriviaBuilder ( #231 )
...
closes #229
2023-03-31 09:02:48 -07:00
Boshen
1a6f508bb9
ci: add codecov
2023-03-31 22:59:14 +08:00
Boshen
de9be97f0f
chore: clean up Cargo.toml in tasks
2023-03-31 22:22:18 +08:00
Boshen
9e3675a575
chore: clean up Cargo.toml
2023-03-30 23:27:26 +08:00
yangchenye
929b0efebb
feat(linter): implement isolated_declaration ( #209 )
...
* feat(linter): implement isolated_declaration
* Implement check for class elements
* Set up Export SymbolFlag and store declaration AST in Symbol
* Fix tests and comments
2023-03-26 04:37:10 -07:00
Boshen
5a1a72204e
chore(coverage): update snapshots
2023-03-25 14:21:22 +08:00
Boshen
d095d45818
refactor(semantic): add source_text and trivias to semantic
2023-03-25 14:19:53 +08:00
yangchenye
40460dd32b
feat(rulegen): fallback to empty rule template ( #208 )
2023-03-24 22:36:11 -07:00
Xuan
71e575ab41
feat(linter): implement no-new-symbol rule ( #201 )
2023-03-23 18:29:57 +08:00
yangchenye
0d8d67b593
feat(linter): implement eslint(no-const-assign) ( #199 )
...
* feat(linter): implement eslint(no-const-assign)
* feat(semantics & linter): resolve symbols
* Use run_on_symbol
* Add resolved_reference to SymbolTable
2023-03-23 12:55:40 +08:00
Boshen
7dfaf9949c
chore(README): clean up sentences with chatGPT
2023-03-22 20:34:07 +08:00
Boshen
9dfd4cd936
chore(rust): remove unnecessary missing_const_for_fn
2023-03-22 12:35:52 +08:00
Boshen
ff9a2c3ab0
feat(linter): eslint disable comments ( #196 )
...
feat(linter): eslint disable comments
closes #100
closes #170
2023-03-22 11:27:42 +08:00
yangchenye
3487772644
feat(linter): implement eslint(no-dupe-class-members) ( #195 )
2023-03-21 12:43:23 +08:00
Boshen
69109286b5
chore(README): mention stage 3 skipped tests.
2023-03-19 12:47:57 +08:00
yangchenye
4549fb3cdd
fix(parser): parse decorator with separate grammar ( #192 )
2023-03-19 11:35:59 +08:00
Boshen
37c7b7a752
refactor(oxc_parser): simply diagnostic messages
2023-03-18 14:39:44 +08:00
Boshen
6a89f085b7
refactor(rust): add more clippy restriction rules
2023-03-17 14:51:25 +08:00
Boshen
a1315e3999
refactor(rust): add clippy::clone_on_ref_ptr
2023-03-17 14:51:25 +08:00
Boshen
57f3065d68
refactor: remove unused #[allow(clippy:..)]
2023-03-17 13:28:06 +08:00
Boshen
bee548b945
fix(coverage): correct the number on AST Parsed
2023-03-17 11:15:33 +08:00
Boshen
97d01b4ced
chore(coverage): remove stage 3 decorators from conformance tests
...
By looking at the grammar, separate AST nodes need to be created.
Disabling this for now because it still looks like a mess for now.
2023-03-17 10:30:18 +08:00
Boshen
9ed682a38e
fix(semantic): fix function redeclaration errors
...
The problem here we face here is that TypeScript does not consider Annex
B.3.2, which makes implementation a bit more difficult.
This implementation conforms to test262.
2023-03-17 10:06:02 +08:00
yangchenye
37ad6f3a15
feat(parser): support decorators in class expression ( #190 )
...
feat(parser): support decorator in class expression
2023-03-17 09:33:04 +08:00
Boshen
164c2831e1
feat(linter): report export errors in javascript
2023-03-15 18:12:34 -07:00
Boshen
326de5006b
chore: bump submodules
2023-03-15 12:46:21 +08:00
yangchenye
aaaefc8ba5
feat(linter): implement eslint(no-unsafe-negation) ( #186 )
2023-03-15 11:36:56 +08:00
yangchenye
74c731c415
feat(linter): Implement eslint(no-compare-neg-zero) ( #185 )
2023-03-15 10:44:11 +08:00
Xuan
e4d5202f52
fix(rulegen): convert the rule name to underscore case for filenames ( #177 )
2023-03-14 11:26:27 +08:00
Boshen
e262e18e5f
chore(coverage): remove tests for stage 3 proposal-json-modules
2023-03-14 11:02:00 +08:00
Boshen
ee31f5cc6f
feat(linter): check duplicated bound names in ImportDeclaration
2023-03-14 10:42:18 +08:00
Boshen
89f28e9f93
feat(linter): check module in javascript and skip in typescript
2023-03-14 08:53:16 +08:00
Boshen
7b1a7d47b6
feat(linter): check await in ClassStaticBlock in javascript
2023-03-14 08:08:24 +08:00
Boshen
297ce2743f
Revert "feat(linter): check await in class static block"
...
This reverts commit 7add71c9dd .
2023-03-14 07:56:04 +08:00
Boshen
7add71c9dd
feat(linter): check await in class static block
2023-03-14 07:46:11 +08:00
Boshen
78bd76e8d0
feat(parser): check function name for await and yield
2023-03-14 07:39:07 +08:00
Boshen
c706d1825d
feat(semantic): turn on strict mode in semantic builder
2023-03-14 00:30:22 +08:00
Boshen
76118e4901
feat(linter): check NewTarget in javascript
2023-03-14 00:05:37 +08:00
Boshen
39795dbb1b
feat(linter): check ArrayPattern in javascript
2023-03-13 23:52:36 +08:00
Boshen
76f7e58036
feat(linter): check FormalParameter in javascript
2023-03-13 23:43:31 +08:00
Boshen
f4c8cb2cde
feat(linter): check FunctionDeclaration in javascript
2023-03-13 23:35:42 +08:00
Boshen
5381fd0cf8
feat(linter): check Directive in javascript
2023-03-13 23:19:35 +08:00
Boshen
7269d32346
feat(linter): check FormalParameters in javascript
2023-03-13 23:12:42 +08:00
Boshen
040e41240b
feat(linter): check AwaitExpression and YieldExpression in javascript
2023-03-13 13:45:49 +08:00
Boshen
fce6e1ec73
feat(parser): check YieldExpression
2023-03-12 23:41:27 +08:00
Boshen
88fd0a05ec
feat(parser): check AwaitExpression
2023-03-12 23:37:21 +08:00
Boshen
d6e8c6fb2f
feat(parser): check ReturnStatement in return context
2023-03-12 23:30:32 +08:00
Boshen
84eaa0b7e3
feat(linter): check eval and arguments in JavaScript
2023-03-12 23:25:57 +08:00
Boshen
93b06e948a
feat(ast_parser): check await and yield identifier error
2023-03-12 23:22:10 +08:00
Boshen
577a86edce
chore(benchmark): increase benchmark measurement time, CI is too unstable
2023-03-12 22:05:21 +08:00
Boshen
d490ca7b31
chore(rust): bump deps
2023-03-11 23:26:45 +08:00
Boshen
b1e01d0774
feat(linter): check top level ModuleDeclaration
2023-03-11 21:09:03 +08:00
Boshen
5c2fea7702
feat(linter): check SwitchStatement in javascript
2023-03-11 20:26:50 +08:00
Boshen
021345173f
feat(linter): check expressions in javascript
2023-03-11 20:18:20 +08:00
Boshen
403682960f
feat(linter): check ForStatementLeft in javascript
2023-03-11 19:12:29 +08:00
Boshen
f22539e93f
feat(linter): check property
2023-03-11 19:12:28 +08:00
Boshen
82ef1f2944
feat(linter): check Super in javascript
2023-03-11 18:48:34 +08:00
Boshen
6c28948faf
feat(linter): check duplicate constructor in javascript
2023-03-11 18:34:05 +08:00
Boshen
d5075a95e9
fix(linter): diagnostics should not print quotes
2023-03-11 17:44:27 +08:00
Boshen
a5f00e8e1c
refactor(oxc_ast): remove unnecessary SourceTypeBuilder
2023-03-11 16:21:14 +08:00
Boshen
58e2741ec9
feat(semantic): bind Function name
2023-03-10 23:28:51 -08:00
Boshen
995e7c1767
feat(linter): bind CatchVariable
2023-03-10 23:28:51 -08:00
Boshen
34c0599db8
feat(semantic): bind FormalParameters
2023-03-10 23:28:51 -08:00
Boshen
323bb9a2b6
feat(semantic): bind VariableDeclarator
2023-03-10 23:28:51 -08:00
Boshen
b1e802cecc
feat(semantic): bind Class
2023-03-10 23:28:51 -08:00
Boshen
5c8670d1c8
feat(semantic): declare symbol and reference Identifier
2023-03-10 23:28:51 -08:00
Boshen
be6fa2e7a0
chore(coverage): bump submodules
2023-03-10 23:28:51 -08:00
Boshen
2ee0b40656
chore: fix clippy warnings
2023-03-10 11:09:44 -08:00
Boshen
5b8bdaabab
feat(linter): check IdentifierReference in javascript
2023-03-09 20:20:58 +08:00
Shannon Rothe
da8355f418
feat(rulegen): refactor to visitor pattern ( #162 )
...
* feat(rulegen): refactor to visitor pattern
* convert `parse_test_code` to visitor pattern
2023-03-09 17:33:30 +08:00
Boshen
185acc49bd
feat(linter): check BindingIdentifier in javascript
2023-03-09 01:27:14 -08:00
Boshen
4ea7ac373d
feat(linter): check Identifier in javascript
2023-03-09 01:27:14 -08:00
Boshen
4a582f0487
feat(linter): check WithStatement in javascript
2023-03-09 01:27:14 -08:00
Boshen
0fb8887d3c
feat(linter): check LabeledStatement in javascript
2023-03-09 01:27:14 -08:00
Boshen
26387c0660
feat(linter): check ContinueStatement in javascript
2023-03-09 01:27:14 -08:00
Boshen
fa8f685551
fix(coverage): fix broken typescript nagative conformance
2023-03-09 01:27:14 -08:00
Boshen
3e842667b1
feat(linter): check BreakStatement in javascript
2023-03-09 01:27:14 -08:00
Boshen
735b1241c4
feat(linter): check StringLiteral in javascript
2023-03-09 01:27:14 -08:00
Boshen
ed161cc38e
feat(linter): check PrivateIdentifier in javascript
2023-03-09 01:27:14 -08:00
Boshen
44675e8cd8
feat(coverage): add always_strict mode for test262
2023-03-09 01:27:14 -08:00
Boshen
f13640e1c2
feat(linter): check NumberLiteral in javascript
2023-03-09 01:27:14 -08:00
Boshen
4e0d785b25
feat(linter): add infrastructure for handling early errors
2023-03-09 01:27:14 -08:00
yangchenye
bc2c175472
chore(rule_generator): preserve escaped string in test code ( #160 )
2023-03-09 12:07:55 +08:00
yangchenye
1ea463e0bb
feat(oxc_linter): implement eslint(no-mixed-operators) ( #145 )
2023-03-09 00:05:44 +08:00
Boshen
94fdd54368
perf(lexer): fine tune identifier checking with less redundant branches ( #154 )
...
perf(lexer): fine tune checking of identifiers with less redundant branches
2023-03-08 22:00:15 +08:00
yangchenye
b76ffb4826
feat(rule_generator): generate test options ( #150 )
2023-03-08 11:02:01 +08:00
Boshen
3562a49592
chore(coverage): print negative tests; enable decorators; update to the latest remote
2023-03-07 23:37:00 +08:00
Boshen
2f2c133017
fix(coverage): fix broken snapshot
2023-03-07 21:32:55 +08:00
Boshen
4d32bfb55e
refactor: remove all declarations of const fn, which is useless for us
2023-03-07 21:29:47 +08:00
Shannon Rothe
0f7edfb003
feat(rule_generator): automatically generate rules and tests ( #142 )
2023-03-07 18:21:58 +08:00
Boshen
e20c60d961
ci(benchmark): increase measurement time
2023-03-06 21:46:16 +08:00
Boshen
683778dfe2
feat(semantic): implement scopes ( #135 )
...
closes #119
2023-03-05 07:43:32 -08:00
Boshen
cb886d8a36
refactor(benchmark): make the benchmark run faster by using variable measurement time
2023-03-05 23:19:51 +08:00
Boshen
2f9e3832a0
chore(rust): bump deps
2023-03-05 04:51:00 -08:00
Fnll
81760da7cc
feat(parser): better diagnostic for missing semicolon in for loop statement ( #133 )
...
feat(parser): better diagnostic
Co-authored-by: kerui.lian <kerui.lian@bytedance.com>
2023-03-05 04:13:23 -08:00
Boshen
94fddffc70
chore: use fancy-no-backtrace from miette
...
See https://github.com/zkat/miette/issues/132
2023-03-05 15:16:26 +08:00
Boshen
7d3ce8b125
feat(benchmark): add semantic builder to benchmark ( #129 )
2023-03-04 23:09:19 -08:00
Ye Yangchen
d8c6caf57f
feat(oxc_parser): Parse modifiers before declaration
2023-03-01 22:50:23 -08:00
Shannon Rothe
ba6414656c
run coverage
2023-03-01 20:47:52 -08:00
Xuan
298e956d0d
feat(oxc_cli): support ignore-path
2023-03-01 04:39:18 -08:00
Boshen
ab0b764dfc
chore(README.md): include third party licenses
2023-02-27 12:46:07 +08:00
Ye Yangchen
0bf8f817f5
feat(oxc_parser): Port isStartOfDeclaration form tsc
2023-02-27 12:27:44 +08:00
Xuan
6b43cbbe71
fix(oxc_parser): support export type with star symbol
2023-02-27 12:26:23 +08:00
Xuan
b6d09643e5
fix(oxc_parser): check access correctly
2023-02-27 03:10:02 +08:00
Boshen
f17bd87f65
fix: try disable miri with custom allocators
2023-02-25 21:04:52 +08:00
Boshen
bf76f6d8b6
chore: ignore miri on global allocators
...
error: unsupported operation: can't call foreign function `_rjem_malloc` on OS `linux`
--> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/jemallocator-0.5.0/src/lib.rs:104:13
|
104 | ffi::malloc(layout.size())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function `_rjem_malloc` on OS `linux`
|
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
= note: BACKTRACE:
= note: inside `<jemallocator::Jemalloc as std::alloc::GlobalAlloc>::alloc` at /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/jemallocator-0.5.0/src/lib.rs:104:13: 104:39
note: inside `_::__rg_alloc`
--> tasks/benchmark/src/main.rs:13:16
|
12 | #[global_allocator]
| ------------------- in this procedural macro expansion
13 | static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc;
| ^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
2023-02-25 20:45:38 +08:00
Boshen
abb2f8c949
feat(rust): use mimalloc on windows
2023-02-25 11:58:57 +08:00
Boshen
21318e1fba
chore: update benchmark readme
2023-02-24 13:29:17 +08:00
Boshen
da941e8689
chore: update contribution docs
2023-02-24 13:24:42 +08:00
Boshen
5d17512b37
chore(coverage): update snapshots
2023-02-24 13:12:07 +08:00
Boshen
4b80cb2b6a
chore(tasks): update submodules
2023-02-24 13:08:22 +08:00
Xuan
457e85b4a0
fix(oxc_parser): check ambiguous for await
2023-02-24 12:46:59 +08:00
Boshen
d773187f43
ci: skip making comments from forks in benchmark
...
source: https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#restrictions-on-repository-forks
2023-02-23 21:37:08 +08:00
Xuan
65e81ce12c
fix(oxc_parser): eat decorator for export
2023-02-23 12:28:34 +08:00
Boshen
7689df3318
feat(coverage): print diagnostics to snapshots
2023-02-22 19:23:01 +08:00
Boshen
4edd3f75ce
feat(benchmark): check parser before benchmark
2023-02-20 18:23:36 +08:00
Boshen
978ca362f7
feat(coverage): use test262 to test printer
2023-02-20 18:23:36 +08:00
Boshen
204ea12d6a
fix(coverage): fix empty being reported as not parsed
2023-02-12 21:24:19 +08:00
Boshen
65cfa48fe5
chore(coverage): add typescript to cargo coverage command
2023-02-12 16:27:26 +08:00
Boshen
6758b0c66c
feat(coverage): add typescript conformance (currently 4287/4861 88.19%)
...
Some of the files are not being parsed because we are currently less
recoverable than TypeScript.
2023-02-11 23:46:28 -08:00
Boshen
a4e04d4f6f
feat(coverage): add babel conformance (currently 2043/2057 99.32%)
2023-02-11 22:36:32 -08:00
Boshen
f50c067ccf
fix(benchmark): fix panic on initialization
2023-02-11 18:45:50 -08:00
Boshen
fb8faedb3e
perf: add jemallocator
2023-02-11 18:45:50 -08:00
Boshen
f90d660ec5
feat(tasks): add parser benchmark
2023-02-11 08:46:32 -08:00
Boshen
a339ba3f92
feat(coverage): print parsing conformance for test262 (currently 100%)
2023-02-11 08:02:42 -08:00
Boshen
62a4f2b551
feat(ast): add ast
2023-02-11 04:27:34 -08:00
Boshen
4ae70b9592
feat(parser): add lexer
2023-02-11 02:29:54 -08:00
Boshen
f4819d976b
feat(tasks): add initial test262 setup
2023-02-11 00:43:09 -08:00