Commit graph

3258 commits

Author SHA1 Message Date
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
04f5fc0186
Release oxlint and vscode extension v0.2.18 2024-04-19 16:51:40 +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
Wang Wenzhe
d3b7fc75f4
chore(task): add specific pnpm version for codespeed task (#3010)
> Corepack is about to download
https://registry.npmjs.org/pnpm/-/pnpm-9.0.0.tgz. 
> Cannot perform a frozen installation because the version of the
lockfile is incompatible with this version of pnpm

https://github.com/oxc-project/oxc/actions/runs/8703527853/job/23877194263?pr=2874
2024-04-16 21:46:40 +08:00
Boshen
34bf68036c
Update README.md 2024-04-16 21:01:28 +08:00
Boshen
df1996157f
chore(transform_conformance): ignore more unsupported plugins (#3008) 2024-04-16 18:59:21 +08:00
Dunqing
cdd3bc5a4e
feat(transformer_conformance): enable typescript when the typescript plugin is present (#3007) 2024-04-16 10:47:06 +00: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
ae9d681b4d
feat(transform_conformance): skip windows tests (#3003) 2024-04-16 17:50:43 +08: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
Boshen
5f4c1e1d3e
chore(transform_conformance): skip custom presets (#3001) 2024-04-16 17:21:34 +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
Boshen
b4bfa2f34c
refactor(transform_conformance): correctly handle BABEL_8_BREAKING (#2990) 2024-04-15 13:41:45 +08:00
Boshen
6532799ff2
Revert "chore(deps): update dependency tar to v7 (#2985)"
This reverts commit 00d75b2fad.
2024-04-15 10:32:01 +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
renovate[bot]
ec1ca3ac98
chore(deps): update peaceiris/actions-gh-pages action to v4 (#2986)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[peaceiris/actions-gh-pages](https://togithub.com/peaceiris/actions-gh-pages)
| action | major | `v3` -> `v4` |

---

### Release Notes

<details>
<summary>peaceiris/actions-gh-pages
(peaceiris/actions-gh-pages)</summary>

###
[`v4`](https://togithub.com/peaceiris/actions-gh-pages/compare/v3...v4)

[Compare
Source](https://togithub.com/peaceiris/actions-gh-pages/compare/v3...v4)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 8am on monday" in timezone
Asia/Shanghai, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/oxc-project/oxc).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjI5My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-15 10:11:26 +08:00
renovate[bot]
00d75b2fad
chore(deps): update dependency tar to v7 (#2985)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [tar](https://togithub.com/isaacs/node-tar) | [`^6.2.0` ->
`^7.0.0`](https://renovatebot.com/diffs/npm/tar/6.2.1/7.0.1) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/tar/7.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/tar/7.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/tar/6.2.1/7.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/tar/6.2.1/7.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>isaacs/node-tar (tar)</summary>

###
[`v7.0.1`](https://togithub.com/isaacs/node-tar/compare/v7.0.0...v7.0.1)

[Compare
Source](https://togithub.com/isaacs/node-tar/compare/v7.0.0...v7.0.1)

###
[`v7.0.0`](https://togithub.com/isaacs/node-tar/compare/v6.2.1...v7.0.0)

[Compare
Source](https://togithub.com/isaacs/node-tar/compare/v6.2.1...v7.0.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 8am on monday" in timezone
Asia/Shanghai, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/oxc-project/oxc).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjI5My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-15 10:11:05 +08:00
Boshen
5a286c3d9f
feat(transform_conformance): drop more unsupported plugins (#2984) 2024-04-14 23:04:04 +08:00
Boshen
9643cba4a4
feat(transform_conformance): drop all babel 7 specific tests (#2982)
@Dunqing Is this correct?
2024-04-14 23:02:38 +08:00
Boshen
c753c9fa74
feat(transform_conformance): handle deserialization errors (#2980) 2024-04-14 22:47:28 +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
7cf0927a38
feat(transform_conformance): skip tests with plugin.js (#2977) 2024-04-14 21:45:27 +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