-
-
Notifications
You must be signed in to change notification settings - Fork 339
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) improve prefer-string-starts-ends-with
rule
#3176
Merged
Boshen
merged 1 commit into
main
from
c/05-06-feat_linter_improve_prefer-string-starts-ends-with_rule_inspired_by_https__x.com_the_moisrex_status_1787444601571221892
May 6, 2024
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This stack of pull requests is managed by Graphite. Learn more about stacking. |
camc314
changed the title
feat(linter) improve
feat(linter) improve May 6, 2024
prefer-string-starts-ends-with
rule,inspired by https://x.com/the_moisrex/status/1787444601571221892prefer-string-starts-ends-with
rule
camc314
commented
May 6, 2024
CodSpeed Performance ReportMerging #3176 will not alter performanceComparing Summary
|
Boshen
approved these changes
May 6, 2024
Boshen
deleted the
c/05-06-feat_linter_improve_prefer-string-starts-ends-with_rule_inspired_by_https__x.com_the_moisrex_status_1787444601571221892
branch
May 6, 2024 15:52
Brooooooklyn
pushed a commit
to toeverything/AFFiNE
that referenced
this pull request
May 16, 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.3.2` -> `0.3.5`](https://renovatebot.com/diffs/npm/oxlint/0.3.2/0.3.5) | [![age](https://developer.mend.io/api/mc/badges/age/npm/oxlint/0.3.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/oxlint/0.3.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/oxlint/0.3.2/0.3.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/oxlint/0.3.2/0.3.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>oxc-project/oxc (oxlint)</summary> ### [`v0.3.5`](https://togithub.com/oxc-project/oxc/releases/tag/oxlint_v0.3.5): oxlint v0.3.5 [Compare Source](https://togithub.com/oxc-project/oxc/compare/7193d75e9444ae8c2ba757b3bc64459abd0e128a...754d9f4c98aab052cf6b2756f7af12557042708d) #### What's Changed - feat(linter): add use-isnan fixer for (in)equality operations by [@​DonIsaac](https://togithub.com/DonIsaac) in [oxc-project/oxc#3284 - feat(linter/eslint): Implement fixer for unicode-bom rule by [@​jelly](https://togithub.com/jelly) in [oxc-project/oxc#3259 - fix(linter/no-direct-mutation-state): false positive when class is declared inside a `CallExpression` by [@​Boshen](https://togithub.com/Boshen) in [oxc-project/oxc#3294 - fix(parser): parse `DecoratorCallExpression` when `Arguments` contains `MemberExpression` by [@​Boshen](https://togithub.com/Boshen) in [oxc-project/oxc#3265 - perf(ast): inline all `ASTBuilder` methods by [@​Boshen](https://togithub.com/Boshen) in [oxc-project/oxc#3295 - perf(lexer): dedupe numeric separator check by [@​DonIsaac](https://togithub.com/DonIsaac) in [oxc-project/oxc#3283 - perf(linter): rewrite react/require-render-return by [@​mysteryven](https://togithub.com/mysteryven) in [oxc-project/oxc#3276 #### New Contributors - [@​g-plane](https://togithub.com/g-plane) made their first contribution in [oxc-project/oxc#3268 **Full Changelog**: oxc-project/oxc@oxlint_v0.3.4...oxlint_v0.3.5 ### [`v0.3.4`](https://togithub.com/oxc-project/oxc/releases/tag/oxlint_v0.3.4): oxlint v0.3.4 [Compare Source](https://togithub.com/oxc-project/oxc/compare/6149e49ef79a22004e36820c81afcb0c755fcc81...7193d75e9444ae8c2ba757b3bc64459abd0e128a) #### What's Changed - [feat(linter): move react/rules_of_hooks to nursery](https://togithub.com/oxc-project/oxc/commit/6edcae86cda8922ea8f9e5eae91290018e1b1637) - feat(linter/eslint): Implement max-classes-per-file by [@​jelly](https://togithub.com/jelly) in [oxc-project/oxc#3241 - **Full Changelog**: oxc-project/oxc@oxlint_v0.3.3...oxlint_v0.3.4 *** ### From v0.3.3 #### What's Changed ##### Features - add `--symlinks` to allow symbolic walking by [@​Boshen](https://togithub.com/Boshen) in [oxc-project/oxc#3244 - add `--format github` for github check annotation by [@​Boshen](https://togithub.com/Boshen) in [oxc-project/oxc#3191 - change the category of all react-perf rules to perf by [@​Dunqing](https://togithub.com/Dunqing) in [oxc-project/oxc#3243 - remove deprecated eslint v9 rules `no-return-await` and `no-mixed-operators` by [@​Boshen](https://togithub.com/Boshen) in [oxc-project/oxc#3188 - move prefer-node-protocol to restriction by [@​Boshen](https://togithub.com/Boshen) in [oxc-project/oxc#3171 ##### New Rules - react/rules-of-hooks by [@​rzvxa](https://togithub.com/rzvxa) in [oxc-project/oxc#3071 - eslint/radix by [@​KubaJastrz](https://togithub.com/KubaJastrz) in [oxc-project/oxc#3167 - eslint/no-new-native-nonconstructor by [@​Boshen](https://togithub.com/Boshen) in [oxc-project/oxc#3187 - eslint/unicode-bom by [@​jelly](https://togithub.com/jelly) in [oxc-project/oxc#3239 - eslint/no-empty-function rule by [@​jelly](https://togithub.com/jelly) in [oxc-project/oxc#3181 - eslint-plugin-next/no-duplicate-head by [@​Boshen](https://togithub.com/Boshen) in [oxc-project/oxc#3174 - eslint-plugin-next/no-page-custom-font by [@​Dunqing](https://togithub.com/Dunqing) in [oxc-project/oxc#3185 - eslint-plugin-next/no-styled-jsx-in-document by [@​Dunqing](https://togithub.com/Dunqing) in [oxc-project/oxc#3184 - unicorn/no-anonymous-default-export by [@​1zumii](https://togithub.com/1zumii) in [oxc-project/oxc#3220 ##### Bug Fixes - improve `prefer-string-starts-ends-with` rule by [@​camc314](https://togithub.com/camc314) in [oxc-project/oxc#3176 - import/export: improve multiple exports error message by [@​Dunqing](https://togithub.com/Dunqing) in [oxc-project/oxc#3160 - import/named: handle `import { default as foo }` by [@​Boshen](https://togithub.com/Boshen) in [oxc-project/oxc#3255 - shorten eslint/eqeqeq rule error message's span by [@​mysteryven](https://togithub.com/mysteryven) in [oxc-project/oxc#3193 - fix(parser): correctly parse cls.fn<C> = x by [@​Dunqing](https://togithub.com/Dunqing) in [oxc-project/oxc#3208 #### New Contributors - [@​KubaJastrz](https://togithub.com/KubaJastrz) made their first contribution in [oxc-project/oxc#3167 - [@​1zumii](https://togithub.com/1zumii) made their first contribution in [oxc-project/oxc#3220 **Full Changelog**: oxc-project/oxc@oxlint_v0.3.2...oxlint_v0.3.3 ### [`v0.3.3`](https://togithub.com/oxc-project/oxc/releases/tag/oxlint_v0.3.3): oxlint v0.3.3 [Compare Source](https://togithub.com/oxc-project/oxc/compare/a7940868c6e66d16814ebef5c8dbbfd9b948a0cd...6149e49ef79a22004e36820c81afcb0c755fcc81) #### What's Changed ##### Features - add `--symlinks` to allow symbolic walking by [@​Boshen](https://togithub.com/Boshen) in [oxc-project/oxc#3244 - add `--format github` for github check annotation by [@​Boshen](https://togithub.com/Boshen) in [oxc-project/oxc#3191 - change the category of all react-perf rules to perf by [@​Dunqing](https://togithub.com/Dunqing) in [oxc-project/oxc#3243 - remove deprecated eslint v9 rules `no-return-await` and `no-mixed-operators` by [@​Boshen](https://togithub.com/Boshen) in [oxc-project/oxc#3188 - move prefer-node-protocol to restriction by [@​Boshen](https://togithub.com/Boshen) in [oxc-project/oxc#3171 ##### New Rules - react/rules-of-hooks by [@​rzvxa](https://togithub.com/rzvxa) in [oxc-project/oxc#3071 - eslint/radix by [@​KubaJastrz](https://togithub.com/KubaJastrz) in [oxc-project/oxc#3167 - eslint/no-new-native-nonconstructor by [@​Boshen](https://togithub.com/Boshen) in [oxc-project/oxc#3187 - eslint/unicode-bom by [@​jelly](https://togithub.com/jelly) in [oxc-project/oxc#3239 - eslint/no-empty-function rule by [@​jelly](https://togithub.com/jelly) in [oxc-project/oxc#3181 - eslint-plugin-next/no-duplicate-head by [@​Boshen](https://togithub.com/Boshen) in [oxc-project/oxc#3174 - eslint-plugin-next/no-page-custom-font by [@​Dunqing](https://togithub.com/Dunqing) in [oxc-project/oxc#3185 - eslint-plugin-next/no-styled-jsx-in-document by [@​Dunqing](https://togithub.com/Dunqing) in [oxc-project/oxc#3184 - unicorn/no-anonymous-default-export by [@​1zumii](https://togithub.com/1zumii) in [oxc-project/oxc#3220 ##### Bug Fixes - improve `prefer-string-starts-ends-with` rule by [@​camc314](https://togithub.com/camc314) in [oxc-project/oxc#3176 - import/export: improve multiple exports error message by [@​Dunqing](https://togithub.com/Dunqing) in [oxc-project/oxc#3160 - import/named: handle `import { default as foo }` by [@​Boshen](https://togithub.com/Boshen) in [oxc-project/oxc#3255 - shorten eslint/eqeqeq rule error message's span by [@​mysteryven](https://togithub.com/mysteryven) in [oxc-project/oxc#3193 - fix(parser): correctly parse cls.fn<C> = x by [@​Dunqing](https://togithub.com/Dunqing) in [oxc-project/oxc#3208 #### New Contributors - [@​KubaJastrz](https://togithub.com/KubaJastrz) made their first contribution in [oxc-project/oxc#3167 - [@​1zumii](https://togithub.com/1zumii) made their first contribution in [oxc-project/oxc#3220 **Full Changelog**: oxc-project/oxc@oxlint_v0.3.2...oxlint_v0.3.3 </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:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNTEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjM2My41IiwidGFyZ2V0QnJhbmNoIjoiY2FuYXJ5IiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyJdfQ==-->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
basically:
^#/i.test(hex)
is the same as/^#/.test(hex)
so, in this case the
i
flag does nothing and we can safely ignore itinspired by https://x.com/the_moisrex/status/1787444601571221892
This could potentially lead a new
oxc
rule calledno_useless_case_insensitive_regex_flag
that reports if you have a regex with thei
flag with no ascii alphabetic chars.