-
-
Notifications
You must be signed in to change notification settings - Fork 243
[sort-ngmodule-metadata-arrays] --fix
not able to correct all the reports once
#675
New iss 8000 ue
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
also // ..
@NgModule({
declarations: [AppComponent],
imports: [
AppRoutingModule,
BrowserModule,
FlexLayoutModule,
HttpClientModule,
MatListModule,
MatMenuModule,
MatSidenavModule,
MatToolbarModule,
BrowserAnimationsModule
],
bootstrap: [AppComponent]
})
// ... and not sorted // ...
@NgModule({
imports: [
TableBuilderModule.forRoot(),
CommonModule,
FormsModule,
MatButtonModule,
MatInputModule,
MatMenuModule,
ReactiveFormsModule
],
entryComponents: [CodeDialogComponent, DialogTemplateComponent],
declarations: [CodeDialogComponent, DialogTemplateComponent],
exports: [
CodeDialogComponent,
DragDropModule,
FormsModule,
MatButtonModule,
MatCardModule,
MatCheckboxModule,
MatDialogModule,
MatDividerModule,
MatInputModule,
MatListModule,
MatProgressSpinnerModule,
MatSelectModule,
MatIconModule,
MatSidenavModule,
MatSnackBarModule,
MatToolbarModule,
ScrollingModule,
TableBuilderModule,
MatTableModule,
MatTabsModule,
MatMenuModule
]
})
// ... |
@timdeschryver could you help me? |
Hi @splincode, I'm not Tim, but I'll try to help you 🖖 The fixer itself indeed works as you can see here (and in many other places in the file mentioned below), for example: angular-eslint/packages/eslint-plugin/tests/rules/sort-ngmodule-metadata-arrays/cases.ts Lines 82 to 99 in b38d828
The problem you might be facing is that, as described at the official ESLint documentation, the fixer process will repeat up to 10 times, or until no more fixable problems are found. In other words, to completely fix the code you showed us above, according to this rule, you would probably need more than 10 iterations/processes and that's why you still see report problems. On the other hand, I can see that the algorithm that finds unordered nodes can be improved to avoid as many iterations as currently: angular-eslint/packages/eslint-plugin/src/rules/sort-ngmodule-metadata-arrays.ts Lines 36 to 41 in f993069
But note that, depending on how many changes are needed, you'll still hit the 10-limit problem. Also, minor notes about your issue report:
|
Can you improved this code?
|
--fix
not able to correct all the reports once
Thanks all, closing in favour of #1232 please subscribe to that issue for updates |
Uh oh!
There was an error while loading. Please reload this page.
After run with
--fix
didn't work for my cases:Versions
@angular-eslint/eslint-plugin
@typescript-eslint/parser
ESLint
node
The text was updated successfully, but these errors were encountered: