-
Notifications
You must be signed in to change notification settings - Fork 12k
fix(@schematics/angular): consecutive blank lines in routing.module.ts #18226
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
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.
Hi @sacgrover,
Thanks for this, however I think the proper fix would be something like the below, as otherwise when there is the import for the component file there wouldn't be a blank line between the import and the const declaration.
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';<% if (lazyRoute) { %>
import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';<% } %>
const routes: Routes = [<% if (lazyRoute) { %>{ path: '', component: <%= classify(name) %>Component }<% } %>];
@alan-agius4 Ok, I will do that.. Actually, I made the same earlier but to make it consistent with other I modified. Because there are a blank line between module import and component import in other places. |
@sacgrover, I see, in that case there should be a blank line in the logical statement and before the constant declaration. import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';<% if (lazyRoute) { %>
import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';<% } %>
const routes: Routes = [<% if (lazyRoute) { %>{ path: '', component: <%= classify(name) %>Component }<% } %>]; |
Changes done as per asked. |
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, thanks
Could You please rerun it as i don't have permissions for 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. |
Fixes: #18220