-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(eslint-plugin): add allowedPrefixes
prop to interface-name-prefix
#1433
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): add allowedPrefixes
prop to interface-name-prefix
#1433
Conversation
Thanks for the PR, @G-Rath! 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. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day. |
Codecov Report
@@ Coverage Diff @@
## master #1433 +/- ##
==========================================
+ Coverage 94.48% 94.55% +0.06%
==========================================
Files 142 142
Lines 6077 6076 -1
Branches 1726 1726
==========================================
+ Hits 5742 5745 +3
+ Misses 182 180 -2
+ Partials 153 151 -2
|
packages/eslint-plugin/tests/rules/interface-name-prefix.test.ts
Outdated
Show resolved
Hide resolved
allowedNames
prop to interface-name-prefix
allowedPrefixes
prop to interface-name-prefix
@G-Rath you don't have force push commits as we always squash changes before merging (all other merge methods are disabled in this repo) (this helps with tracking what review comments was addressed in commit) |
@armano2 cheers for the reminder - I've been bouncing between a bunch of OSS repos, so my brains been autopiloting a bit 😂 Thanks btw for the very good example of PM vs AM - I completely didn't think of it. |
Thanks for submitting this, but this rule is about to be deprecated. |
@bradzacher we do not know when #1318 will be ready, and this one can be good enough as temp fix while ppl are waiting. |
#1318 is ready, I just need to fix up the recommended config tests/generator so that it doesn't remove deprecated rules. |
|
@bradzacher hate to bother you with this, but would you be able to help me form a regex using The example you provided in the original PR works perfectly as a replacement for
But I can't come up with a regex that doesn't match IAM but still matches other (I'm having trouble in general figuring out how to make exclusions work, such as to allow |
For reference; the You could go with a more complex regex to support multiple cases. This will work if your node version supports negative look-behinds.
Make sure |
Which is why I made this PR :)
Amazing thanks! I had a feeling negative look-behinds would be the case - playing around with that regexp, to me it seems like that might actually be the The Right One for that rule? (not that it matters since it's deprecated) - I can't think of a combo that generates a false positive. Might be worth sticking somewhere - maybe a block under the deprecation notice for Regardless, thanks again 😄 |
I hit this when working on my Terraform generator/parser/importer, where I have interfaces called
IAM
.I've added
IAM
as the default value, but can remove that - it's the only real exception I could think of that made sense, but there could be more.Also happy to not make it an option and just hardcode it instead 🤷♂