From d0767d94decf779ab4f396a3910058489348daa9 Mon Sep 17 00:00:00 2001 From: Antonio Campos Date: Thu, 29 Aug 2024 18:16:21 -0600 Subject: [PATCH 1/2] fix(deps): bump angular template dependencies --- generators/index.ts | 11 +++++ templates/node-angular/.eslintrc.cjs | 57 ------------------------ templates/node-angular/eslint.config.mjs | 21 +++++++++ templates/node-angular/package.json | 50 +++++++++++---------- 4 files changed, 58 insertions(+), 81 deletions(-) delete mode 100644 templates/node-angular/.eslintrc.cjs create mode 100644 templates/node-angular/eslint.config.mjs diff --git a/generators/index.ts b/generators/index.ts index 1b641ba..0068527 100644 --- a/generators/index.ts +++ b/generators/index.ts @@ -104,9 +104,20 @@ export default class extends Generator { this.templatePath( `${this.options.templateChoice}/.gitignore.template` ), this.destinationPath( '.gitignore' ), ); + // This copy of `eslintrc.cjs` should be removed once all templates support eslint v9 this.fs.copy( this.templatePath( `${this.options.templateChoice}/.eslintrc.cjs` ), this.destinationPath( '.eslintrc.cjs' ), + { + ignoreNoMatch: true + } + ); + this.fs.copy( + this.templatePath( `${this.options.templateChoice}/eslint.config.mjs` ), + this.destinationPath( 'eslint.config.mjs' ), + { + ignoreNoMatch: true + } ); this.fs.copy( this.templatePath(`${ path.dirname( this.options.templateChoice ) }/app/.github`), diff --git a/templates/node-angular/.eslintrc.cjs b/templates/node-angular/.eslintrc.cjs deleted file mode 100644 index 13f87ab..0000000 --- a/templates/node-angular/.eslintrc.cjs +++ /dev/null @@ -1,57 +0,0 @@ -/* eslint-env node */ - -module.exports = { - root: true, - env: { - browser: true, - es2020: true - }, - extends: [ - 'eslint:recommended', - ], - rules: { - 'semi': [ - 'warn', - 'always' - ], - 'quotes': [ - 'warn', - 'single' - ], - 'array-bracket-spacing': [ - 'warn', - 'always', - { - singleValue: true, - objectsInArrays: true, - arraysInArrays: true - } - ], - 'space-in-parens': [ - 'warn', - 'always' - ], - 'computed-property-spacing': [ - 'warn', - 'always' - ], - 'object-curly-spacing': [ - 'warn', - 'always' - ], - - 'no-console': [ - 'error', - { - allow: [ - 'error', - 'warn', - ] - } - ], - }, - ignorePatterns: [ - 'dist/**/*', - 'node_modules/**/*', - ] -}; diff --git a/templates/node-angular/eslint.config.mjs b/templates/node-angular/eslint.config.mjs new file mode 100644 index 0000000..539ffb3 --- /dev/null +++ b/templates/node-angular/eslint.config.mjs @@ -0,0 +1,21 @@ +import eslint from '@eslint/js'; +import tseslint from "typescript-eslint"; + +export default tseslint.config( + eslint.configs.recommended, + ...tseslint.configs.recommended, + { + files: [ + '**/*.js', + '**/*.jsx', + "**/*.ts", + ], + linterOptions: { + reportUnusedDisableDirectives: "warn" + }, + ignores: [ + 'dist/**/*', + 'node_modules/**/*', + ] + } +); diff --git a/templates/node-angular/package.json b/templates/node-angular/package.json index a2b9041..a5eea02 100644 --- a/templates/node-angular/package.json +++ b/templates/node-angular/package.json @@ -7,41 +7,43 @@ "build": "ng build", "watch": "ng build --watch --configuration development", "test": "ng test", - "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0" + "lint": "eslint . --max-warnings 0" }, "private": true, "dependencies": { - "@angular/animations": "^17.3.0", - "@angular/common": "^17.3.0", - "@angular/compiler": "^17.3.0", - "@angular/core": "^17.3.0", - "@angular/forms": "^17.3.0", - "@angular/platform-browser": "^17.3.0", - "@angular/platform-browser-dynamic": "^17.3.0", - "@angular/router": "^17.3.0", - "rxjs": "~7.8.0", - "tslib": "^2.3.0", - "zone.js": "~0.14.3", + "@angular/animations": "^18.2.2", + "@angular/common": "^18.2.2", + "@angular/compiler": "^18.2.2", + "@angular/core": "^18.2.2", + "@angular/forms": "^18.2.2", + "@angular/platform-browser": "^18.2.2", + "@angular/platform-browser-dynamic": "^18.2.2", + "@angular/router": "^18.2.2", + "rxjs": "~7.8.1", + "tslib": "^2.7.0", + "zone.js": "~0.14.10", "body-parser": "^1.20.2", "cors": "^2.8.5", - "dotenv": "^16.3.1", - "express": "^4.18.2", + "dotenv": "^16.4.5", + "express": "^4.19.2", "morgan": "^1.10.0", - "oracledb": "^6.2.0" + "oracledb": "^6.6.0" }, "devDependencies": { - "@angular-devkit/build-angular": "^17.3.0", - "@angular/cli": "^17.3.0", - "@angular/compiler-cli": "^17.3.0", - "@types/jasmine": "~5.1.0", - "jasmine-core": "~5.1.0", - "karma": "~6.4.0", + "@angular-devkit/build-angular": "^18.2.2", + "@angular/cli": "^18.2.2", + "@angular/compiler-cli": "^18.2.2", + "@types/jasmine": "~5.1.4", + "jasmine-core": "~5.2.0", + "karma": "~6.4.4", "karma-chrome-launcher": "~3.2.0", - "karma-coverage": "~2.2.0", + "karma-coverage": "~2.2.1", "karma-jasmine": "~5.1.0", "karma-jasmine-html-reporter": "~2.1.0", - "typescript": "~5.4.2", + "typescript": "~5.5.4", "concurrently": "^8.2.2", - "eslint": "^8.55.0" + "eslint": "^9.9.1", + "@eslint/js": "^9.9.1", + "typescript-eslint": "8.3.0" } } From 7d67d56c3a92de4f036a40f74bc44b2f710afb5a Mon Sep 17 00:00:00 2001 From: Leon Silva Date: Fri, 30 Aug 2024 14:18:04 -0600 Subject: [PATCH 2/2] refactor: only one kind of quotes --- templates/node-angular/eslint.config.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/node-angular/eslint.config.mjs b/templates/node-angular/eslint.config.mjs index 539ffb3..372edbe 100644 --- a/templates/node-angular/eslint.config.mjs +++ b/templates/node-angular/eslint.config.mjs @@ -1,5 +1,5 @@ import eslint from '@eslint/js'; -import tseslint from "typescript-eslint"; +import tseslint from 'typescript-eslint'; export default tseslint.config( eslint.configs.recommended, @@ -8,10 +8,10 @@ export default tseslint.config( files: [ '**/*.js', '**/*.jsx', - "**/*.ts", + '**/*.ts', ], linterOptions: { - reportUnusedDisableDirectives: "warn" + reportUnusedDisableDirectives: 'warn' }, ignores: [ 'dist/**/*',