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
Schematics class name validation #23485
base: main
Are you sure you want to change the base?
Conversation
…g without using a `.` `.` is not a valid character in ES6 class names. Prior to this change `foo.module` before used to be incorrectly classified to `Foo.Module` instead of `FooModule`. Closes angular#13824
d271e42
to
8d8faec
Compare
| @@ -89,7 +90,7 @@ export function classify(str: string): string { | |||
| return str | |||
| .split('.') | |||
| .map((part) => capitalize(camelize(part))) | |||
| .join('.'); | |||
| .join(''); | |||
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 wondering if this would be a breaking change since it is public and it could be expected to operate in the previous manner.
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.
Umm… not sure show to classify this since technically it is was an incorrect behaviour.
Maybe we should discuss it during our next sync.
With this change we prevent creating classes with invalid characters. Closes angular#12868
8d8faec
to
0fc7b05
Compare
fix(@angular-devkit/core):
classifystring util should concat string without using a..is not a valid character in ES6 class names.Prior to this change
foo.modulebefore used to be incorrectly classified toFoo.Moduleinstead ofFooModule.Closes #13824
fix(@schematics/angular): prevent numbers from class names
With this change we prevent creating classes with invalid characters.
Closes #12868
Combined into a single PR as they are dependent on each other.