Skip to content

Automatically run a formatter command after ng generate #10777

@supdegrave

Description

@supdegrave

Versions

Angular CLI: 6.0.0
Node: 9.5.0
OS: darwin x64
Angular: 6.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.6.0
@angular-devkit/build-angular      0.6.0
@angular-devkit/build-ng-packagr   0.6.0
@angular-devkit/build-optimizer    0.6.0
@angular-devkit/core               0.6.0
@angular-devkit/schematics         0.6.0
@angular/cdk                       6.0.1
@angular/material                  6.0.1
@ngtools/json-schema               1.1.0
@ngtools/webpack                   6.0.0
@schematics/angular                0.6.0
@schematics/update                 0.6.0
ng-packagr                         3.0.0-rc.3
rxjs                               6.1.0
typescript                         2.7.2
webpack                            4.6.0

Repro steps

  • $ ng new ng6-test
  • $ cd ng6-test
  • Open .editorconfig and change indent_size = 2 to indent_size = 4, and save.
  • Open angular.json in VSCode and run 'Format Document', and save.
  • $ ng generate library fnord
  • Open ./ng6-test/projects/fnord/src/lib/fnord.component.ts.

Observed behavior

  • angular.json is restored default indent size
  • fnord.component.ts is generated with indent_size = 2 as well

Both files ignore .editorconfig setting.

Desired behavior

  • Generated files should honor .editorconfig settings.
  • Files should not be restored to default indent_size after setting is changed to a different value.

Mention any other details that might be useful (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P5The team acknowledges the request but does not plan to address it, it remains open for discussionarea: @schematics/angularfeatureIssue that requests a new featurefeature: under considerationFeature request for which voting has completed and the request is now under consideration

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions