Skip to content

Commit

Permalink
Configure eslint and fix few warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Socolin committed Apr 1, 2024
1 parent 5bf57ae commit 16db99e
Show file tree
Hide file tree
Showing 51 changed files with 448 additions and 191 deletions.
12 changes: 5 additions & 7 deletions frontend/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,27 @@
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/no-empty-lifecycle-method": 0,
"@angular-eslint/directive-selector": [
"error",
"off",
{
"type": "attribute",
"prefix": "admin",
"prefix": "app",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
"off",
{
"type": "element",
"prefix": "admin",
"prefix": "app",
"style": "kebab-case"
}
]
Expand Down
15 changes: 9 additions & 6 deletions frontend/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": [
"src/tsconfig.json"
],
"exclude": ["**/node_modules/**"]
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
Expand All @@ -147,6 +147,9 @@
}
},
"cli": {
"analytics": false
"analytics": false,
"schematicCollections": [
"@angular-eslint/schematics"
]
}
}
267 changes: 267 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"ng": "ng",
"start": "ng serve",
"start:windows": "ng serve --host 0.0.0.0",
"lint": "eslint \"src/**/*.ts\"",
"lint": "ng lint",
"test": "ng test",
"build": "node --max_old_space_size=16384 ./node_modules/@angular/cli/bin/ng build --configuration production",
"pree2e": "webdriver-manager update --standalone false --gecko false",
Expand Down Expand Up @@ -55,6 +55,8 @@
"@types/jasmine": "~3.6.2",
"@types/node": "^18.19.28",
"@types/leaflet": "^1.5.19",
"@typescript-eslint/eslint-plugin": "7.4.0",
"@typescript-eslint/parser": "7.4.0",
"eslint": "^8.57.0",
"jasmine-core": "~5.1.2",
"jasmine-spec-reporter": "~7.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h2 mat-dialog-title>Ajouter une action</h2>
<ng-template [ngSwitchCase]="'addItem'">
<autocomplete-input [clearOnSelect]="false"
[placeholder]="'Objet'"
(onSelect)="selectItemTemplate($event)"
(selected)="selectItemTemplate($event)"
[callback]="autocompleteItemCallback">
</autocomplete-input>
<div *ngIf="selectedItemTemplate?.data?.quantifiable">
Expand Down Expand Up @@ -59,7 +59,7 @@ <h2 mat-dialog-title>Ajouter une action</h2>
</stats-modifier-editor>
</ng-template>
<ng-template [ngSwitchCase]="'addEffect'">
<active-effect-editor [reusableToggle]="false" (onChange)="updateEffect($event)">
<active-effect-editor [reusableToggle]="false" (changed)="updateEffect($event)">
</active-effect-editor>
</ng-template>
<ng-template ngSwitchDefault>
Expand Down
6 changes: 2 additions & 4 deletions frontend/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* tslint:disable:no-unused-variable */

import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
import {async, TestBed} from '@angular/core/testing';
import {AppComponent} from './app.component';

describe('AppComponent', () => {
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/character/add-item-dialog.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="category mat-caption">{{result.sectionName}} - {{result.subCategoryName}}</div>
</div>
</button>
<button disabled *ngIf="filteredItemTemplates && filteredItemTemplates.length == 0">
<button disabled *ngIf="filteredItemTemplates && filteredItemTemplates.length === 0">
Aucun objet trouvé
</button>
</mat-action-list>
Expand Down
Loading

0 comments on commit 16db99e

Please sign in to comment.