From 051cebdb06c672457d2add175e90f77971df5006 Mon Sep 17 00:00:00 2001 From: The4thLaw Date: Fri, 15 Mar 2024 19:44:38 +0100 Subject: [PATCH] Added an eslint config to help with the migration. Also fixed issues with the Stylelint configuration. Refs #156 --- source/demyo-vue-frontend/.stylelintrc.cjs | 8 ++- source/demyo-vue-frontend/eslint.config.js | 1 + source/demyo-vue-frontend/package-lock.json | 55 ++++++++++++++++++++- source/demyo-vue-frontend/package.json | 4 +- 4 files changed, 64 insertions(+), 4 deletions(-) diff --git a/source/demyo-vue-frontend/.stylelintrc.cjs b/source/demyo-vue-frontend/.stylelintrc.cjs index 87a1bd52..497c7511 100644 --- a/source/demyo-vue-frontend/.stylelintrc.cjs +++ b/source/demyo-vue-frontend/.stylelintrc.cjs @@ -1,6 +1,6 @@ const commonRules = { - indentation: 'tab', - 'block-opening-brace-space-before': 'always', + '@stylistic/indentation': 'tab', + '@stylistic/block-opening-brace-space-before': 'always', // Disable some rules compared to the recommendations 'declaration-empty-line-before': null, 'selector-id-pattern': null, @@ -8,6 +8,10 @@ const commonRules = { } module.exports = { + plugins: [ + '@stylistic/stylelint-plugin' + ], + // For the "extends" to work, the stylelint configuration // must be in the same directory as the package.json loading the associated package extends: [ diff --git a/source/demyo-vue-frontend/eslint.config.js b/source/demyo-vue-frontend/eslint.config.js index ab902d0b..a585359f 100644 --- a/source/demyo-vue-frontend/eslint.config.js +++ b/source/demyo-vue-frontend/eslint.config.js @@ -25,6 +25,7 @@ export default [ // See https://github.com/vuejs/eslint-plugin-vue/issues/1291 ...compat.extends('plugin:vue/essential'), ...compat.extends('plugin:vue/recommended'), + ...compat.extends('plugin:vuetify/base'), // https://github.com/cypress-io/eslint-plugin-cypress/issues/146 ...compat.extends('plugin:cypress/recommended'), // No issue to support flat configs for these two diff --git a/source/demyo-vue-frontend/package-lock.json b/source/demyo-vue-frontend/package-lock.json index f21d255d..d028919b 100644 --- a/source/demyo-vue-frontend/package-lock.json +++ b/source/demyo-vue-frontend/package-lock.json @@ -30,6 +30,7 @@ }, "devDependencies": { "@eslint/eslintrc": "^3.0.2", + "@stylistic/stylelint-plugin": "^2.1.0", "@types/jest": "^26.0.24", "@vitejs/plugin-vue": "^5.0.4", "@vue/eslint-config-standard": "^5.1.2", @@ -41,6 +42,7 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.3.1", "eslint-plugin-vue": "^9.22.0", + "eslint-plugin-vuetify": "^2.2.0", "eslint-plugin-you-dont-need-lodash-underscore": "^6.12.0", "less": "^4.1.2", "postcss-html": "^1.3.0", @@ -48,7 +50,7 @@ "rollup-plugin-visualizer": "^5.12.0", "sass": "~1.58.0", "serve": "^14.2.0", - "stylelint": "^16.0.0", + "stylelint": "^16.2.1", "stylelint-config-recommended-vue": "^1.4.0", "stylelint-config-standard": "^36.0.0", "sync-pom-version-to-package": "^1.6.1", @@ -1282,6 +1284,28 @@ "win32" ] }, + "node_modules/@stylistic/stylelint-plugin": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@stylistic/stylelint-plugin/-/stylelint-plugin-2.1.0.tgz", + "integrity": "sha512-mUZEW9uImHSbXeyzbFmHb8WPBv56UTaEnWL/3dGdAiJ54C+8GTfDwDVdI6gbqT9wV7zynkPu7tCXc5746H9mZQ==", + "dev": true, + "dependencies": { + "@csstools/css-parser-algorithms": "^2.5.0", + "@csstools/css-tokenizer": "^2.2.3", + "@csstools/media-query-list-parser": "^2.1.7", + "is-plain-object": "^5.0.0", + "postcss-selector-parser": "^6.0.15", + "postcss-value-parser": "^4.2.0", + "style-search": "^0.1.0", + "stylelint": "^16.2.1" + }, + "engines": { + "node": "^18.12 || >=20.9" + }, + "peerDependencies": { + "stylelint": "^16.0.2" + } + }, "node_modules/@types/eslint": { "version": "8.56.5", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.5.tgz", @@ -4350,6 +4374,20 @@ "eslint": "^6.2.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/eslint-plugin-vuetify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vuetify/-/eslint-plugin-vuetify-2.2.0.tgz", + "integrity": "sha512-JcG1QflqACrLF0pFxxtCvC/vYoA4IBYq1yMQZUiPqksEJFPi94kG0yNAum2Z8ehW5ac+lw0vPnQvGEdxLuVx6Q==", + "dev": true, + "dependencies": { + "eslint-plugin-vue": "^9.6.0", + "requireindex": "^1.2.0" + }, + "peerDependencies": { + "eslint": "^8.0.0", + "vuetify": "^3.0.0" + } + }, "node_modules/eslint-plugin-you-dont-need-lodash-underscore": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/eslint-plugin-you-dont-need-lodash-underscore/-/eslint-plugin-you-dont-need-lodash-underscore-6.13.0.tgz", @@ -7771,6 +7809,15 @@ "node": ">=0.10.0" } }, + "node_modules/requireindex": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz", + "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==", + "dev": true, + "engines": { + "node": ">=0.10.5" + } + }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -8576,6 +8623,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/style-search": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/style-search/-/style-search-0.1.0.tgz", + "integrity": "sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg==", + "dev": true + }, "node_modules/stylelint": { "version": "16.2.1", "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-16.2.1.tgz", diff --git a/source/demyo-vue-frontend/package.json b/source/demyo-vue-frontend/package.json index 9574a80b..cfc93e20 100644 --- a/source/demyo-vue-frontend/package.json +++ b/source/demyo-vue-frontend/package.json @@ -38,6 +38,7 @@ }, "devDependencies": { "@eslint/eslintrc": "^3.0.2", + "@stylistic/stylelint-plugin": "^2.1.0", "@types/jest": "^26.0.24", "@vitejs/plugin-vue": "^5.0.4", "@vue/eslint-config-standard": "^5.1.2", @@ -49,6 +50,7 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.3.1", "eslint-plugin-vue": "^9.22.0", + "eslint-plugin-vuetify": "^2.2.0", "eslint-plugin-you-dont-need-lodash-underscore": "^6.12.0", "less": "^4.1.2", "postcss-html": "^1.3.0", @@ -56,7 +58,7 @@ "rollup-plugin-visualizer": "^5.12.0", "sass": "~1.58.0", "serve": "^14.2.0", - "stylelint": "^16.0.0", + "stylelint": "^16.2.1", "stylelint-config-recommended-vue": "^1.4.0", "stylelint-config-standard": "^36.0.0", "sync-pom-version-to-package": "^1.6.1",