Commit graph

2399 commits

Author SHA1 Message Date
Boshen
84c43c8282
fix(semantic): correctly resolve identifiers inside catch parameter initializers (#3050)
closes #2499
2024-04-21 23:53:38 +08:00
Boshen
92d709bf21
feat(ast): add CatchParameter node (#3049) 2024-04-21 23:43:39 +08:00
Boshen
1f7033e7ab
fix(semantic): correctly resolve identifiers inside parameter initializers (#3046)
close: #2644
This fixes function parameters. I think we need an extra AST node to fix catch parameters, which will be the next PR.
2024-04-21 23:38:31 +08:00
Boshen
ee1c0e5df7
feat(cli): implement --format checkstyle (#3044)
closes #2355
2024-04-21 16:30:28 +08:00
overlookmotel
27102df476
refactor(napi): remove unnecessary custom Serialize impl for Atom (#3041)
Custom `Serialize` impl on `Atom` is not required - can just use serde
derive.
2024-04-21 13:04:51 +08:00
Boshen
4425b961cd
feat(cli): implement --format unix (#3039)
closes #1462
2024-04-21 01:24:22 +08:00
Boshen
ae1f15ac1e
feat(linter): support eslint globals (#3038)
closes #3019
2024-04-20 23:01:59 +08:00
Boshen
53c0ff5135
refactor(linter): improve the ergonomics around ESlintConfig (#3037) 2024-04-20 20:02:22 +08:00
overlookmotel
d44301c871
fix(parser): fix comment typos (#3036)
Fix 2 typos in comments.
2024-04-20 13:13:25 +03:30
Boshen
598bbbaddc
fix(linter): fix crashing with unwrap in import/no-cycle (#3035)
closes #3034
2024-04-20 16:59:13 +08:00
Ali Rezvani
57ad6c4aa7
feat(semantic): add root node to the AstNodes structure. (#3032)
Adds a way to fetch the root node without iterating over all ancestors
which has a nondeterministic time - best case O(1) worst case O(n!) - It
is only possible to set this field in the semantic builder.
2024-04-20 13:36:20 +08:00
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