-
Notifications
You must be signed in to change notification settings - Fork 12k
LintFix config option disappeared in v6?! (ng generate produces invalid code!) #11034
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
Comments
I would also like to see this feature back in the CLI. At the moment I have to manually fix all generated files, as I am using a few different configurations then the default. |
It really needs to be fixed! |
I think this is a dupe of #10013 but until investigation I'm not going to close this issue. |
I don't think this is a duplicate of #10013 - this issue is about no longer being able to set the lintFix option at all since 6.0. 10013 is about tslint type checking not working correctly in 1.7.3 with the lintFix option working correctly. |
I just noticed, that the Also, in the new configuration, there is a |
Is this released? Couldn't find anything in the patchnotes of the @angular/cli project. And is it defined the same as before? Where can I find a proper documentation for the |
@Vaelor There does not seem to be a documentation for it. |
@Springrbua Thanks a lot, at least I now know I can use it with 6.2.X... :-) |
@Springrbua In the angular.json scroll to where the "schematics": {
"@schematics/angular:pipe": {
"lintFix": true
},
"@schematics/angular:class": {
"lintFix": true
},
"@schematics/angular:module": {
"lintFix": true
},
"@schematics/angular:service": {
"lintFix": true
},
"@schematics/angular:component": {
"lintFix": true,
"prefix": "app",
"styleext": "css"
},
"@schematics/angular:directive": {
"lintFix": true,
"prefix": "app"
}
} Now, running
|
Thanks @Vaelor. |
@Springrbua read your other issue, it does sound like it may be windows related? |
@Vaelor thanks for your reply. It really sounds like it is a windows related error, because I created a new project and it had the exact same project, while others can't reproduce it. |
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. |
Using Angular CLI v6.0.5. New Project
In pre-v6 projects, in
".angular-cli.json"
under"defaults"
section we had"lintFix": true
setting, which ensured that after generating new component/service/whatever the linting fixes where performed automatically. Now in new"angular.json"
(which replaces".angular-cli.json"
) I can't find similar option. Which is a HUGE problem!Suppose I have changed linter defaults to prefer "double quotes" for string (whoever said 'single quotes' should be default for TypeScript needs to be fired IMHO). Now every time I generate new component with
ng g component MyNewComponent
, it is created with all 'single quote' strings inside, instead of "double quotes"! And I have to manually fix them every time which is a nightmare!lintFix
setting solved that in previous CLI versions but now, what is an alternative?!The text was updated successfully, but these errors were encountered: