-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Add automatic style fixing for ng new
and all generators.
#6272
Comments
Related #5599, should probably be addressed in the same PR (but separate commit). |
Currently blocked waiting for |
tslint v5.3.0 has just released |
#6415 is updating to the new tslint. Meanwhile, #6213 already added I'm not as confident on how we should automatically do it for new projects though... #3966 requests Perhaps a path to a |
Doesn't do it for me when I want to specify 4 spaces per indentation level, instead of the 2 spaces generated by Angular CLI. But I guess it's a bug in tslint. |
does this work at all? I cannot make it work, using latest angular-cli
with
With indent setting
and the feature lintFix to true I've tried to also use the command |
Tslint does not provide a fixer for the indent rule. See here for details: https://palantir.github.io/tslint/rules/ |
@clydin , the docs say "hasFixer".. so... ? |
oh... but "NOTE: auto-fixing will only convert invalid indent whitespace to the desired type, it will not fix invalid whitespace sizes." |
Not sure if this is the place for this, but I think it would be ab fab if before running |
maybe just have some custom post-processor that can be run on all files? |
@studds 😂 after figuring out what this means to abbreviate |
@filipesilva Since CLI v6, |
The following should help those using tab indentation. Angular cli code generation currently defaults to 2 space indentation. The indent setting in tslint.json needs to be set to 2 spaces to pick up the indentation in the generated angular cli files.
The part that I needed from the tslint rules page was
|
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. |
With palantir/tslint#2723 merged, TS Lint will allow both quotemark and indentation auto-fix. This, together with #6213, allows generators to automatically fix such style issues in generated files.
A flag to always auto-fix should be added to
.angular-cli.json
to always fix on generators:To allow this functionality for new projects, the global
.angular-cli.json
needs to be include some style information that will be used to overridetstlint
and.editorconfig
settings, and linting must run post install.The text was updated successfully, but these errors were encountered: