Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(linter): Add --jsdoc-plugin flag #2935

Merged
merged 4 commits into from
Apr 12, 2024
Merged

feat(linter): Add --jsdoc-plugin flag #2935

merged 4 commits into from
Apr 12, 2024

Conversation

leaysgur
Copy link
Contributor

Add flag to:

$ oxlint --jsdoc-plugin

image

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI labels Apr 11, 2024
@leaysgur
Copy link
Contributor Author

leaysgur commented Apr 11, 2024

Should add jsdoc (and also import?) here too...?

// get final filtered rules by reading `self.jest_plugin` and `self.jsx_a11y_plugin`
fn get_filtered_rules(&self) -> Vec<RuleEnum> {
let mut rules = RULES.clone();
let mut may_exclude_plugin_rules = |yes: bool, name: &str| {
if !yes {
rules.retain(|rule| rule.plugin_name() != name);
}
};
may_exclude_plugin_rules(self.jest_plugin, JEST_PLUGIN_NAME);
may_exclude_plugin_rules(self.jsx_a11y_plugin, JSX_A11Y_PLUGIN_NAME);
may_exclude_plugin_rules(self.nextjs_plugin, NEXTJS_PLUGIN_NAME);
may_exclude_plugin_rules(self.react_perf_plugin, REACT_PERF_PLUGIN_NAME);
rules
}


=> Added

Copy link

codspeed-hq bot commented Apr 11, 2024

CodSpeed Performance Report

Merging #2935 will degrade performances by 10.99%

Comparing enable-jsdoc-plugin (547417b) with main (0c04bf7)

Summary

❌ 5 regressions
✅ 25 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main enable-jsdoc-plugin Change
linter[RadixUIAdoptionSection.jsx] 6.4 ms 7.1 ms -10.02%
linter[antd.js] 8.8 s 9.9 s -10.38%
linter[cal.com.tsx] 2.5 s 2.8 s -9.75%
linter[checker.ts] 4.5 s 5.1 s -10.64%
linter[pdf.mjs] 1.6 s 1.7 s -10.99%

@leaysgur leaysgur marked this pull request as ready for review April 12, 2024 00:39
@Boshen
Copy link
Member

Boshen commented Apr 12, 2024

Seems like we missed all the plugins here

let lint_options = LintOptions::default()
.with_filter(vec![(AllowWarnDeny::Deny, "all".into())])
.with_jest_plugin(true)
.with_jsx_a11y_plugin(true);

Can you help me and add them, so we can catch performance regressions.

@leaysgur
Copy link
Contributor Author

OK, I added 👉🏻 547417b

By the way, LintOptions has xxx_plugin properties only for

  • import
  • jsdoc
  • jest
  • jsx_a11y
  • nextjs
  • react_perf

Should we define this flag also for react, tree_shaking, typescript, unicorn, etc...?

@Boshen
Copy link
Member

Boshen commented Apr 12, 2024

Should we define this flag also for react, tree_shaking, typescript, unicorn, etc...?

react, typescript and unicorn are enabled by default, I don't know how to turn them off now lol

