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

Idea: Using RegExp Linter #2141

Open
pano9000 opened this issue Jan 4, 2023 · 0 comments
Open

Idea: Using RegExp Linter #2141

pano9000 opened this issue Jan 4, 2023 · 0 comments

Comments

@pano9000
Copy link
Contributor

pano9000 commented Jan 4, 2023

Just noting down a quick idea for the future here:

Since a lot of this project revolves around working with RegExps, it could make sense to enforce certain RegExps rules, to ensure you have consistent RegExps, e.g. just looking at the "isMobilePhone" validator, there are quite a few different "RegExp" styles used in there for expressing some ranges, as there is no real "rule" or guideline in place currently.

One solution could be to incorporate this ESLint plugin, since ESLint is already used in this project:
https://ota-meshi.github.io/eslint-plugin-regexp/

I haven't played around with it yet, but at a first look, it does look pretty nice and extensive.
Their rules are also nicely presented: https://ota-meshi.github.io/eslint-plugin-regexp/rules/

Again, just an idea for the future here :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant