Ajoute ESLint : base partagée + couche Angular de @avalon-vanguard/config
- eslint.config.js reprend l'exemple du README du paquet (préfixe app, comme dans
angular.json), plus les sorties ignorées par .gitignore (out-tsc, rapports
Playwright, cache de l'ETL…) : ESLint ne lit pas .gitignore, et un
playwright-report/index.html local serait sinon lu comme un template Angular.
- devDependencies aux mêmes plages que web-site (main) : eslint ^10.10.0,
@eslint/js ^10.0.1, typescript-eslint ^8.70.0, angular-eslint ^22.5.0. Le paquet
partagé les déclare en pairs optionnels : chaque dépôt qui l'importe les garde.
- Script "lint" : eslint .
`npm run lint` signale 37 erreurs existantes (14 prefer-inject, 18 no-unused-vars,
4 no-useless-assignment, 1 no-unused-expressions), corrigées dans les commits
suivants.
package-lock.json : angular-eslint tire @angular-devkit/core 22.2, qui épingle
picomatch 4.0.7 ; npm remonte donc picomatch 4.0.4 → 4.0.7 (et retire la copie
4.0.5 de vite), @jridgewell/sourcemap-codec 1.5.5 → 1.6.0, et remonte ora.
Vérifié depuis un `npm ci` propre contre main 822c699 : les 33 fichiers du
`ng build` de production ont le même sha256, et prettier --check, les 5 typechecks,
`ng test` (729 tests verts) et `playwright test --list` (17 tests) sont identiques.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
|||||||
|
// @ts-check
|
||||||
|
const { defineConfig } = require('eslint/config');
|
||||||
|
const avalonBase = require('@avalon-vanguard/config/eslint');
|
||||||
|
const avalonAngular = require('@avalon-vanguard/config/eslint/angular');
|
||||||
|
|
||||||
|
module.exports = defineConfig([
|
||||||
|
{
|
||||||
|
// Build, test and Playwright output (see .gitignore): ESLint does not read .gitignore.
|
||||||
|
ignores: [
|
||||||
|
'dist/**',
|
||||||
|
'coverage/**',
|
||||||
|
'.angular/**',
|
||||||
|
'node_modules/**',
|
||||||
|
'out-tsc/**',
|
||||||
|
'tools/etl/.cache/**',
|
||||||
|
'e2e/test-output/**',
|
||||||
|
'test-results/**',
|
||||||
|
'playwright-report/**',
|
||||||
|
'blob-report/**',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*.ts'],
|
||||||
|
extends: [avalonBase, avalonAngular.typescript],
|
||||||
|
rules: {
|
||||||
|
'@angular-eslint/directive-selector': [
|
||||||
|
'error',
|
||||||
|
{ type: 'attribute', prefix: 'app', style: 'camelCase' },
|
||||||
|
],
|
||||||
|
'@angular-eslint/component-selector': [
|
||||||
|
'error',
|
||||||
|
{ type: 'element', prefix: 'app', style: 'kebab-case' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
avalonAngular.templates,
|
||||||
|
]);
|
||||||
Generated
+1405
-67
File diff suppressed because it is too large
Load Diff
@@ -7,6 +7,7 @@
|
|||||||
"build": "ng build",
|
"build": "ng build",
|
||||||
"watch": "ng build --watch --configuration development",
|
"watch": "ng build --watch --configuration development",
|
||||||
"test": "ng test",
|
"test": "ng test",
|
||||||
|
"lint": "eslint .",
|
||||||
"etl": "tsx tools/etl/build.ts",
|
"etl": "tsx tools/etl/build.ts",
|
||||||
"etl:typecheck": "tsc -p tools/etl/tsconfig.json --noEmit",
|
"etl:typecheck": "tsc -p tools/etl/tsconfig.json --noEmit",
|
||||||
"e2e": "playwright test",
|
"e2e": "playwright test",
|
||||||
@@ -34,16 +35,20 @@
|
|||||||
"@angular/cli": "^22.0.6",
|
"@angular/cli": "^22.0.6",
|
||||||
"@angular/compiler-cli": "^22.0.0",
|
"@angular/compiler-cli": "^22.0.0",
|
||||||
"@avalon-vanguard/config": "^1.0.0",
|
"@avalon-vanguard/config": "^1.0.0",
|
||||||
|
"@eslint/js": "^10.0.1",
|
||||||
"@playwright/test": "^1.61.1",
|
"@playwright/test": "^1.61.1",
|
||||||
"@tailwindcss/postcss": "^4.3.2",
|
"@tailwindcss/postcss": "^4.3.2",
|
||||||
"@types/node": "^26.1.1",
|
"@types/node": "^26.1.1",
|
||||||
"@types/three": "^0.185.1",
|
"@types/three": "^0.185.1",
|
||||||
|
"angular-eslint": "^22.5.0",
|
||||||
|
"eslint": "^10.10.0",
|
||||||
"jsdom": "^28.0.0",
|
"jsdom": "^28.0.0",
|
||||||
"postcss": "^8.5.19",
|
"postcss": "^8.5.19",
|
||||||
"prettier": "^3.8.1",
|
"prettier": "^3.8.1",
|
||||||
"tailwindcss": "^4.3.2",
|
"tailwindcss": "^4.3.2",
|
||||||
"tsx": "^4.23.1",
|
"tsx": "^4.23.1",
|
||||||
"typescript": "~6.0.2",
|
"typescript": "~6.0.2",
|
||||||
|
"typescript-eslint": "^8.70.0",
|
||||||
"vitest": "^4.0.8"
|
"vitest": "^4.0.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user