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

Add regexp/sort-flags rule #164

Merged
merged 4 commits into from Apr 20, 2021
Merged

Add regexp/sort-flags rule #164

merged 4 commits into from Apr 20, 2021

Conversation

ota-meshi
Copy link
Owner

No description provided.

lib/rules/sort-flags.ts Outdated Show resolved Hide resolved
lib/rules/sort-flags.ts Outdated Show resolved Hide resolved
ota-meshi and others added 3 commits April 20, 2021 17:55
Co-authored-by: Michael Schmidt <mitchi5000.ms@googlemail.com>
@ota-meshi
Copy link
Owner Author

Thank you for your review!
I removed the option.

@RunDevelopment RunDevelopment merged commit 4db794e into master Apr 20, 2021
@RunDevelopment RunDevelopment deleted the sort-flags branch April 20, 2021 09:17
@RunDevelopment
Copy link
Collaborator

@ota-meshi I have a question: Do we have to worry about non-standard flags? v8 recently added an l flag. A standard JS parser will refuse to parse regexes with non-standard flags but a parser like Babel might just accept them.

@ota-meshi
Copy link
Owner Author

@RunDevelopment Thank you for the question!
I don't think the rule needs to handle and check non-standard flags, but I want to avoid the rule crashing due to non-standard flags.

There is a test case to check it.
https://github.com/ota-meshi/eslint-plugin-regexp/blob/master/tests/lib/rules-with-unknown-flag.ts

The typescript-eslint parser accepts any unknown flags.

@RunDevelopment
Copy link
Collaborator

Thank you for the answer.

I wonder if we should make a rule to disallow non-standard flags. Will such a rule be helpful?

@ota-meshi
Copy link
Owner Author

Sounds good! I think it helpful for TypeScript users!

@RunDevelopment
Copy link
Collaborator

Alright, I'll add it :)

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.

None yet

2 participants