Skip to content

Commit

Permalink
chore: integrate eslint properly
Browse files Browse the repository at this point in the history
- Use ESLint in CI
- Upgrade to Flat Configuration
- Fix Codebase of all linting errors and warnings
- Use unused imports plugin
  • Loading branch information
rainerhahnekamp authored Jan 5, 2025
1 parent 898af7f commit 6759f9d
Show file tree
Hide file tree
Showing 46 changed files with 943 additions and 947 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

68 changes: 0 additions & 68 deletions .eslintrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
node-version: '18'
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm run lint:all
- run: pnpm run test:all
- run: pnpm run build:all
- run: ./integration-tests.sh
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pnpm lint-staged
pnpm verify:all
22 changes: 0 additions & 22 deletions apps/demo-e2e/.eslintrc.json

This file was deleted.

31 changes: 0 additions & 31 deletions apps/demo-e2e/playwright.config.ts

This file was deleted.

20 changes: 0 additions & 20 deletions apps/demo-e2e/project.json

This file was deleted.

8 changes: 0 additions & 8 deletions apps/demo-e2e/src/example.spec.ts

This file was deleted.

37 changes: 0 additions & 37 deletions apps/demo/.eslintrc.json

This file was deleted.

29 changes: 29 additions & 0 deletions apps/demo/eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const nx = require('@nx/eslint-plugin');
const baseConfig = require('../../eslint.config.cjs');

module.exports = [
...baseConfig,
...nx.configs['flat/angular'],
...nx.configs['flat/angular-template'],
{
files: ['**/*.ts'],
rules: {
'@angular-eslint/directive-selector': [
'error',
{
type: 'attribute',
prefix: 'demo',
style: 'camelCase',
},
],
'@angular-eslint/component-selector': [
'error',
{
type: 'element',
prefix: 'demo',
style: 'kebab-case',
},
],
},
}
];
2 changes: 1 addition & 1 deletion apps/demo/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable */
export default {
displayName: 'demo',
preset: '../../jest.preset.js',
Expand Down
2 changes: 0 additions & 2 deletions apps/demo/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
"apps/demo/src/assets"
],
"styles": [
"node_modules/@angular-architects/paper-design/assets/css/bootstrap.css",
"node_modules/@angular-architects/paper-design/assets/scss/paper-dashboard.scss",
"@angular/material/prebuilt-themes/deeppurple-amber.css",
"apps/demo/src/styles.css"
],
Expand Down
4 changes: 0 additions & 4 deletions apps/demo/src/app/app.component.css

This file was deleted.

40 changes: 23 additions & 17 deletions apps/demo/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
<demo-sidebar-cmp>
<div class="nav">
<mat-toolbar color="primary">
<span>NgRx Toolkit Demo</span>
</mat-toolbar>
<mat-drawer-container class="container">
<mat-drawer mode="side" opened>
<mat-nav-list>
<a mat-list-item routerLink="/todo">DevTools</a>
<a mat-list-item routerLink="/flight-search">withRedux</a>
<a mat-list-item routerLink="/flight-search-data-service-simple">withDataService (Simple)</a>
<a mat-list-item routerLink="/flight-search-data-service-dynamic">withDataService (Dynamic)</a>
<a mat-list-item routerLink="/flight-search-with-pagination">withPagination</a>
<a mat-list-item routerLink="/flight-search-redux-connector">Redux Connector</a>
<a mat-list-item routerLink="/flight-search-data-service-simple"
>withDataService (Simple)</a
>
<a mat-list-item routerLink="/flight-search-data-service-dynamic"
>withDataService (Dynamic)</a
>
<a mat-list-item routerLink="/flight-search-with-pagination"
>withPagination</a
>
<a mat-list-item routerLink="/flight-search-redux-connector"
>Redux Connector</a
>
<a mat-list-item routerLink="/todo-storage-sync">withStorageSync</a>
</mat-nav-list>
</div>

<div class="content">
<mat-toolbar color="primary">
<span>NGRX Toolkit Demo</span>
</mat-toolbar>

<div class="app-container">
<router-outlet></router-outlet>
</mat-drawer>
<mat-drawer-content>
<div class="content">
<router-outlet />
</div>
</div>
</demo-sidebar-cmp>
</mat-drawer-content>
</mat-drawer-container>
27 changes: 18 additions & 9 deletions apps/demo/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@
import { SelectionModel } from '@angular/cdk/collections';
import { Component, effect, inject } from '@angular/core';
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
import { Component } from '@angular/core';
import { MatTableModule } from '@angular/material/table';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { Todo, TodoStore } from './devtools/todo-store';
import { MatIconModule } from '@angular/material/icon';
import { CategoryStore } from './category.store';
import { RouterLink, RouterOutlet } from '@angular/router';
import { SidebarComponent } from './core/sidebar/sidebar.component';
import { CommonModule } from '@angular/common';
import { MatToolbarModule } from '@angular/material/toolbar';
import { MatListItem, MatListModule } from '@angular/material/list';
import { MatListModule } from '@angular/material/list';
import {
MatDrawer,
MatDrawerContainer,
MatDrawerContent,
} from '@angular/material/sidenav';

@Component({
selector: 'demo-root',
templateUrl: './app.component.html',
styleUrl: './app.component.css',
imports: [
MatTableModule,
MatCheckboxModule,
MatIconModule,
MatListModule,
RouterLink,
RouterOutlet,
SidebarComponent,
CommonModule,
MatToolbarModule,
MatDrawer,
MatDrawerContainer,
MatDrawerContent,
],
styles: `
.container {
display: inline;
}
.content {
margin: 4em;
}`,
})
export class AppComponent {}
1 change: 0 additions & 1 deletion apps/demo/src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ApplicationConfig, importProvidersFrom } from '@angular/core';
import { provideRouter, withComponentInputBinding } from '@angular/router';
import { appRoutes } from './app.routes';
import { provideClientHydration } from '@angular/platform-browser';
import { provideAnimations } from '@angular/platform-browser/animations';
import { provideHttpClient } from '@angular/common/http';
import { LayoutModule } from '@angular/cdk/layout';
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/src/app/devtools/todo-detail.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, effect, inject, input } from '@angular/core';
import { MatCard, MatCardModule } from '@angular/material/card';
import { MatCardModule } from '@angular/material/card';
import { Todo } from './todo-store';
import { signalStore, withState } from '@ngrx/signals';
import {
Expand Down
3 changes: 1 addition & 2 deletions apps/demo/src/app/devtools/todo.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Component, effect, inject, input } from '@angular/core';
import { Component, effect, inject } from '@angular/core';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatIconModule } from '@angular/material/icon';
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
import { SelectionModel } from '@angular/cdk/collections';
import { Todo, TodoStore } from './todo-store';
import { CategoryStore } from '../category.store';
import { TodoDetailComponent } from './todo-detail.component';

@Component({
Expand Down
Loading

0 comments on commit 6759f9d

Please sign in to comment.