Yuji Sugiura
2c325ef3d6
fix(semantic/jsdoc): Skip parsing @ inside of backticks ( #3017 )
...
This PR aims to support these cases.
````js
/**
* This is normal comment, `@xxx` should not parsed as tag.
*
* @example ```ts
// @comment
@decoratorInComment
class Foo { }
```
*/
````
Only `@example` should be parsed as tag.
2024-04-18 19:18:46 +08:00
Yuji Sugiura
395ad76410
feat(linter/jsdoc): Update settings.jsdoc method ( #3016 )
...
Add `list_preferred_tag_names()` to enumerate user defined tag names in
`tagNamePreferences`.
2024-04-18 18:57:00 +08:00
Dunqing
3831147b6d
feat(transformer/typescript): report error for export = <value> ( #3021 )
2024-04-18 18:56:29 +08:00
Dunqing
7416de217b
feat(transformer/typescript): reports error for import lib = require(...); ( #3020 )
2024-04-18 18:54:45 +08:00
Dunqing
e14ac17c72
feat(transformer/typescript): insert this assignment after the super call ( #3018 )
2024-04-18 18:53:01 +08:00
Yuji Sugiura
5d89e75e48
feat(linter/jsdoc): Implement require-property-(type|name|description) rules ( #3013 )
...
Part of #1170
-
https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-property-type.md
-
https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-property-name.md
-
https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-property-description.md
2024-04-17 16:31:39 +08:00
Boshen
722d4c2350
fix(transformer): TypeScriptOptions deserialize should fallback to default ( #3012 )
2024-04-17 16:27:50 +08:00
Dunqing
b72bdcaf96
feat(transformer/react): reports duplicate __self/__source prop error ( #3009 )
2024-04-17 13:34:31 +08:00
Yuji Sugiura
7de9c91f52
feat(linter/jsdoc): Implement require-property rule ( #3011 )
...
Part of #1170
- Doc:
https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-property.md#repos-sticky-header
- Src:
https://github.com/gajus/eslint-plugin-jsdoc/blob/main/src/rules/requireProperty.js
- Test:
https://github.com/gajus/eslint-plugin-jsdoc/blob/main/test/rules/assertions/requireProperty.js
2024-04-17 12:18:59 +08:00
Dunqing
99e038cfc0
fix(transformer/typescript): modifiers should not be removed ( #3005 )
...
`codegen` relies on the modifier to decide whether to print or not. For
example, if declare is present, nothing will be printed if typescript is
not enabled.
We may need to solve this problem in a way that doesn't rely on
modifers.
2024-04-16 10:33:13 +00:00
Boshen
85a3653994
feat(transformer): add "_jsxFileName" variable in jsx source plugin ( #3000 )
2024-04-16 17:40:24 +08:00
Boshen
67045467c7
fix(transformer): react development default value should be false ( #3002 )
2024-04-16 17:28:31 +08:00
Dunqing
afb1dd4b24
feat(transformer/typescript): support for transform TSImportEqualsDeclaration ( #2998 )
2024-04-16 06:45:41 +00:00
Dunqing
6732e8b9af
feat(transformer/typescript): support for transform enum ( #2997 )
...
The current implementation is copied from the previous implementation
2024-04-16 14:39:37 +08:00
Boshen
e43c245388
feat(transformer): add import helpers to manage module imports ( #2996 )
...
closes #2971
2024-04-16 14:33:44 +08:00
Yuji Sugiura
df2036eea0
feat(linter): Implement plugin-jsdoc/check-property-names ( #2989 )
...
Part of #1170
- Doc:
https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-property-names.md#repos-sticky-header
- Test:
https://github.com/gajus/eslint-plugin-jsdoc/blob/main/test/rules/assertions/checkPropertyNames.js
- Impl:
https://github.com/gajus/eslint-plugin-jsdoc/blob/main/src/rules/checkPropertyNames.js
2024-04-16 13:55:33 +08:00
Dunqing
6a53fa367b
feat(transformer/typescript): correct elide imports/exports statements ( #2995 )
...
remove ts annotations one benefit: `IdentifierReference` only used on js
code
The `TypescriptReferenceCollector` implementation is inspired by
5f75019683/crates/swc_ecma_transforms_typescript/src/strip_import_export.rs (L9-L99)
This seems simpler to implement than using scope
2024-04-16 11:06:58 +08:00
Wang Wenzhe
ac37d55600
feat(linter/tree-shaking): support DoWhileStatement and IfStatement ( #2994 )
2024-04-16 09:44:29 +08:00
Dunqing
fd5002bc51
feat(codegen): correctly print type-only imports/exports ( #2993 )
2024-04-15 18:33:02 +08:00
Boshen
82e00bc951
refactor(transformer): remove boilerplate code around decorators to reduce noise ( #2991 )
2024-04-15 13:51:09 +08:00
Yuji Sugiura
40af2b1662
feat(semantic/jsdoc): Handle optional type syntax for type name part ( #2960 )
...
It seems `JSDocTypeNamePart` can contain whitespace like...
```js
/** @property [cfg.n12="default value"] Config... */
```
2024-04-15 10:18:39 +08:00
Jose
627dd424cb
fix(linter/no-empty-interface): add missing test ( #2979 )
...
As requested add new test
https://github.com/oxc-project/oxc/pull/2973#discussion_r1564728188
---------
Co-authored-by: j.buendia <j.buendia>
2024-04-14 22:33:59 +08:00
Boshen
b6b63ac9bc
feat(transform_conformance): skip tests with plugin.js ( #2978 )
2024-04-14 21:55:32 +08:00
Boshen
c211f1e57f
feat(transformer): add diagnostics to react transform ( #2974 )
2024-04-14 21:42:32 +08:00
Boshen
ef602af4cc
feat(transform_conformance): skip plugins we don't support yet ( #2967 )
2024-04-14 21:32:03 +08:00
Jose
aa62dbbfd5
feat(linter): add missing test cases to no-empty-interface and add config ( #2973 )
...
Based on this https://github.com/oxc-project/oxc/issues/2934 I added
missing test cases and rule configuration
---------
Co-authored-by: j.buendia <j.buendia>
2024-04-14 12:12:28 +00:00
Boshen
c7e70c80f0
fix(transformer): deserialize ReactJsxRuntime with camelCase ( #2972 )
2024-04-14 19:40:24 +08:00
Boshen
3a6eae1abd
feat(transformer): apply jsx self and source plugin inside jsx transform ( #2966 )
2024-04-14 19:10:59 +08:00
Boshen
10814d5331
fix(transformer): turn on react preset by default ( #2968 )
2024-04-14 19:04:59 +08:00
Boshen
35e3b0f1cb
fix(transformer): fix incorrect jsx whitespace text handling ( #2969 )
2024-04-14 18:40:40 +08:00
Wang Wenzhe
5b02ae1175
feat(linter/tree-shaking): support ConditionalExpression ( #2965 )
2024-04-14 13:41:44 +08:00
Wang Wenzhe
da5ea411dd
feat(linter/tree-shaking): support Class ( #2964 )
2024-04-14 13:39:27 +08:00
Boshen
bd9fc6d169
feat(transformer): react jsx transform ( #2961 )
2024-04-14 10:50:17 +08:00
Cameron
01e64bf64d
feat(linter) eslint-plugin-unicorn no await in promise methods ( #2963 )
2024-04-14 10:44:36 +08:00
Cameron
98a3acd8b5
feat(linter) eslint-plugin-unicorn no single promise in promise methods ( #2962 )
...
part of #684
2024-04-14 10:39:12 +08:00
Miles Johnson
e67355045e
feat(transformer): start on TypeScript annotation removal ( #2951 )
2024-04-13 18:49:54 +08:00
Boshen
93ce5a919a
chore: fix internal doc warnings
2024-04-13 15:59:24 +08:00
Boshen
b15bf2826b
feat(napi/parser): remove experimental flexbuffer api ( #2957 )
2024-04-13 14:59:31 +08:00
Boshen
bd56d51443
chore(macros): only select required features from syn to reduce compile time ( #2955 )
2024-04-13 13:37:59 +08:00
Boshen
063b281c39
feat(allocator): make Box's PhantomData own the passed in T ( #2952 )
2024-04-13 12:31:40 +08:00
Boshen
e651e50bda
feat(transformer): add the most basic plugin toggles ( #2950 )
2024-04-12 20:25:34 +08:00
Boshen
60ccbb105c
refactor(transformer): clean up some code ( #2949 )
2024-04-12 20:23:44 +08:00
Boshen
14754777a4
feat(transformer): implement react-jsx-source ( #2948 )
2024-04-12 20:21:54 +08:00
branchseer
f159f60084
Make ast types covariant over the allocator lifetime. ( #2943 )
...
## Why
Due to the usage of `&'alloc mut T` in `oxc_allocator::Box`, and
`bumpalo::collections::Vec` in `oxc_allocator::Vec`, ast types are
currently invariant over their allocator lifetime `'a`. This prevents
`ouroboros` from generating `borrow_*` on ast type fields, leading to
the unfriendly `with_*` api:
c250b288ef/crates/oxc_parser/examples/multi-thread.rs (L82-L84)
## How
- For `oxc_allocator::Vec`, switch to `allocator_api2::vec::Vec`, which
has a covariant relationship with the allocator lifetime.
- For `oxc_allocator::Box`, use `std::ptr::NonNull` which is
specifically designed to be covariant. I don't use
`allocator_api2::boxed::Box` because it holds the allocator for
dropping, so the size is bigger.
## Downside
Now that `oxc_allocator::Box` uses the unsafe `NonNull`. It has to be a
private field to be safe. This make it impossible to do `Box(....)`
pattern matching.
2024-04-12 18:12:18 +08:00
Boshen
f903a225a8
feat(transformer): implement react-jsx-self ( #2946 )
2024-04-12 18:08:36 +08:00
Yuji Sugiura
ba2121f17d
feat(linter): Add --jsdoc-plugin flag ( #2935 )
...
Add flag to:
```sh
$ oxlint --jsdoc-plugin
```

2024-04-12 10:39:12 +08:00
Boshen
0c04bf743f
feat(transformer): transform TypeScript namespace ( #2942 )
2024-04-12 10:19:13 +08:00
Boshen
c250b288ef
fix(cli): return error if --format receives an unknown value
2024-04-11 21:38:39 +08:00
Boshen
3419306ac0
feat(transformer): add filename ( #2941 )
2024-04-11 18:43:51 +08:00
Boshen
614f73b66c
Release crates v0.12.3
2024-04-11 16:18:17 +08:00