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(eslint-plugin): [prefer-string-starts-ends-with] add allowSingleElementEquality option #8374

Conversation

JoshuaKGoldberg
Copy link
Member

PR Checklist

Overview

Adds a new allowSingleElementEquality option to the rule that's allowed to be 'never' (default) or 'always'.

Doesn't yet add a third option for case matching as described in the issue. Is that ok to leave as a followup?

Also removes the auto-generation of tests from prefer-string-starts-ends-with.test.ts per #6887. The test file predates that preference.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @JoshuaKGoldberg!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

Copy link

netlify bot commented Feb 4, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 1573b1c
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/65e79c6a8f3b8100089f6c72
😎 Deploy Preview https://deploy-preview-8374--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 90 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 98 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@JoshuaKGoldberg

This comment was marked as resolved.

Copy link

codecov bot commented Feb 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.14%. Comparing base (4c8b06d) to head (b9e88f0).

❗ Current head b9e88f0 differs from pull request most recent head 1573b1c. Consider uploading reports for the commit 1573b1c to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8374   +/-   ##
=======================================
  Coverage   87.13%   87.14%           
=======================================
  Files         251      251           
  Lines       12269    12272    +3     
  Branches     3869     3871    +2     
=======================================
+ Hits        10691    10694    +3     
  Misses       1306     1306           
  Partials      272      272           
Flag Coverage Δ
unittest 87.14% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...plugin/src/rules/prefer-string-starts-ends-with.ts 97.46% <100.00%> (+0.03%) ⬆️
...s/eslint-plugin/src/util/collectUnusedVariables.ts 93.13% <100.00%> (ø)

auvred
auvred previously approved these changes Feb 23, 2024
Copy link
Member

@auvred auvred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! 🔥

@JoshuaKGoldberg JoshuaKGoldberg merged commit 32d8a8f into typescript-eslint:main Mar 5, 2024
54 of 57 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: [prefer-string-starts-ends-with] Option to ignore [0] === cases?
3 participants