Boshen
4cd5f1a05e
Release oxlint and vscode extension v0.2.9
2024-02-18 16:55:59 +08:00
Boshen
160498be18
ci: add publish to open vsx registry
2024-02-18 16:55:22 +08:00
overlookmotel
90f9266d00
chore(deps): update bumpalo crate ( #2417 )
...
Latest version of `bumpalo` includes a couple of performance fixes for
`String` (e.g. https://github.com/fitzgen/bumpalo/pull/229 ) which may
help the parser a little.
2024-02-18 11:49:31 +08:00
Dunqing
67d7a4677f
refactor(linter): get arrow expression by scope_id in no_render_return_value ( #2424 )
2024-02-17 21:06:28 +08:00
Dunqing
7c2d868dc7
refactor(semantic): delete the redundant code in binder ( #2423 )
2024-02-17 21:02:45 +08:00
Yuji Sugiura
0b9e122de8
feat(linter): Implement unicorn/no-process-exit rule ( #2410 )
...
Part of #684
- docs:
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-process-exit.md
- source:
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/rules/no-process-exit.js
- tests:
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/test/no-process-exit.mjs
2024-02-16 13:37:22 +00:00
Dunqing
8110288bf4
perf(semantic): reduce visit parent nodes in resolve_reference_usages ( #2419 )
2024-02-16 20:52:35 +08:00
overlookmotel
cc2ddbee77
refactor(parser): catch all illegal UTF-8 bytes ( #2415 )
...
Catch all illegal UTF-8 bytes with the `UER` byte handler.
From https://datatracker.ietf.org/doc/html/rfc3629 :
> The octet values C0, C1, F5 to FF never appear.
This change *should* make no difference at all, as a valid `&str` may not contain any of these byte values anyway. But it's possible if user has e.g. created the string with `str::from_utf8_unchecked` and not obeyed the safety contraints. This will at least contain the damage if that's happened, and panic rather than lead to UB. And since we're already catching other error conditions, may as well catch them all.
2024-02-16 20:49:01 +08:00
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