overlookmotel
0ddfc856d2
refactor(parser): remove unsafe code ( #2527 )
...
Remove some unnecessary unsafe code.
2024-02-27 20:28:21 +08:00
Boshen
02c82c3f78
feat(cli,linter): provide tsconfig path from the cli ( #2526 )
...
closes #891
2024-02-27 20:00:11 +08:00
Boshen
27052ebfed
refactor(span): remove AtomImpl ( #2525 )
2024-02-27 13:45:58 +08:00
Boshen
903f17c0df
refactor(span): move base54 method to mangler ( #2523 )
2024-02-27 13:34:33 +08:00
Arnaud Barré
6d5ec6dedd
fix(ast): few serialization issues ( #2522 )
...
A few more I missed in #2506 . Re #2463 .
Only remaining snake_case in the current types of the AST:
`trailing_comma` in ArrayExpression, ObjectExpression &
ArrayAssignmentTarget.
2024-02-27 13:04:13 +08:00
Arnaud Barré
76add55031
Support file type in playground ( #2520 )
...
<img width="1514" alt="Screenshot 2024-02-27 at 00 16 21"
src="https://github.com/oxc-project/oxc/assets/14235743/32fee380-a2c1-41b3-a564-351597d4a60e ">
Not sure about the bindgen thing.
I made the filename optional but given the impact on parsing I think it
could be great for external users to not depend on the tsx default in
the future
2024-02-27 12:54:38 +08:00
Boshen
46e779194a
chore: fix clippy warnings ( #2519 )
2024-02-26 23:55:18 +08:00
Boshen
570ca68b1e
chore: bump Minimum Supported Rust Version to 1.74
...
closes #2514
2024-02-26 23:25:03 +08:00
Boshen
351a0572be
chore(parser): print both AST and errors in examples/parser
2024-02-26 23:20:46 +08:00
Boshen
c56b6cb643
refactor: replace InlinableString with CompactString for Atom ( #2517 )
...
relates #2516
2024-02-26 23:11:46 +08:00
Dunqing
1519b9000b
fix(semantic): incorrect scope for switch statement ( #2513 )
...
close : #2501
2024-02-26 22:54:19 +08:00
Boshen
be6b8b7ce6
[BREAKING CHANGE] Change Atom to Atom<'a> to make it safe ( #2497 )
...
Part of #2295
This PR splits the `Atom` type into `Atom<'a>` and `CompactString`.
All the AST node strings now use `Atom<'a>` instead of `Atom` to signify
it belongs to the arena.
It is now up to the user to select which form of the string to use.
This PR essentially removes the really unsafe code
93742f89e9/crates/oxc_span/src/atom.rs (L98-L107)
which can lead to

2024-02-26 19:34:40 +08:00
Boshen
4fabe66621
Publish crates v0.8.0
2024-02-26 19:01:51 +08:00
Boshen
a0f23baea7
Release oxlint and vscode extension v0.2.11
2024-02-26 18:41:04 +08:00
Boshen
d980b0bef2
Release napi oxc-parser@v0.6.0
2024-02-26 18:40:26 +08:00
keita hino
93742f89e9
fix(linter): Correct configuration file parsing for jsx-no-useless-fragment ( #2512 )
...
fix : #2484
I fixed the configuration parsing for jsx-no-useless-fragment.
2024-02-26 15:49:50 +08:00
Dunqing
cd75c1ca59
feat(transformer/decorators): insert only one private in expression ( #2486 )
2024-02-26 15:48:47 +08:00
Dunqing
4c2e2bdf61
fix(semantic): add export symbol flag to identifiers in export declarations ( #2508 )
...
Related PR: #2335
2024-02-26 15:48:05 +08:00
Dunqing
432791679f
fix(codegen): remove redundant semicolon in PropertyDefinition ( #2511 )
2024-02-26 15:15:19 +08:00
Yuji Sugiura
f66fb886b3
fix(tasks/rulegen): Parse 'export default' test file for plugin-jsdoc ( #2510 )
2024-02-26 14:31:51 +08:00
Boshen
540f917f3a
refactor(ast): remove TSEnumBody ( #2509 )
2024-02-26 12:44:38 +08:00
Arnaud Barré
b8764a8eb8
Fix few serialization issues ( #2506 )
...
Re: #2463
2024-02-26 12:25:17 +08:00
renovate[bot]
0bdace187a
chore(deps): update website npm packages ( #2505 )
2024-02-26 10:38:26 +08:00
renovate[bot]
29b213eac7
chore(deps): update rust crates ( #2503 )
2024-02-26 10:38:11 +08:00
renovate[bot]
77f3ab0496
chore(deps): update vscode npm packages ( #2504 )
2024-02-26 10:37:25 +08:00
Dunqing
70295a5552
feat(ast): update arrow_expression to arrow_function_expression ( #2496 )
2024-02-25 14:39:34 +00:00
Boshen
fba66dcc75
fix(linter): improve import/no-named-as-default ( #2494 )
2024-02-25 21:24:08 +08:00
Boshen
f5aadc767f
feat(linter): handle cjs `module.exports = {} as default export ( #2493 )
2024-02-25 00:11:48 +08:00
Boshen
f64c7e04a3
feat(linter): handle cjs module.exports.foo = bar and exports.foo = bar ( #2492 )
2024-02-24 23:54:43 +08:00
Boshen
d0a9c465f7
feat(linter): handle top-level require for import plugin ( #2491 )
2024-02-24 21:48:23 +08:00
Yuji Sugiura
04f4621ed8
fix(semantic): Should return nearest JSDoc ( #2490 )
...
Follow up #2437 ( 🙇🏻 )
2024-02-24 20:35:57 +08:00
Boshen
ef5713d600
chore(linter): add tests no import/no-deprecated ( #2489 )
2024-02-24 17:50:30 +08:00
Boshen
3e1794d6c0
feat(syntax): implement Debug for ModuleRecord ( #2488 )
2024-02-24 17:34:42 +08:00
Yuji Sugiura
bc22ae569e
fix(semantic): Refactor jsdoc finding ( #2437 )
...
Partial fix for #168
- [x] Fix general finding behavior for leading comments
- [x] Accept multiple jsdoc comments per node
- [x] Provide `get_one` and also `get_all`
- [x] Add `iter_all()` for non-node related usage
- [x] Limit AST node kinds to parse
2024-02-24 17:24:01 +08:00
Alex Yip
696818ad08
feat(linter): implement @typescript-eslint/prefer-ts-expect-error ( #2435 )
...
Implement @typescript-eslint/prefer-ts-expect-error
Issue: https://github.com/oxc-project/oxc/issues/2180
Documentation:
https://typescript-eslint.io/rules/prefer-ts-expect-error/
Rule source:
https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts
---------
Co-authored-by: Boshen <boshenc@gmail.com>
2024-02-24 09:23:50 +00:00
Boshen
7a796c4b5f
feat(ast): add TSModuleDeclaration.kind ( #2487 )
...
closes #2395
2024-02-24 17:09:31 +08:00
Boshen
5212f7b51e
fix(parser): fix missing end span from TSTypeAliasDeclaration ( #2485 )
...
closes #2483
2024-02-24 16:51:00 +08:00
Boshen
6aa8c2daee
feat(linter): initialize resolver lazily and automatically read tsconfig.json for now ( #2482 )
2024-02-23 23:19:33 +08:00
Boshen
135e56a401
feat(linter): ignore unsupported extensions in import/no_unresolved ( #2481 )
2024-02-23 23:11:43 +08:00
Dunqing
3d008abacb
feat(transformer/decorators): insert instanceBrand function ( #2480 )
2024-02-23 23:04:27 +08:00
Boshen
7f867221ca
feat(linter): handle built-in modules in import/no_unresolved ( #2479 )
2024-02-23 22:10:27 +08:00
Boshen
d741d72e17
fix(linter): fix import plugin hanging when ignored modules are imported ( #2478 )
...
`ModuleMap` needs to save all ignored modules,
the cache will wait for forever otherwise.
For example, previously when `.json` modules is imported,
`init_cache_state` will lock the thread forever because there are no
code path that lead `update_cache_state` to release the lock.
2024-02-23 22:04:31 +08:00
keita hino
015b2ee3ac
feat(linter): eslint-plugin-react void-dom-elements-no-children ( #2477 )
...
partof: https://github.com/oxc-project/oxc/issues/1022
docs:
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md
code:
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/lib/rules/void-dom-elements-no-children.js
test:
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/tests/lib/rules/void-dom-elements-no-children.js
2024-02-23 21:37:11 +08:00
Boshen
c5f67febc1
feat(linter): add boilerplate for eslint-plugin-import/no_duplicates ( #2476 )
2024-02-23 18:35:29 +08:00
Boshen
f1e364fee5
feat(linter): eslint-plugin-import/no_unresolved ( #2475 )
2024-02-23 18:27:57 +08:00
keita hino
35a0f895dc
fix(linter): Handle cases where createElement is an Identifier in is_create_element_call ( #2474 )
...
I fixed a false negative issue in the `is_create_element_call` function
where createElement was an Identifier.
https://github.com/oxc-project/oxc/blob/main/crates/oxc_linter/src/utils/react.rs#L13-L19
In the case of [eslint-plugin-react's button-has-type
rule](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/button-has-type.md ),
the following triggers the expected errors:
```ts
// error
React.createElement("button")
// error
createElement("button")
```
However, with Oxlint, it behaves differently:
```ts
// error
React.createElement("button")
// false negative
createElement("button")
```
2024-02-23 15:55:28 +08:00
Boshen
2714a32970
feat(linter): continue working on no_cycle ( #2471 )
2024-02-23 05:16:30 +00:00
Dunqing
2628c97eda
feat(transformer/decorators): transform getter function ( #2473 )
2024-02-23 10:11:45 +08:00
Boshen
6527bfd249
feat(linter): add boilerplace code for import/namespace,no_deprecated,no_unused_modules ( #2470 )
2024-02-22 18:48:40 +08:00
Boshen
8ab667c90e
chore: assign all renovate bot changes to me
2024-02-21 23:22:41 +08:00