Dunqing
c6767fa598
refactor(semantic): reduce allocation in resolve_references_for_current_scope ( #2414 )
2024-02-16 20:48:03 +08:00
Dunqing
3ff3495126
fix(playground): syntax check does not work ( #2412 )
2024-02-15 20:05:14 +08:00
Dunqing
28ba28f64c
refactor(semantic): check directive by current_scope_id ( #2411 )
2024-02-14 23:21:24 +08:00
tudorbarbu
8e0277e510
feat: add Typescript ban-tslint-comment ( #2371 )
...
Rule source:
[link](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/rules/ban-tslint-comment.ts )
Rule tests:
[link](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/tests/rules/ban-tslint-comment.test.ts )
2024-02-13 23:14:13 +08:00
Yuji Sugiura
6a2586490b
fix(linter/jsx_a11y): Refactor jsx-a11y related utils and its usage ( #2389 )
...
Fixes #2360
To make `jsx-a11y/anchor-has-content` test pass,
- [x] Use `utils::get_element_type(ctx, el)` in
`utils::is_hidden_from_screen_reader` and
`utils::object_has_accessible_child`
- [x] `utils::object_has_accessible_child` should handle both `null` and
`undefined`
and on the way...,
- [x] `utils::get_element_type` should be used only in `jsx_a11y/*`
rules
- [x] Use those utils everywhere(remove manual implementation)
2024-02-13 23:13:43 +08:00
tudorbarbu
cb1ae36317
linter: implement from_configuration for jsx-a11y autocomplete-valid ( #2404 )
...
This closes #2362
2024-02-13 23:12:22 +08:00
Wenzhe Wang
d9f073e122
feat(linter): detect jest file by default glob pattern ( #2408 )
...
closes : #2397
2024-02-13 22:56:28 +08:00
Dunqing
b5deb9a708
fix(codegen): when async is on the left-hand side of a for-of, wrap it in parentheses ( #2407 )
...
Refer to
55e1127a49/internal/js_printer/js_printer.go (L3097-L3104)
2024-02-13 22:42:23 +08:00
Boshen
83cb78fbb0
feat(coverage): add prettier idempotency test ( #2403 )
...
feat(coverage): add prettier idempotency test
closes #1329
feat(prettier_conformance): enable TypeScript
2024-02-12 16:20:09 +08:00
Boshen
1cbd7539fb
feat(coverage): add prettier idempotency test ( #2402 )
...
closes #1329
2024-02-12 15:30:16 +08:00
Boshen
70a0076eed
refactor: remove global allocator from non-user facing apps ( #2401 )
...
The runtime performance gains does not out weight the compilation speed from
building the custom allocators, which takes about a minute to build on
slower machines.
2024-02-12 14:09:05 +08:00
Boshen
3ea6c95371
fix(playground): only lint when there are no syntax errors ( #2400 )
2024-02-12 13:44:44 +08:00
Boshen
5cf7550b40
chore(ast): add some documentation links ( #2399 )
2024-02-12 13:20:45 +08:00
renovate[bot]
e5fcf82b93
chore(deps): update rust crates ( #2396 )
2024-02-12 11:42:57 +08:00
Boshen
c4b169e5d6
refactor(prettier): add call_arguments.rs ( #2393 )
2024-02-11 23:16:07 +08:00
Boshen
7e99e52bbc
refactor(prettier): function parameters ( #2392 )
2024-02-11 23:01:19 +08:00
Dunqing
73e116e8a1
fix(parser): incorrect parsing of class accessor property name ( #2386 )
2024-02-11 22:57:13 +08:00
Wenzhe Wang
384d5acd7a
fix(codegen): lower the level of precedence in TaggedTemplateExpression ( #2391 )
2024-02-11 22:56:32 +08:00
Boshen
747de8cfd4
refactor(prettier): improve Group API ( #2390 )
2024-02-11 21:53:02 +08:00
keita hino
8d6202f946
feat(linter): eslint-plugin-jest require-to-throw-message ( #2384 )
...
partof: #492
docs:
https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/require-to-throw-message.md
code:
https://github.com/jest-community/eslint-plugin-jest/blob/main/src/rules/require-to-throw-message.ts
test:
https://github.com/jest-community/eslint-plugin-jest/blob/main/src/rules/__tests__/require-to-throw-message.test.ts
2024-02-11 20:38:24 +08:00
Boshen
9ff7986610
feat(prettier): handle binaryish expression in return statement ( #2388 )
2024-02-11 20:01:25 +08:00
Boshen
871a73afdd
fix(prettier): semi colon after class property ( #2387 )
2024-02-11 19:25:38 +08:00
Dunqing
0df7e296f9
feat(tasks/codegen): check node version >= 20 ( #2385 )
...
This syntax only works on node >= 20
`import value from './json-value-array_FIXTURE.json' with { type: 'json'
};`
2024-02-11 19:23:11 +08:00
overlookmotel
383f5b3081
perf(parser): consume multi-line comments faster ( #2377 )
...
Consume multi-line comments faster.
* Initially search for `*/`, `\r`, `\n` or `0xE2` (first byte of
irregular line breaks).
* Once a line break is found, switch to faster search which only looks
for `*/`, as it's not relevant whether there are more line breaks or
not.
Using `memchr` for the 2nd simpler search, as it's efficient for a
search with only one "needle".
Initializing `memchr::memmem::Finder` is fairly expensive, and tried
numerous ways to handle it. This is most performant way I could find.
Any ideas how to avoid re-creating it for each Lexer pass? (it can't be
a `static` as `Finder::new` is not a const function, and `lazy_static!`
is too costly)
2024-02-11 12:43:14 +08:00
Boshen
24a9255610
Release napi oxc-parser@v0.4.0
2024-02-11 12:37:44 +08:00
Boshen
5723690fdf
Release napi oxc-parser@v0.4.0-alpha.0
2024-02-11 11:56:46 +08:00
Boshen
15a8857927
refactor(prettier): improve print_statement_sequence ( #2383 )
2024-02-11 00:16:26 +08:00
Boshen
82a6dc17d3
feat(pretter): implement print_binaryish_expressions ( #2382 )
2024-02-10 23:18:56 +08:00
Boshen
4e8fcb5110
refactor(prettier): remove BinaryishLeft ( #2381 )
2024-02-10 23:10:33 +08:00
Yunfei He
7d7a3fcef8
perf(lint/no_var_requires): quicker way to check if the IdentifierReference point to a global variable ( #2376 )
...
The old code use this function to do the checking, which is too much for
this simple checking
ef336cb66b/crates/oxc_linter/src/ast_util.rs (L267-L276)
2024-02-10 22:46:02 +08:00
cinchen
92afbb102e
feat(linter): eslint-plugin-jest: prefer-equality-matcher ( #2358 )
...
Rule detail:
[link](https://github.com/jest-community/eslint-plugin-jest/blob/main/src/rules/prefer-equality-matcher.ts )
2024-02-10 19:30:28 +08:00
Boshen
2dfe5210bb
fix(prettier): print strings as raw strings ( #2380 )
2024-02-10 17:52:17 +08:00
Boshen
642484e2cb
feat(prettier): print newlines between array expression elements ( #2379 )
2024-02-10 17:31:09 +08:00
Boshen
f194b1fac8
refactor(prettier): clean up implementation of object key ( #2378 )
2024-02-10 16:49:10 +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
overlookmotel
c4fa738312
perf(parser): consume single-line comments faster ( #2374 )
...
Use `byte_search!` macro to consume single-line comments.
Would be a lot simpler if didn't have to deal with irregular line breaks. Damn you Unicode!
2024-02-10 11:02:30 +08:00
overlookmotel
b29719d2df
refactor(parser): add methods to Source + SourcePosition ( #2373 )
...
Preparatory step for #2374 .
2024-02-10 10:57:33 +08:00
overlookmotel
79ae9a9b2c
refactor(parser): extend byte_search macro ( #2372 )
...
Preparatory step for #2374 .
2024-02-10 10:52:59 +08:00
overlookmotel
0be8397c77
perf(parser): optimize lexing strings ( #2366 )
...
Optimize lexing strings a bit.
2024-02-09 23:52:45 +08:00
Boshen
d6d921ea1f
Publish crates v0.7.0
2024-02-09 23:01:12 +08:00
Boshen
70c983d4bb
feat(prettier): print rest parameters ( #2370 )
2024-02-09 22:59:28 +08:00
Boshen
9b6c313ebf
fix(prettier): flatten all binary expressions for now ( #2367 )
2024-02-09 21:48:27 +08:00
Boshen
90a834f87b
chore: update snapshot
2024-02-09 21:08:39 +08:00
overlookmotel
c0d1d6b08a
perf(parser): lex strings as bytes ( #2357 )
...
Lex string literals as bytes, using same techniques as for identifiers.
Handling escapes could be optimized a bit more, and maybe I'll return to that, but as escapes are fairly rare, it wouldn't be the biggest gain.
2024-02-09 21:00:27 +08:00
overlookmotel
1baf9c33d2
ci: run benchmarks on branches called bench-* ( #2365 )
...
I've recently switched over from hacking on a fork to working directly
on upstream, in order to be able to use Graphite.
One thing I miss now is ability to create branches and run CodSpeed on
them while developing. Compared to running benches locally, CodSpeed has
the advantage of giving you a visual history, showing how each commit
you push moves the dials.
This PR makes the benchmarks run for any branch named `bench-*`, in
order to enable this workflow on upstream, without having to open a
draft PR for every experiment.
2024-02-09 20:57:37 +08:00
Yuji Sugiura
2521b52011
fix(linter/jsx_a11y): Ensure plugin settings are used ( #2359 )
...
Currently, some of the rules did not use `settings`, so make sure they
do.
- [x] Align implementation of `getElementType()`
- (This is the only util that depends on `settings`)
Original rules which use `getElementType()` are:
- [x] 🙅🏻♂️ accessible-emoji
- [x] ✅ alt-text
- [x] 🙅🏻♂️ anchor-ambiguous-text
- [x] ✅ anchor-has-content
- [x] anchor-is-valid
- TODO: `from_configuration()` not implemented => #2361
- [x] 🙆🏻♀️ aria-activedescendant-has-tabindex
- [x] 🙆🏻♀️ aria-role
- [x] 🙆🏻♀️ aria-unsupported-elements
- [x] autocomplete-valid
- TODO: `from_configuration()` not implemented and needed for this =>
#2362
- [x] 🙆🏻♀️ click-events-have-key-events
- [x] 🙅🏻♂️ control-has-associated-label
- [x] heading-has-content
- TODO: 1 test should be failed but passes 🤔 => #2360
- [x] 🙆🏻♀️ html-has-lang
- [x] ✅ iframe-has-title
- [x] 🙆🏻♀️ img-redundant-alt
- [x] 🙅🏻♂️ interactive-supports-focus
- [x] 🙅🏻♂️ label-has-associated-control
- [x] 🙅🏻♂️ label-has-for
- [x] 🙆🏻♀️ lang
- [x] 🙆🏻♀️ media-has-caption
- [x] ✅ no-aria-hidden-on-focusable
- [x] 🙆🏻♀️ no-autofocus
- [x] 🙆🏻♀️ no-distracting-elements
- [x] 🙅🏻♂️ no-interactive-element-to-noninteractive-role
- [x] 🙅🏻♂️ no-noninteractive-element-interactions
- [x] 🙅🏻♂️ no-noninteractive-element-to-interactive-role
- [x] 🙅🏻♂️ no-noninteractive-tabindex
- [x] 🙅🏻♂️ no-onchange
- [x] 🙆🏻♀️ no-redundant-roles
- [x] 🙅🏻♂️ no-static-element-interactions
- [x] ✅ prefer-tag-over-role
- [x] 🙆🏻♀️ role-has-required-aria-props
- [x] 🙆🏻♀️ role-supports-aria-props
- [x] 🙆🏻♀️ scope
🙅🏻♂️ = Not implemented yet by oxlint / ✅ = Fixed by this PR / 🙆🏻♀️ =
Already used
2024-02-09 20:55:50 +08:00
overlookmotel
2f6cf73d51
fix(parser): remove erroneous debug assertion ( #2356 )
...
This was a bit of a whoopsie in last batch of PRs. This assertion shouldn't be there, because all reads are now via `source.position().read()`, so this assertion says "you can only read some byte values".
Only reason it didn't blow up conformance tests is that they run in release mode.
Sorry. Please merge soon as you can and cover my shame!
2024-02-09 20:55:12 +08:00
Dunqing
2eb489e996
fix(codegen): format new expession + import expression with the correct parentheses ( #2346 )
...
Similar to #2330
2024-02-09 20:51:50 +08:00
Boshen
f49ffb2b63
fix(linter): getter-return false positive with TypeScript syntax ( #2363 )
...
closes #2349
2024-02-09 18:22:53 +08:00
Boshen
ca77ccc951
refactor(prettier): add a space!() macro ( #2348 )
2024-02-09 12:11:42 +08:00