From a33f9d25b8db202c9c61f64596614bb11c763745 Mon Sep 17 00:00:00 2001 From: Anssi Juvonen Date: Fri, 15 Nov 2024 11:02:27 +0200 Subject: [PATCH 1/8] Include accessibility in linting --- eslint.config.mjs | 2 ++ package-lock.json | 36 +++++++++++++++++++++++++++++++++ package.json | 1 + src/components/ToastMessage.vue | 13 ++++++++++-- 4 files changed, 50 insertions(+), 2 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 5f6a4a4..f8f4e5c 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -4,6 +4,7 @@ import pluginVitest from '@vitest/eslint-plugin'; import pluginPlaywright from 'eslint-plugin-playwright'; import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'; import {includeIgnoreFile} from '@eslint/compat'; +import pluginVueA11y from 'eslint-plugin-vuejs-accessibility'; import {fileURLToPath} from 'node:url'; export default [ @@ -13,6 +14,7 @@ export default [ files: ['**/*.{ts,mts,tsx,vue}'], }, + ...pluginVueA11y.configs['flat/recommended'], ...pluginVue.configs['flat/essential'], ...vueTsEslintConfig(), diff --git a/package-lock.json b/package-lock.json index 258e88d..cb3f5d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,6 +46,7 @@ "eslint": "^9.14.0", "eslint-plugin-playwright": "^2.0.1", "eslint-plugin-vue": "^9.31.0", + "eslint-plugin-vuejs-accessibility": "^2.4.1", "jsdom": "^25.0.1", "npm-run-all2": "^7.0.1", "postcss": "^8.4.49", @@ -3924,6 +3925,16 @@ "dev": true, "license": "Python-2.0" }, + "node_modules/aria-query": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", + "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/array-buffer-byte-length": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", @@ -5216,6 +5227,31 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/eslint-plugin-vuejs-accessibility": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-vuejs-accessibility/-/eslint-plugin-vuejs-accessibility-2.4.1.tgz", + "integrity": "sha512-ZRZhPdslplZXSF71MtSG+zXYRAT5KiHR4JVuo/DERQf9noAkDvi5W418VOE1qllmJd7wTenndxi1q8XeDMxdHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "aria-query": "^5.3.0", + "emoji-regex": "^10.0.0", + "vue-eslint-parser": "^9.0.1" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-vuejs-accessibility/node_modules/emoji-regex": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", + "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", + "dev": true, + "license": "MIT" + }, "node_modules/eslint-scope": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", diff --git a/package.json b/package.json index d738bf6..a51e30d 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "eslint": "^9.14.0", "eslint-plugin-playwright": "^2.0.1", "eslint-plugin-vue": "^9.31.0", + "eslint-plugin-vuejs-accessibility": "^2.4.1", "jsdom": "^25.0.1", "npm-run-all2": "^7.0.1", "postcss": "^8.4.49", diff --git a/src/components/ToastMessage.vue b/src/components/ToastMessage.vue index db1c2b9..547a600 100644 --- a/src/components/ToastMessage.vue +++ b/src/components/ToastMessage.vue @@ -1,6 +1,6 @@