diff --git a/.husky/pre-commit b/.husky/pre-commit index 0da96d6baa..d24fdfc601 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -npx pretty-quick --staged +npx lint-staged diff --git a/.lintstagedrc.json b/.lintstagedrc.json new file mode 100644 index 0000000000..34322e19a5 --- /dev/null +++ b/.lintstagedrc.json @@ -0,0 +1,3 @@ +{ + "*": "prettier --write --ignore-unknown" +} diff --git a/angular/angular.json b/angular/angular.json index a8532b2553..50e14a4438 100644 --- a/angular/angular.json +++ b/angular/angular.json @@ -69,20 +69,14 @@ "configurations": { "production": { "servePath": "/angular/samples", - "browserTarget": "demo:build:production" + "buildTarget": "demo:build:production" }, "development": { "servePath": "/angular/samples", - "browserTarget": "demo:build:development" + "buildTarget": "demo:build:development" } }, "defaultConfiguration": "development" - }, - "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", - "options": { - "browserTarget": "demo:build" - } } } }, diff --git a/angular/demo/src/app/links.component.ts b/angular/demo/src/app/links.component.ts index cabfad953a..c9359b210c 100644 --- a/angular/demo/src/app/links.component.ts +++ b/angular/demo/src/app/links.component.ts @@ -9,12 +9,14 @@ export const links = new InjectionToken('app-links'); template: `

Samples:

`, - styles: ["@import '@agnos-ui/common/samples/links.scss';"], + styles: "@import '@agnos-ui/common/samples/links.scss';", }) export class LinksComponent { links = inject(links); diff --git a/angular/demo/src/app/samples/accordion/customHeaders.route.ts b/angular/demo/src/app/samples/accordion/customHeaders.route.ts index edff2097b3..218c191cb1 100644 --- a/angular/demo/src/app/samples/accordion/customHeaders.route.ts +++ b/angular/demo/src/app/samples/accordion/customHeaders.route.ts @@ -1,11 +1,10 @@ import {AgnosUIAngularModule} from '@agnos-ui/angular'; import {Component} from '@angular/core'; -import {NgIf} from '@angular/common'; import BODY from '!raw-loader!@agnos-ui/common/samples/accordion/body.txt'; @Component({ standalone: true, - imports: [AgnosUIAngularModule, NgIf], + imports: [AgnosUIAngularModule], template: `
@@ -31,17 +30,18 @@ import BODY from '!raw-loader!@agnos-ui/common/samples/accordion/body.txt'; Toggle first
-
-
- {{ BODY }} + @if (state!.shouldBeInDOM) { +
+
+ {{ BODY }} +
-
+ }
@@ -73,17 +73,18 @@ import BODY from '!raw-loader!@agnos-ui/common/samples/accordion/body.txt';
-
-
- {{ BODY }} + @if (state!.shouldBeInDOM) { +
+
+ {{ BODY }} +
-
+ }
@@ -107,24 +108,27 @@ import BODY from '!raw-loader!@agnos-ui/common/samples/accordion/body.txt'; > Third panel -

[I'm disabled]

+ @if (thirdDisabled) { +

[I'm disabled]

+ }
-
-
- {{ BODY }} + @if (state!.shouldBeInDOM) { +
+
+ {{ BODY }} +
-
+ }
`, - styles: ["@import '@agnos-ui/common/samples/accordion/custom.scss';"], + styles: "@import '@agnos-ui/common/samples/accordion/custom.scss';", }) export default class AccordionComponent { thirdDisabled = false; diff --git a/angular/demo/src/app/samples/alert/alert-icon.component.ts b/angular/demo/src/app/samples/alert/alert-icon.component.ts index 5095a1d17e..b5687c5f75 100644 --- a/angular/demo/src/app/samples/alert/alert-icon.component.ts +++ b/angular/demo/src/app/samples/alert/alert-icon.component.ts @@ -5,13 +5,12 @@ import biInfoCircleFill from '!raw-loader!bootstrap-icons/icons/info-circle-fill import biLightbulb from '!raw-loader!bootstrap-icons/icons/lightbulb.svg'; import type {AlertWidget} from '@agnos-ui/angular'; import {SlotComponent, SlotDirective} from '@agnos-ui/angular'; -import {NgIf} from '@angular/common'; import {Component, inject} from '@angular/core'; import {DomSanitizer} from '@angular/platform-browser'; @Component({ standalone: true, - imports: [NgIf, SlotDirective], + imports: [SlotDirective], providers: [SlotDirective], selector: 'app-icon-structure', host: { @@ -21,13 +20,9 @@ import {DomSanitizer} from '@angular/platform-browser';
- + @if (state.dismissible) { + + }
`, }) diff --git a/angular/demo/src/app/samples/alert/config.route.ts b/angular/demo/src/app/samples/alert/config.route.ts index 4b2c30ea3b..73e8f94731 100644 --- a/angular/demo/src/app/samples/alert/config.route.ts +++ b/angular/demo/src/app/samples/alert/config.route.ts @@ -1,6 +1,5 @@ import {AgnosUIAngularModule} from '@agnos-ui/angular'; import type {AlertComponent} from '@agnos-ui/angular'; -import {NgFor} from '@angular/common'; import {Component} from '@angular/core'; import {FormsModule} from '@angular/forms'; @@ -17,7 +16,7 @@ export enum AlertStatus { @Component({ standalone: true, - imports: [AgnosUIAngularModule, NgFor, FormsModule], + imports: [AgnosUIAngularModule, FormsModule], template: `

@@ -25,7 +24,9 @@ export enum AlertStatus {
diff --git a/angular/demo/src/app/samples/alert/dynamic.route.ts b/angular/demo/src/app/samples/alert/dynamic.route.ts index 7777fab2a0..75b0c9f2b4 100644 --- a/angular/demo/src/app/samples/alert/dynamic.route.ts +++ b/angular/demo/src/app/samples/alert/dynamic.route.ts @@ -1,6 +1,5 @@ import {AlertComponent} from '@agnos-ui/angular'; import type {AlertProps} from '@agnos-ui/angular'; -import {NgFor} from '@angular/common'; import {Component, Injectable} from '@angular/core'; @Injectable({providedIn: 'root'}) @@ -22,18 +21,19 @@ class AlertContainerService { @Component({ selector: 'app-alert-child', standalone: true, - imports: [AlertComponent, NgFor], + imports: [AlertComponent], template: ` - + @for (alert of alertContainerService.alerts; track alert) { + + } `, }) export class ChildComponent { diff --git a/angular/demo/src/app/samples/pagination/custom.route.ts b/angular/demo/src/app/samples/pagination/custom.route.ts index 16ab398286..13cac688a7 100644 --- a/angular/demo/src/app/samples/pagination/custom.route.ts +++ b/angular/demo/src/app/samples/pagination/custom.route.ts @@ -1,13 +1,12 @@ import {AgnosUIAngularModule} from '@agnos-ui/angular'; import type {PaginationContext} from '@agnos-ui/angular'; -import {NgIf} from '@angular/common'; import {Component} from '@angular/core'; const FILTER_PAG_REGEX = /[^0-9]/g; @Component({ standalone: true, - imports: [AgnosUIAngularModule, NgIf], + imports: [AgnosUIAngularModule], template: `

A pagination with customized links: