From 3f3eec82ca37cc086d2ed913ad883f51474810a6 Mon Sep 17 00:00:00 2001 From: matthieu-crouzet Date: Wed, 8 Jan 2025 09:00:59 +0100 Subject: [PATCH 1/2] fix(deps): align peer deps for eslint --- packages/@o3r/schematics/package.json | 2 +- yarn.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@o3r/schematics/package.json b/packages/@o3r/schematics/package.json index 8f3f64c596..f425e76c25 100644 --- a/packages/@o3r/schematics/package.json +++ b/packages/@o3r/schematics/package.json @@ -32,7 +32,7 @@ "@angular/cli": "^18.2.0", "@o3r/telemetry": "workspace:^", "@schematics/angular": "^18.2.0", - "eslint": "^9.14.0", + "eslint": ">=8.57.0 <9.15.0", "rxjs": "^7.8.1", "type-fest": "^4.10.2", "typescript": "^5.5.4" diff --git a/yarn.lock b/yarn.lock index 2757e3dd4d..7fa1d4fef4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10196,7 +10196,7 @@ __metadata: "@angular/cli": ^18.2.0 "@o3r/telemetry": "workspace:^" "@schematics/angular": ^18.2.0 - eslint: ^9.14.0 + eslint: ">=8.57.0 <9.15.0" rxjs: ^7.8.1 type-fest: ^4.10.2 typescript: ^5.5.4 From af41f0cfb5b22104321800661d30dbca079d32ea Mon Sep 17 00:00:00 2001 From: matthieu-crouzet Date: Wed, 8 Jan 2025 16:45:00 +0100 Subject: [PATCH 2/2] fix(eslint): provide default ignores when adding @o3r/eslint-config --- .../@o3r/eslint-config/schematics/ng-add/eslint/index.spec.ts | 3 +++ .../project/eslint.local.config.__extension__.template | 4 ++++ .../workspace/eslint.shared.config.__extension__.template | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/packages/@o3r/eslint-config/schematics/ng-add/eslint/index.spec.ts b/packages/@o3r/eslint-config/schematics/ng-add/eslint/index.spec.ts index 0671942f02..6e6560363f 100644 --- a/packages/@o3r/eslint-config/schematics/ng-add/eslint/index.spec.ts +++ b/packages/@o3r/eslint-config/schematics/ng-add/eslint/index.spec.ts @@ -63,6 +63,7 @@ describe('update eslint config', () => { expect(tree.readText('eslint.local.config.mjs')).toContain(`${monorepoPkgName}/projects`); expect(tree.readText('eslint.shared.config.mjs')).toContain(`${monorepoPkgName}/report-unused-disable-directives`); expect(tree.readText('eslint.shared.config.mjs')).toContain(`${monorepoPkgName}/eslint-config`); + expect(tree.readText('eslint.shared.config.mjs')).toContain(`${monorepoPkgName}/ignores`); }); it('should add an eslint config on an application', async () => { @@ -81,6 +82,7 @@ describe('update eslint config', () => { expect(tree.exists(`${libRoot}/tsconfig.eslint.json`)).toBeFalsy(); expect(tree.readText(`${appRoot}/eslint.config.mjs`)).toContain('import shared from \'../../eslint.shared.config.mjs\''); expect(tree.readText(`${appRoot}/eslint.local.config.mjs`)).toContain(`${pckName}/projects`); + expect(tree.readText(`${appRoot}/eslint.local.config.mjs`)).toContain(`${pckName}/ignores`); expect(tree.readText(`${appRoot}/eslint.local.config.mjs`)).toContain('...globals.browser'); expect(tree.readJson('angular.json')).toEqual({ ...angularJsonContent, @@ -115,6 +117,7 @@ describe('update eslint config', () => { expect(tree.exists(`${appRoot}/tsconfig.eslint.json`)).toBeFalsy(); expect(tree.readText(`${libRoot}/eslint.config.mjs`)).toContain('import shared from \'../../eslint.shared.config.mjs\''); expect(tree.readText(`${libRoot}/eslint.local.config.mjs`)).toContain(`${pckName}/projects`); + expect(tree.readText(`${libRoot}/eslint.local.config.mjs`)).toContain(`${pckName}/ignores`); expect(tree.readText(`${libRoot}/eslint.local.config.mjs`)).not.toContain('...globals.browser'); expect(tree.readJson('angular.json')).toEqual({ ...angularJsonContent, diff --git a/packages/@o3r/eslint-config/schematics/ng-add/eslint/templates/project/eslint.local.config.__extension__.template b/packages/@o3r/eslint-config/schematics/ng-add/eslint/templates/project/eslint.local.config.__extension__.template index 4df72f6665..7369d60d6d 100644 --- a/packages/@o3r/eslint-config/schematics/ng-add/eslint/templates/project/eslint.local.config.__extension__.template +++ b/packages/@o3r/eslint-config/schematics/ng-add/eslint/templates/project/eslint.local.config.__extension__.template @@ -23,5 +23,9 @@ const __dirname = dirname(__filename); ...globals.browser }<% } %> } + }, + { + name: '<%= packageName %>/ignores', + ignores: [] } ]; diff --git a/packages/@o3r/eslint-config/schematics/ng-add/eslint/templates/workspace/eslint.shared.config.__extension__.template b/packages/@o3r/eslint-config/schematics/ng-add/eslint/templates/workspace/eslint.shared.config.__extension__.template index a203b2b3cf..e884467791 100644 --- a/packages/@o3r/eslint-config/schematics/ng-add/eslint/templates/workspace/eslint.shared.config.__extension__.template +++ b/packages/@o3r/eslint-config/schematics/ng-add/eslint/templates/workspace/eslint.shared.config.__extension__.template @@ -13,6 +13,10 @@ const o3rTemplate = require('@o3r/eslint-config/template'); reportUnusedDisableDirectives: 'error' } }, + { + name: '<%= packageName %>/ignores', + ignores: [] + }, { name: '<%= packageName %>/settings', settings: {