From 37d56664cbe4af5dd756586fdc6f16ed9cb706cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Valderrama?= Date: Fri, 10 May 2024 11:09:14 +0200 Subject: [PATCH] fix(icons-plugin): fix linter --- apps/icons-plugin/.eslintrc.json | 36 ------------------ apps/icons-plugin/eslint.config.js | 43 ++++++++++++++++++++++ apps/icons-plugin/project.json | 5 ++- apps/icons-plugin/src/assets/manifest.json | 2 +- 4 files changed, 47 insertions(+), 39 deletions(-) delete mode 100644 apps/icons-plugin/.eslintrc.json create mode 100644 apps/icons-plugin/eslint.config.js diff --git a/apps/icons-plugin/.eslintrc.json b/apps/icons-plugin/.eslintrc.json deleted file mode 100644 index bcdea5e..0000000 --- a/apps/icons-plugin/.eslintrc.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "extends": ["../../.eslintrc.base.json"], - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts"], - "extends": [ - "plugin:@nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "rules": { - "@angular-eslint/directive-selector": [ - "error", - { - "type": "attribute", - "prefix": "app", - "style": "camelCase" - } - ], - "@angular-eslint/component-selector": [ - "error", - { - "type": "element", - "prefix": "app", - "style": "kebab-case" - } - ] - } - }, - { - "files": ["*.html"], - "extends": ["plugin:@nx/angular-template"], - "rules": {} - } - ] -} diff --git a/apps/icons-plugin/eslint.config.js b/apps/icons-plugin/eslint.config.js new file mode 100644 index 0000000..29c2176 --- /dev/null +++ b/apps/icons-plugin/eslint.config.js @@ -0,0 +1,43 @@ +import baseConfig from '../../eslint.config.js'; +import { compat } from '../../eslint.base.config.js'; + +export default [ + ...baseConfig, + ...compat + .config({ + extends: [ + 'plugin:@nx/angular', + 'plugin:@angular-eslint/template/process-inline-templates', + ], + }) + .map((config) => ({ + ...config, + files: ['**/*.ts'], + rules: { + '@angular-eslint/directive-selector': [ + 'error', + { + type: 'attribute', + prefix: 'app', + style: 'camelCase', + }, + ], + '@angular-eslint/component-selector': [ + 'error', + { + type: 'element', + prefix: 'app', + style: 'kebab-case', + }, + ], + }, + })), + ...compat + .config({ extends: ['plugin:@nx/angular-template'] }) + .map((config) => ({ + ...config, + files: ['**/*.html'], + rules: {}, + })), + { ignores: ['**/assets/*.js'] }, +]; diff --git a/apps/icons-plugin/project.json b/apps/icons-plugin/project.json index e6f32ed..3ad953b 100644 --- a/apps/icons-plugin/project.json +++ b/apps/icons-plugin/project.json @@ -4,7 +4,7 @@ "projectType": "application", "prefix": "app", "sourceRoot": "apps/icons-plugin/src", - "tags": [], + "tags": ["type:plugin"], "targets": { "buildPlugin": { "executor": "@nx/esbuild:esbuild", @@ -65,7 +65,8 @@ "sourceMap": true } }, - "defaultConfiguration": "production" + "defaultConfiguration": "production", + "dependsOn": ["buildPlugin"] }, "serve": { "executor": "@angular-devkit/build-angular:dev-server", diff --git a/apps/icons-plugin/src/assets/manifest.json b/apps/icons-plugin/src/assets/manifest.json index 1a1c4a0..37d9670 100644 --- a/apps/icons-plugin/src/assets/manifest.json +++ b/apps/icons-plugin/src/assets/manifest.json @@ -1,5 +1,5 @@ { - "name": "Iccons plugin", + "name": "Icons plugin", "code": "http://localhost:4202/assets/plugin.js", "permissions": ["page:read", "file:read", "selection:read"] }