Boshen
f49e6ebd41
fix(span): treat .js as module file (reverts the previous breaking change) ( #5612 )
...
As it turns out it's not ideal to treat `.js` as `script` in today's world anymore.
This makes https://github.com/oxc-project/oxlint-ecosystem-ci pass again.
2024-09-08 15:14:04 +00:00
Boshen
1bc08e296e
fix(coverage): parse babel unambiguously ( #5579 )
2024-09-07 10:49:00 +00:00
DonIsaac
540714393a
feat(semantic): check for non-declared, non-abstract class accessors without bodies ( #5460 )
...
This should be causing more negative tests to fail than it actually is. This is
because our typescript coverage tests use the "declarations" option to change
the source type to `.d.ts`, which is incorrect. This setting enables `.d.ts`
emits, it does not mean that input files should be treated as `.d.ts`
themselves.
2024-09-05 01:33:09 +00:00
Boshen
e75e0f1465
chore: update test262 / babel / typescript submodules ( #5369 )
...
closes #5215
2024-08-31 12:28:25 +00:00
Boshen
e6fd52e2a6
fix(parser): change unterminated regex error to be non-recoverable ( #5285 )
...
closes #5257
2024-08-28 01:57:31 +00:00
leaysgur
1686920e23
fix(parser): Span for invalid regex flags ( #5225 )
...
### Before
```
x Flag u is mentioned twice in regular expression literal
,-[1:20]
1 | const a = /\2(.)/uuxig;
: ^
2 | debugger;
`----
x Unexpected flag x in regular expression literal
,-[1:21]
1 | const a = /\2(.)/uuxig;
: ^
2 | debugger;
`----
```
### After
```
x Flag u is mentioned twice in regular expression literal
,-[1:19]
1 | const a = /\2(.)/uuxig;
: ^
2 | debugger;
`----
x Unexpected flag x in regular expression literal
,-[1:20]
1 | const a = /\2(.)/uuxig;
: ^
2 | debugger;
`----
```
2024-08-26 10:24:47 +00:00
DonIsaac
7dfd51a62b
feat(parser): report class properties that are both definite and optional ( #5181 )
2024-08-25 01:02:49 +00:00
DonIsaac
a563968386
feat(parser): report errors on optional accessor properties ( #5180 )
2024-08-25 01:02:49 +00:00
Boshen
e4ca3d3901
chore(coverage): ignore annex-b/disabled tests
2024-08-24 14:20:06 +08:00
Boshen
6d87b0f1f2
fix(semantic): fix error message for duplicated label ( #5071 )
2024-08-22 12:30:04 +00:00
Boshen
afe728a73a
feat(parser): parse regular expression with regex parser ( #4998 )
...
Many false positives and incorrect errors. @leaysgur Enjoy 😁
Run `just conformance` to update the snapshot.
2024-08-22 03:09:55 +00:00
Boshen
bea76f0f24
fix(coverage): fix babel cases
2024-08-17 11:22:00 +08:00
Boshen
81439403fd
chore(coverage): print path relative to snapshot file ( #4938 )
...
Ctrl + click in terminal can open the file with this change.
I don't know about vscode, but maybe a plugin can help?
<img width="1399" alt="image" src="https://github.com/user-attachments/assets/9bb4609b-14e9-4df8-b5ee-cb96b72b2f7d ">
<img width="1131" alt="image" src="https://github.com/user-attachments/assets/e0293693-f755-4b91-8712-bbd2a0e615cc ">
2024-08-17 03:09:25 +00:00
Boshen
61cdfef5c7
chore(coverage): remove quotes around path from snapshot files
...
to make it easier to triple click and copy the path
2024-08-16 16:03:50 +08:00
DonIsaac
a2eabe1f4b
refactor(parser): use error codes for ts diagnostics ( #4335 )
...
Part of #4333
2024-07-18 16:09:25 +00:00
Boshen
28eeee0f71
fix(parser): fix asi error diagnostic pointing at invalid text causing crash ( #4163 )
2024-07-10 14:45:10 +00:00
DonIsaac
2f53bdf72d
feat(semantic): check for abstract ClassElements in non-abstract classes ( #4127 )
...
feat(semantic): check for abstract ClassElements in non-abstract classes
chore: update coverage snapshots
2024-07-09 03:35:32 +00:00
Don Isaac
c4ee9f8ec6
feat(semantic): check for abstract initializations and implementations ( #4125 )
2024-07-08 17:30:16 -04:00
DonIsaac
e386b62331
feat(semantic): check for invalid type import assignments ( #4097 )
...
Adds checks to `TSImportEqualsDeclaration` for invalid use of `import type` modifier.
```ts
import { Foo } from './foo'
namespace Bar {
export class Baz {}
}
import type A = Foo.Baz; // not allowed
import type B = Bar.Baz; // not allowed
import type C = require('./c'); // allowed
```
2024-07-08 03:14:22 +00:00
Boshen
243c9f35b0
refactor(parser): use function instead of trait to parse list with rest element ( #4028 )
...
closes #3887
2024-07-02 13:43:14 +00:00
Boshen
1dacb1fc5b
refactor(parser): use function instead of trait to parse delimited lists ( #4014 )
...
relates #3887
The rest of the list parsing trait implementations involves ... parsing
`rest`, which I'll refactor in another PR.
2024-07-02 14:47:56 +08:00
DonIsaac
63f36daae0
feat(parser): parse modifiers with parse_modifiers (take 2) ( #3977 )
...
Same as #3948 , with fixes for bugs found by @Boshen.
2024-06-30 03:46:34 +00:00
Boshen
14bc31ee74
Revert "feat(parser): parse modifiers with parse_modifiers ( #3948 )"
...
This reverts commit 7b38bde073 .
2024-06-29 14:16:26 +08:00
DonIsaac
7b38bde073
feat(parser): parse modifiers with parse_modifiers ( #3948 )
...
Closes #3929
2024-06-29 05:29:47 +00:00
Boshen
3db2553dc2
refactor(parser): improve parsing of TypeScript type arguments ( #3923 )
2024-06-26 07:16:18 +00:00
Boshen
4cf3c7645f
refactor(parser): improve parsing of TypeScript types ( #3903 )
...
- [x] fix everything
2024-06-26 05:58:16 +00:00
Dunqing
ef82c78a72
fix(parser): trailing comma is not allowed in ParenthesizedExpression ( #3885 )
...
close : #3878
The implementation is copied from `SeparatedList`'s `print_list`.
```diff
fn parse_list(&mut self, p: &mut ParserImpl<'a>) -> Result<()> {
p.expect(self.open())?;
let mut first = true;
while !p.at(self.close()) && !p.at(Kind::Eof) {
if first {
first = false;
} else {
p.expect(self.separator())?;
- if p.at(self.close()) {
- break;
- }
}
self.parse_element(p)?;
}
p.expect(self.close())?;
Ok(())
}
```
2024-06-24 14:56:32 +00:00
Boshen
13754cbd3d
fix(parser): change diagnostic to "modifier cannot be used here" ( #3853 )
2024-06-23 15:14:27 +00:00
Boshen
ae09a97a09
refactor(ast)!: remove Modifiers from ts nodes ( #3846 )
2024-06-23 19:44:35 +08:00
Don Isaac
d5f6aeb1ca
feat(semantic): check for illegal symbol modifiers ( #3838 )
2024-06-23 12:36:09 +08:00
Boshen
c041e9d1a9
chore: bump test262, babel and TypeScript submodules ( #3644 )
2024-06-12 18:42:32 +08:00
Dunqing
350cd9158a
fix(parser): should parser error when function declaration has no name ( #3461 )
...
https://oxc-project.github.io/oxc/playground/?code=3YCAAICNgICAgICAgICzncl%2FKeF7k4Y7upgY2l43c79%2FYxaAgA%3D%3D
2024-05-30 19:58:50 +08:00
Boshen
89a1f97320
refactor(parser): improve expression parsing ( #3352 )
2024-05-19 21:28:16 +08:00
Boshen
e818fba21c
refactor(parser): improve parse_simple_arrow_function_expression ( #3349 )
2024-05-19 06:05:39 +00:00
Boshen
530455849b
chore(tasks): add commit sha to snapshots to make sure submodules are not outdated ( #3267 )
...
If submodules are outdated, it'll panic with the following message
```
Repository is outdated, please run `just submodules` to update it.
```
For us maintainers, we'll need the env `UPDATE_SNAPSHOT` to force an update.
2024-05-14 10:18:00 +00:00
Boshen
09f34fc942
refactor(semantic): unify diagnostic in checker
2024-05-12 01:07:28 +08:00
Dunqing
0ba7778e5e
fix(parser): correctly parse cls.fn<C> = x ( #3208 )
...
close : #3206
2024-05-09 10:23:45 +08:00
Dunqing
a227050ed0
chore: update babel repo ( #3205 )
2024-05-08 20:15:15 +08:00
Dunqing
220f722f19
chore: update snapshots ( #2817 )
...
Babel repo is updated in #2813 and #2814
2024-03-26 11:53:26 +08:00
Boshen
86ee074678
fix(parser): remove all duplicated comments in trivia builder ( #2689 )
2024-03-12 17:51:22 +08:00
Boshen
977c20b677
feat(coverage): add a duplicate comment check ( #2688 )
2024-03-12 16:52:34 +08:00
Boshen
6c6adb46d1
fix(ast): parse rest parameter with the correct optional and type annotation syntax ( #2686 )
...
closes #2653
2024-03-12 15:47:22 +08:00
Boshen
8a73d18fcf
chore(parser): make sure all span.end >= span.start ( #2681 )
...
closes #2679
2024-03-11 19:49:51 +08:00
Boshen
265b2fb640
feat: miette v7 ( #2465 )
2024-03-08 15:50:00 +08:00
Boshen
240ff19675
refactor(parser): improve parsing of BindingPattern in TypeScript ( #2624 )
...
closes #2622
2024-03-06 16:16:03 +08:00
Dunqing
197fa16613
feat(semantic): add check for duplicate class elements in checker ( #2455 )
...
1. Remove the check implementation of the parser
2. Implement it to semantic checker
3. Support typescript's check for duplicate class elements
Support checking for duplicate class elements in semantic checker is
easier to support typescript checking rules.
2024-02-21 14:10:19 +08:00
Boshen
ef336cb66b
feat(parser): recover from async x [newline] => x ( #2375 )
...
```javascript
async x
=> x
```
Babel recovers and displays "No line break is allowed before '=>'
2024-02-10 11:19:08 +08:00
Dunqing
a3570d41f0
feat(semantic): report parameter related errors for setter/getter ( #2316 )
2024-02-05 17:38:43 +08:00
Dunqing
9ca13d040d
feat(semantic): report type parameter list cannot be empty ( #2315 )
2024-02-05 16:05:51 +08:00
Dunqing
f53c54ced9
feat(semantic): report unexpected type annotation in ArrayPattern ( #2309 )
2024-02-05 13:45:52 +08:00