-
Notifications
You must be signed in to change notification settings - Fork 6.8k
build: add tslint rule for consistent file name casing #14536
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
Conversation
3d8a0a7
to
260803c
Compare
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.
Why not just use "file-name-casing": [true, "kebab-case"],
and either:
- Exclude the
tools/tslint-rules
directory - Or if we argue that we still want to run other rules against our own custom rules, we can just add a tslint disable comment for the file-naming casing. That's still a win and avoids duplicating of existing rules IMO.
I did it because:
|
I kind of see your point, but I'm hesitant because we can simply avoid having another rule.
It just feels wrong to me to add a custom rule for something that can be easily replaced by an official rule. Especially since that's basically why |
It not just 5 files though. These are the files that would fail the check:
It'll start looking even weirder when we have to start placing that |
Ah, I didn't realize that this also affects the schematic rules because I thought we exclude the It's true that it's easier to maintain the rule instead of a list like that then. |
tslint.json
Outdated
@@ -129,6 +129,11 @@ | |||
"./tools/package-tools/rollup-globals.ts", | |||
"src/+(lib|cdk|material-examples|material-experimental|cdk-experimental)/!(schematics)**/*.ts" | |||
], | |||
"file-name-casing-scoped": [ | |||
true, | |||
// Exclude lint rule file since they have to always be camel cased and end with `Rule`. |
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 say plural: tslint rule files
?
Actually the official tslint rule landed support for custom filename casing some days ago. This could spare us the additional custom rule and we can still get all benefits from a custom rule. It's just not released yet. I'm fine getting this in the meanwhile (even though it's urgent) or we just wait. |
Adds a tslint rule to enforce that the casing on our filenames is consistent. The tslint rule files are excluded, because their names have to be in camel case and end with `Rule`.
260803c
to
d75ba3c
Compare
I've left in a TODO to consider replacing the rule once those changes are released. |
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.
LGTM
Adds a tslint rule to enforce that the casing on our filenames is consistent. The tslint rule files are excluded, because their names have to be in camel case and end with `Rule`.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Adds a tslint rule to enforce that the casing on our filenames is consistent. The tslint rule files are excluded, because their names have to be in camel case and end with
Rule
.