-
Notifications
You must be signed in to change notification settings - Fork 0
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
Added new rule to report anything that filename contains util #57
base: main
Are you sure you want to change the base?
Conversation
.github/workflows/ci.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should update ci.yml to the latest, i.e. node 20/21
package.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be worth doing another PR to update this repo to the latest stuff before adding this functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created new PR #59
src/no-util.spec.ts
Outdated
errors: [{ message: `File name 'test-util.ts' contains banned 'util' pattern.` }], | ||
}, | ||
{ | ||
filename: 'testUtil.ts', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure these last two should be banned. I'm thinking the regex is more like [non-alphanumeric or start-of-line]util[non-alphanumeric or end-of-line]
We should also have tests for things in a util
directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/util/utility-test.ts
should we report this as it is under util directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the /util/ part makes it problematic
src/no-util.ts
Outdated
return { | ||
Program() { | ||
const filename = context.filename; | ||
const utilRegex = /util/iu; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need this regex to be more sophisticated, e.g. electric-utility.ts
shouldn't be banned, but something like electric-util.ts
should be.
❌ PR review status - reviewer has not approved |
One other thing to think about is how this combines with the |
Coverage after merging no-util-rule into main will be
Coverage Report
|
Beta Published - Install Command: |
@carlansley I tested it , seems problem when we disable |
Closes #56