Commit graph

2388 commits

Author SHA1 Message Date
overlookmotel
1249c6c326
refactor(ast): implement same traits on all fieldless enums (#3031)
Implement same traits on all AST fieldless enums, for consistency. Just
a little bit of tidying.
2024-04-20 01:53:48 +08:00
Ali Rezvani
0d770f57ff
refactor: remove redundant imports to fix some of clippy warnings. (#3028)
These are raising warnings in nightly, And are in fact redundant.
2024-04-19 21:02:23 +08:00
overlookmotel
0b9470eeb8
refactor(ast): shorten code (#3027)
Shorten code for getting span. Refactor only, no substantive change.
2024-04-19 18:30:58 +08:00
overlookmotel
04005ff62d
refactor(prettier): simplify import (#3026)
Just a tiny simplification. No substantive change.
2024-04-19 18:11:08 +08:00
Boshen
a05c4e39b8
Release crates v0.12.4 2024-04-19 16:40:05 +08:00
Boshen
fd670d542a
chore(linter): add error message to unicorn/no-single-promise-in-promise-methods 2024-04-19 15:53:49 +08:00
Boshen
2bac1d5384
feat(linter): support oxlint-disable alongside eslint-disable (#3024)
closes #2999
2024-04-19 15:39:13 +08:00
Boshen
fa08abe20a
feat(linter): remove import/no-unresolved (#3023)
closes #3015

This plugin will always contain false positives due to module resolution
complexity.
2024-04-19 12:45:50 +08:00
谭光志
9b4e87a102
feat(linter): eslint/max-len (#2874)
Co-authored-by: Wang Wenzhe <mysteryven@gmail.com>
2024-04-19 12:35:37 +08:00
Boshen
3f9f4670e2
chore(transformer): enable clippy::print_stdout 2024-04-19 10:34:50 +08:00
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