From 0285a069452e54b10973b313d96b61b313145c29 Mon Sep 17 00:00:00 2001 From: alecarn <133774929+alecarn@users.noreply.github.com> Date: Tue, 17 Sep 2024 14:41:48 -0400 Subject: [PATCH] refactor: eslint update to flat config --- .eslintrc.json | 56 - angular.json | 4 +- e2e/cypress.config.ts | 4 +- e2e/fixtures/example.json | 5 +- e2e/src/app.spec.ts | 11 +- e2e/support/component-index.html | 10 +- e2e/support/component.ts | 9 +- e2e/tsconfig.e2e.json | 6 +- eslint.config.js | 74 ++ package-lock.json | 1061 ++++++----------- package.json | 19 +- scripts/src/utils/log.ts | 1 + scripts/tsconfig.json | 2 +- .../expansion-panel-header.component.ts | 2 - .../expansion-panel.component.ts | 4 +- .../map-overlay/map-overlay.component.ts | 2 +- .../map-overlay/map-overlay.interface.ts | 2 +- src/app/pages/portal/portal-theme.scss | 5 +- src/app/pages/portal/portal.component.ts | 33 +- .../toast-panel-for-expansion.component.ts | 2 - .../toast-panel/toast-panel.component.ts | 38 +- .../welcome-window.component.ts | 4 +- src/app/services/pwa.service.ts | 2 +- src/main.ts | 2 +- 24 files changed, 507 insertions(+), 851 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 eslint.config.js diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 1e7766167..000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "root": true, - "overrides": [ - { - "files": ["*.ts"], - "plugins": ["unused-imports"], - "extends": [ - "plugin:@angular-eslint/recommended", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "rules": { - "arrow-spacing": "error", - "max-len": [ - "error", - { - "code": 140, - "comments": 140, - "ignoreTrailingComments": true, - "ignoreUrls": true, - "ignoreTemplateLiterals": true, - "ignoreRegExpLiterals": true - } - ], - "unused-imports/no-unused-imports": "error", - "no-multi-spaces": "error", - "eqeqeq": ["error", "always"], - "semi": ["error", "always"], - "no-trailing-spaces": "error", - "no-multiple-empty-lines": "error", - "eol-last": ["error", "always"], - "@angular-eslint/no-output-native": "off", - "@angular-eslint/component-selector": [ - "error", - { - "prefix": "app", - "style": "kebab-case", - "type": "element" - } - ], - "@angular-eslint/directive-selector": [ - "error", - { - "prefix": "app", - "style": "camelCase", - "type": "attribute" - } - ] - } - }, - { - "files": ["*.html"], - "extends": ["plugin:@angular-eslint/template/recommended"], - "rules": {} - } - ] -} diff --git a/angular.json b/angular.json index 8fa260488..c0f3f1a0b 100644 --- a/angular.json +++ b/angular.json @@ -317,7 +317,8 @@ "lint": { "builder": "@angular-eslint/builder:lint", "options": { - "lintFilePatterns": ["src/**/*.ts", "src/**/*.html"] + "lintFilePatterns": ["src/**/*.ts", "src/**/*.html"], + "eslintConfig": "eslint.config.js" } }, "e2e": { @@ -367,7 +368,6 @@ }, "cli": { "schematicCollections": [ - "@angular-eslint/schematics", "@schematics/angular" ], "analytics": false diff --git a/e2e/cypress.config.ts b/e2e/cypress.config.ts index cbde1ef32..69aee29f4 100644 --- a/e2e/cypress.config.ts +++ b/e2e/cypress.config.ts @@ -5,7 +5,7 @@ export default defineConfig({ baseUrl: 'http://localhost:4201', specPattern: 'e2e/src/*.spec.ts', supportFile: 'e2e/support/e2e.ts', - videosFolder: "e2e/dist/videos", - screenshotsFolder: "e2e/dist/screenshots", + videosFolder: 'e2e/dist/videos', + screenshotsFolder: 'e2e/dist/screenshots' } }); diff --git a/e2e/fixtures/example.json b/e2e/fixtures/example.json index 20b22a17d..294cbed6c 100644 --- a/e2e/fixtures/example.json +++ b/e2e/fixtures/example.json @@ -1,5 +1,4 @@ { - "name": "Using fixtures to represent data", - "email": "hello@cypress.io" + "name": "Using fixtures to represent data", + "email": "hello@cypress.io" } - \ No newline at end of file diff --git a/e2e/src/app.spec.ts b/e2e/src/app.spec.ts index 903487c2c..2aeefec39 100644 --- a/e2e/src/app.spec.ts +++ b/e2e/src/app.spec.ts @@ -2,12 +2,9 @@ describe('My First Test', () => { const url = 'http://localhost:4201'; it('Check the config file', () => { cy.visit('/'); - cy.request('GET', `${url}/config/config.json`).then( - (response) => { - expect(response.body).to.have.property('title', 'IGO'); // true - expect(response.body).to.have.property('theme', 'blue-theme'); // true - } - ); + cy.request('GET', `${url}/config/config.json`).then((response) => { + expect(response.body).to.have.property('title', 'IGO'); // true + expect(response.body).to.have.property('theme', 'blue-theme'); // true + }); }); - }); diff --git a/e2e/support/component-index.html b/e2e/support/component-index.html index ac6e79fd8..faf3b5f43 100644 --- a/e2e/support/component-index.html +++ b/e2e/support/component-index.html @@ -1,12 +1,12 @@ - +
- - - + + +