wikimedia / eslint-plugin-no-jquery

Control allowance of certain jQuery functions, and suggest or autofix alternatives.
MIT License
31 stars 8 forks source link

Add 'recommended' status to each rule as a starter #317

Open jdforrester opened 1 month ago

jdforrester commented 1 month ago

Now-recommended rules:

Fixes #249.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (6f5cc33) to head (aff0669).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #317 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 103 103 Lines 603 603 ========================================= Hits 603 603 ``` | [Files](https://app.codecov.io/gh/wikimedia/eslint-plugin-no-jquery/pull/317?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wikimedia) | Coverage Δ | | |---|---|---| | [src/rules/no-ajax-events.js](https://app.codecov.io/gh/wikimedia/eslint-plugin-no-jquery/pull/317?src=pr&el=tree&filepath=src%2Frules%2Fno-ajax-events.js&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wikimedia#diff-c3JjL3J1bGVzL25vLWFqYXgtZXZlbnRzLmpz) | `100.00% <ø> (ø)` | | | [src/rules/no-animate-toggle.js](https://app.codecov.io/gh/wikimedia/eslint-plugin-no-jquery/pull/317?src=pr&el=tree&filepath=src%2Frules%2Fno-animate-toggle.js&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wikimedia#diff-c3JjL3J1bGVzL25vLWFuaW1hdGUtdG9nZ2xlLmpz) | `100.00% <ø> (ø)` | | | [src/rules/no-animate.js](https://app.codecov.io/gh/wikimedia/eslint-plugin-no-jquery/pull/317?src=pr&el=tree&filepath=src%2Frules%2Fno-animate.js&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wikimedia#diff-c3JjL3J1bGVzL25vLWFuaW1hdGUuanM=) | `100.00% <ø> (ø)` | | | [src/rules/no-append-html.js](https://app.codecov.io/gh/wikimedia/eslint-plugin-no-jquery/pull/317?src=pr&el=tree&filepath=src%2Frules%2Fno-append-html.js&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wikimedia#diff-c3JjL3J1bGVzL25vLWFwcGVuZC1odG1sLmpz) | `100.00% <ø> (ø)` | | | [src/rules/no-class-state.js](https://app.codecov.io/gh/wikimedia/eslint-plugin-no-jquery/pull/317?src=pr&el=tree&filepath=src%2Frules%2Fno-class-state.js&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wikimedia#diff-c3JjL3J1bGVzL25vLWNsYXNzLXN0YXRlLmpz) | `100.00% <ø> (ø)` | | | [src/rules/no-constructor-attributes.js](https://app.codecov.io/gh/wikimedia/eslint-plugin-no-jquery/pull/317?src=pr&el=tree&filepath=src%2Frules%2Fno-constructor-attributes.js&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wikimedia#diff-c3JjL3J1bGVzL25vLWNvbnN0cnVjdG9yLWF0dHJpYnV0ZXMuanM=) | `100.00% <ø> (ø)` | | | [src/rules/no-deferred.js](https://app.codecov.io/gh/wikimedia/eslint-plugin-no-jquery/pull/317?src=pr&el=tree&filepath=src%2Frules%2Fno-deferred.js&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wikimedia#diff-c3JjL3J1bGVzL25vLWRlZmVycmVkLmpz) | `100.00% <ø> (ø)` | | | [src/rules/no-extend.js](https://app.codecov.io/gh/wikimedia/eslint-plugin-no-jquery/pull/317?src=pr&el=tree&filepath=src%2Frules%2Fno-extend.js&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wikimedia#diff-c3JjL3J1bGVzL25vLWV4dGVuZC5qcw==) | `100.00% <ø> (ø)` | | | [src/rules/no-fx-interval.js](https://app.codecov.io/gh/wikimedia/eslint-plugin-no-jquery/pull/317?src=pr&el=tree&filepath=src%2Frules%2Fno-fx-interval.js&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wikimedia#diff-c3JjL3J1bGVzL25vLWZ4LWludGVydmFsLmpz) | `100.00% <ø> (ø)` | | | [src/rules/no-global-selector.js](https://app.codecov.io/gh/wikimedia/eslint-plugin-no-jquery/pull/317?src=pr&el=tree&filepath=src%2Frules%2Fno-global-selector.js&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wikimedia#diff-c3JjL3J1bGVzL25vLWdsb2JhbC1zZWxlY3Rvci5qcw==) | `100.00% <ø> (ø)` | | | ... and [9 more](https://app.codecov.io/gh/wikimedia/eslint-plugin-no-jquery/pull/317?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wikimedia) | |
edg2s commented 1 month ago

How have you decided which rules are recommended?

jdforrester commented 1 month ago

How have you decided which rules are recommended?

Gut feeling / commonality in practice of changes, mostly. Very happy to change any of them.

edg2s commented 1 month ago

Is the boolean used for anything? I'm hesitant to include this in the release without thinking about it a bit more.

jdforrester commented 1 month ago

Is the boolean used for anything? I'm hesitant to include this in the release without thinking about it a bit more.

The next commit in the stack requires this commit.

jdforrester commented 1 month ago

[Edit: Oh, never mind, you just opted out for now. Sure.] Wait, now you've squash-merged a different version of this commit in 8acaa2e2a26a5fdcab1d74485d74b551f265c254 instead?

edg2s commented 1 month ago

According to the docs:

recommended: (boolean) For core rules, this specifies whether the rule is enabled by the recommended config from @eslint/js.

We also have a recommended config that only applies variable-pattern. If we do use the flag it should match the list. I'm not sure why you would specify that a rule is recommended in two places though...

edg2s commented 1 month ago

Not also in general for the parent property docs:

docs: (object) Properties often used for documentation generation and tooling. Required for core rules and optional for custom rules. Custom rules can include additional properties here as needed.

https://eslint.org/docs/latest/extend/custom-rules