Skip to content

Refactor lRegExp usage to receive regexes instead of strings#2446

Merged
ericcornelissen merged 7 commits intomainfrom
refactor-lregexp-usage
Apr 4, 2026
Merged

Refactor lRegExp usage to receive regexes instead of strings#2446
ericcornelissen merged 7 commits intomainfrom
refactor-lregexp-usage

Conversation

@ericcornelissen
Copy link
Copy Markdown
Owner

@ericcornelissen ericcornelissen commented Mar 29, 2026

Relates to #2122, #2129, #2436, #2437

This is in order to ensure that `eslint-plugin-regexp` still validates
them.

Bump `@ericcornelissen/lregexp` to at least 1.0.7 because earlier
versions don't properly pass on flags from regular expression passed to
the constructor.

Disabled the `regexp/require-unicode-regexp` rule because the `u` flag
is incompatible with the `l` flag.

The `crs` regular expression was optimized based on feedback from
eslint-plugin-regexp:

     /(?:(\r\n)|\r)/g can be optimized to /(\r\n)|\r/g
     unicorn/better-regex

This commit only covers the `no-shell.js` files as a starting point and
proof of concept.
@ericcornelissen ericcornelissen added the refactor Changes existing code without changing functionality label Mar 29, 2026
@github-actions github-actions bot added dependencies Changes to the project's dependencies test Relates to testing meta Relates to the project or repository itself labels Mar 29, 2026
@ericcornelissen

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@ericcornelissen

This comment was marked as resolved.

@coderabbitai

This comment has been minimized.

@coderabbitai

This comment has been minimized.

coderabbitai[bot]

This comment was marked as resolved.

@ericcornelissen ericcornelissen merged commit 796eb2c into main Apr 4, 2026
59 checks passed
@ericcornelissen ericcornelissen deleted the refactor-lregexp-usage branch April 4, 2026 19:05
@ericcornelissen ericcornelissen removed the test Relates to testing label Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Changes to the project's dependencies meta Relates to the project or repository itself refactor Changes existing code without changing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant