diff --git a/angular.json b/angular.json index 18e4e25..ab37160 100644 --- a/angular.json +++ b/angular.json @@ -91,11 +91,23 @@ ], "scripts": [] } + }, + "lint": { + "builder": "@angular-eslint/builder:lint", + "options": { + "lintFilePatterns": [ + "src/**/*.ts", + "src/**/*.html" + ] + } } } } }, "cli": { - "analytics": "33c8483f-3876-4eb5-9c9b-1001cab9b273" + "analytics": "33c8483f-3876-4eb5-9c9b-1001cab9b273", + "schematicCollections": [ + "angular-eslint" + ] } } diff --git a/bun.lockb b/bun.lockb index a60e455..6eb924c 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..99a007a --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,43 @@ +// @ts-check +const eslint = require("@eslint/js"); +const tseslint = require("typescript-eslint"); +const angular = require("angular-eslint"); + +module.exports = tseslint.config( + { + files: ["**/*.ts"], + extends: [ + eslint.configs.recommended, + ...tseslint.configs.recommended, + ...tseslint.configs.stylistic, + ...angular.configs.tsRecommended, + ], + processor: angular.processInlineTemplates, + rules: { + "@angular-eslint/directive-selector": [ + "error", + { + type: "attribute", + prefix: "app", + style: "camelCase", + }, + ], + "@angular-eslint/component-selector": [ + "error", + { + type: "element", + prefix: "app", + style: "kebab-case", + }, + ], + }, + }, + { + files: ["**/*.html"], + extends: [ + ...angular.configs.templateRecommended, + ...angular.configs.templateAccessibility, + ], + rules: {}, + } +); diff --git a/package.json b/package.json index 788cc2a..c39545f 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "start": "ng serve --proxy-config src/proxy.conf.json", "build": "ng build", "watch": "ng build --watch --configuration development", - "test": "ng test" + "test": "ng test", + "lint": "ng lint" }, "private": true, "dependencies": { @@ -21,6 +22,7 @@ "@angular/platform-browser-dynamic": "^19.0.4", "@angular/router": "^19.0.4", "keycloak-angular": "^16.1.0", + "prettier": "^3.4.2", "rxjs": "~7.8.1", "tailwind": "4.0.0", "tailwindcss": "^3.4.17", @@ -32,7 +34,9 @@ "@angular/cli": "^19.0.5", "@angular/compiler-cli": "^19.0.4", "@types/jasmine": "~5.1.5", + "angular-eslint": "19.0.2", "autoprefixer": "^10.4.20", + "eslint": "^9.16.0", "jasmine-core": "~5.2.0", "karma": "~6.4.4", "karma-chrome-launcher": "~3.2.0", @@ -40,6 +44,7 @@ "karma-jasmine": "~5.1.0", "karma-jasmine-html-reporter": "~2.1.0", "postcss": "^8.4.49", - "typescript": "~5.5.4" + "typescript": "~5.5.4", + "typescript-eslint": "8.18.0" } -} +} \ No newline at end of file