Skip to content

Conversation

@RunDevelopment
Copy link
Collaborator

@RunDevelopment RunDevelopment commented Apr 30, 2021

This improves the no-dupe-characters-character-class rule.

Changes:

  1. The rule is now fixable!
  2. It now finds more cases. E.g. the case [a-bc-db-c] was previously reported as a bunch of intersection messages. The rule now only reports that b-c is a subset of the other elements.
  3. Duplicates are now reported differently. E.g. [aa] both as were reported previously but now only the second a will be reported. I changed this because reporting both a doesn't work with fixers.
  4. More descriptive error messages.

I also fixed #189 while I was at it.


The rule now covers most of the functionality of clean-regex/optimized-character-class.

Copy link
Owner

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

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

Thank you for many improvements! LGTM!

@ota-meshi ota-meshi merged commit 2a85fc0 into master May 2, 2021
@ota-meshi ota-meshi deleted the no-dupe-characters-character-class-update branch May 2, 2021 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

no-dupe-characters-character-class: Incompatible flags: The i flag is forbidden to create a literal but required by the options.

3 participants