@Boshen Boshen merged commit ba2121f into main Apr 12, 2024
32 checks passed
@Boshen Boshen deleted the enable-jsdoc-plugin branch April 12, 2024 02:39
Brooooooklyn referenced this pull request in toeverything/AFFiNE Apr 22, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [oxlint](https://oxc-project.github.io) ([source](https://togithub.com/oxc-project/oxc/tree/HEAD/npm/oxlint)) | [`0.2.17` -> `0.3.0`](https://renovatebot.com/diffs/npm/oxlint/0.2.17/0.3.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/oxlint/0.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/oxlint/0.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/oxlint/0.2.17/0.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/oxlint/0.2.17/0.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>oxc-project/oxc (oxlint)</summary>

### [`v0.3.0`](https://togithub.com/oxc-project/oxc/releases/tag/oxlint_v0.3.0): oxlint v0.3.0

[Compare Source](https://togithub.com/oxc-project/oxc/compare/04f5fc018650d9a5dc6a4b1b40dea941fa07781e...b29aabd6f1a2e9e8cfa7db25c371ab40f79d02a5)

#### What's Changed

##### Potential breaking change

-   `-D all` no longer enables nursery rules, use `-D all -D nursery` instead

##### Features

-   support eslint globals by [@&#8203;Boshen](https://togithub.com/Boshen) in [https://github.com/oxc-project/oxc/pull/3038](https://togithub.com/oxc-project/oxc/pull/3038)
-   change no-empty-static-block to correctness
-   implement `--format checkstyle` by [@&#8203;Boshen](https://togithub.com/Boshen) in [https://github.com/oxc-project/oxc/pull/3044](https://togithub.com/oxc-project/oxc/pull/3044)
-   implement `--format unix` by [@&#8203;Boshen](https://togithub.com/Boshen) in [https://github.com/oxc-project/oxc/pull/3039](https://togithub.com/oxc-project/oxc/pull/3039)
-   implement fixer for `typescript-eslint/consistent-type-definitions` by [@&#8203;todor-a](https://togithub.com/todor-a) in [https://github.com/oxc-project/oxc/pull/3045](https://togithub.com/oxc-project/oxc/pull/3045)

##### Fixes

-   fix crashing with `unwrap` in import/no-cycle by [@&#8203;Boshen](https://togithub.com/Boshen) in [https://github.com/oxc-project/oxc/pull/3035](https://togithub.com/oxc-project/oxc/pull/3035)

**Full Changelog**: oxc-project/oxc@oxlint_v0.2.18...oxlint_v0.3.0

### [`v0.2.18`](https://togithub.com/oxc-project/oxc/releases/tag/oxlint_v0.2.18): oxlint v0.2.18

[Compare Source](https://togithub.com/oxc-project/oxc/compare/df11d10a2220e9aa7a33d9ab39ed662c2ba6fdb5...04f5fc018650d9a5dc6a4b1b40dea941fa07781e)

#### What's Changed

##### New Rules

-   correctness: eslint-plugin-unicorn no await in promise methods by [@&#8203;camc314](https://togithub.com/camc314) in [https://github.com/oxc-project/oxc/pull/2963](https://togithub.com/oxc-project/oxc/pull/2963)
-   correctness: eslint-plugin-unicorn no single promise in promise methods by [@&#8203;camc314](https://togithub.com/camc314) in [https://github.com/oxc-project/oxc/pull/2962](https://togithub.com/oxc-project/oxc/pull/2962)

##### Features

-   Add --jsdoc-plugin flag by [@&#8203;leaysgur](https://togithub.com/leaysgur) in [https://github.com/oxc-project/oxc/pull/2935](https://togithub.com/oxc-project/oxc/pull/2935)
-   Implement plugin-jsdoc/check-property-names by [@&#8203;leaysgur](https://togithub.com/leaysgur) in [https://github.com/oxc-project/oxc/pull/2989](https://togithub.com/oxc-project/oxc/pull/2989)
-   eslint/max-len by [@&#8203;woai3c](https://togithub.com/woai3c) in [https://github.com/oxc-project/oxc/pull/2874](https://togithub.com/oxc-project/oxc/pull/2874)
-   remove import/no-unresolved by [@&#8203;Boshen](https://togithub.com/Boshen) in [https://github.com/oxc-project/oxc/pull/3023](https://togithub.com/oxc-project/oxc/pull/3023)
-   support `oxlint-disable` alongside `eslint-disable` by [@&#8203;Boshen](https://togithub.com/Boshen) in [https://github.com/oxc-project/oxc/pull/3024](https://togithub.com/oxc-project/oxc/pull/3024)
-   jsdoc: Implement require-property rule by [@&#8203;leaysgur](https://togithub.com/leaysgur) in [https://github.com/oxc-project/oxc/pull/3011](https://togithub.com/oxc-project/oxc/pull/3011)
-   jsdoc: Implement require-property-(type|name|description) rules by [@&#8203;leaysgur](https://togithub.com/leaysgur) in [https://github.com/oxc-project/oxc/pull/3013](https://togithub.com/oxc-project/oxc/pull/3013)

#### New Contributors

-   [@&#8203;branchseer](https://togithub.com/branchseer) made their first contribution in [https://github.com/oxc-project/oxc/pull/2943](https://togithub.com/oxc-project/oxc/pull/2943)
-   [@&#8203;woai3c](https://togithub.com/woai3c) made their first contribution in [https://github.com/oxc-project/oxc/pull/2874](https://togithub.com/oxc-project/oxc/pull/2874)

**Full Changelog**: oxc-project/oxc@oxlint_v0.2.17...oxlint_v0.2.18

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), 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/toeverything/AFFiNE).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMDEuNCIsInVwZGF0ZWRJblZlciI6IjM3LjMxMy4xIiwidGFyZ2V0QnJhbmNoIjoiY2FuYXJ5IiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyJdfQ==-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Area - CLI A-linter Area - Linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants