From dbdfb487233db2c31dac187e27bdc04200f64bf4 Mon Sep 17 00:00:00 2001 From: Zachary Williams Date: Thu, 25 Mar 2021 21:06:28 -0500 Subject: [PATCH] fix nuxt linting if @nx-plus/vue is installed --- libs/vue/migrations.json | 9 +++++++++ libs/vue/src/migrations/update-11.0.0/update-11.0.0.ts | 10 +++++++++- libs/vue/src/schematics/application/schematic.ts | 2 +- libs/vue/src/schematics/library/schematic.ts | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/libs/vue/migrations.json b/libs/vue/migrations.json index 32f56bb3..f69d93bd 100644 --- a/libs/vue/migrations.json +++ b/libs/vue/migrations.json @@ -33,6 +33,15 @@ "alwaysAddToPackageJson": false } } + }, + "11.0.0": { + "version": "11.0.0", + "packages": { + "eslint-plugin-vue": { + "version": "^7.8.0", + "alwaysAddToPackageJson": false + } + } } } } diff --git a/libs/vue/src/migrations/update-11.0.0/update-11.0.0.ts b/libs/vue/src/migrations/update-11.0.0/update-11.0.0.ts index 15a30e24..2d45187d 100644 --- a/libs/vue/src/migrations/update-11.0.0/update-11.0.0.ts +++ b/libs/vue/src/migrations/update-11.0.0/update-11.0.0.ts @@ -1,5 +1,9 @@ import { chain, Rule } from '@angular-devkit/schematics'; -import { addDepsToPackageJson, readWorkspace } from '@nrwl/workspace'; +import { + addDepsToPackageJson, + readWorkspace, + updatePackagesInPackageJson, +} from '@nrwl/workspace'; import * as path from 'path'; function deleteExtendInEslintConfig(): Rule { @@ -28,6 +32,10 @@ function deleteExtendInEslintConfig(): Rule { export default function update(): Rule { return chain([ + updatePackagesInPackageJson( + path.join(__dirname, '../../../', 'migrations.json'), + '11.0.0' + ), addDepsToPackageJson({}, { 'eslint-config-prettier': '8.1.0' }), deleteExtendInEslintConfig(), ]); diff --git a/libs/vue/src/schematics/application/schematic.ts b/libs/vue/src/schematics/application/schematic.ts index 1e1937e8..c0604338 100644 --- a/libs/vue/src/schematics/application/schematic.ts +++ b/libs/vue/src/schematics/application/schematic.ts @@ -374,7 +374,7 @@ export default function (options: ApplicationSchematicSchema): Rule { ? { '@vue/compiler-sfc': '^3.0.0' } : {}), '@vue/eslint-config-typescript': '^5.0.2', - 'eslint-plugin-vue': normalizedOptions.isVue3 ? '^7.0.0-0' : '^6.2.2', + 'eslint-plugin-vue': '^7.8.0', ...(!normalizedOptions.isVue3 ? { 'vue-template-compiler': '^2.6.11' } : {}), diff --git a/libs/vue/src/schematics/library/schematic.ts b/libs/vue/src/schematics/library/schematic.ts index 35bab66a..ff5a23e3 100644 --- a/libs/vue/src/schematics/library/schematic.ts +++ b/libs/vue/src/schematics/library/schematic.ts @@ -343,7 +343,7 @@ export default function (options: LibrarySchematicSchema): Rule { ? { '@vue/compiler-sfc': '^3.0.0' } : {}), '@vue/eslint-config-typescript': '^5.0.2', - 'eslint-plugin-vue': normalizedOptions.isVue3 ? '^7.0.0-0' : '^6.2.2', + 'eslint-plugin-vue': '^7.8.0', ...(!normalizedOptions.isVue3 ? { 'vue-template-compiler': '^2.6.11' } : {}),