From e3e0e7bfeaff98b5f9bf38535eb1ef6ac33999d4 Mon Sep 17 00:00:00 2001 From: Aelita Date: Fri, 1 Dec 2023 23:05:07 +1100 Subject: [PATCH] feat: add some rules for `vue` and `playwright` --- package.json | 10 ++++---- pnpm-lock.yaml | 52 +++++++++++++++++++-------------------- src/configs/playwright.ts | 3 ++- src/configs/vue.ts | 3 ++- 4 files changed, 35 insertions(+), 33 deletions(-) diff --git a/package.json b/package.json index 1b1348c..f90cae6 100644 --- a/package.json +++ b/package.json @@ -49,24 +49,24 @@ "@typescript-eslint/eslint-plugin": "^6.13.1", "@typescript-eslint/parser": "^6.13.1", "@unocss/eslint-plugin": "^0.57.7", - "eslint-config-flat-gitignore": "^0.1.1", + "eslint-config-flat-gitignore": "^0.1.2", "eslint-import-resolver-node": "^0.3.9", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.0", "eslint-plugin-jsx-a11y": "^6.8.0", - "eslint-plugin-playwright": "^0.18.0", + "eslint-plugin-playwright": "^0.19.0", "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.4", - "eslint-plugin-vue": "^9.18.1", + "eslint-plugin-vue": "^9.19.2", "eslint-plugin-vuejs-accessibility": "^2.2.0", "globals": "^13.23.0", "local-pkg": "^0.5.0", "vue-eslint-parser": "^9.3.2" }, "devDependencies": { - "@types/eslint": "^8.44.7", - "@types/node": "^20.10.0", + "@types/eslint": "^8.44.8", + "@types/node": "^20.10.1", "bumpp": "^9.2.0", "changelogithub": "^0.13.2", "eslint": "^8.54.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1db8f3d..9b19ffc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,8 +18,8 @@ dependencies: specifier: ^0.57.7 version: 0.57.7(eslint@8.54.0)(typescript@5.3.2) eslint-config-flat-gitignore: - specifier: ^0.1.1 - version: 0.1.1 + specifier: ^0.1.2 + version: 0.1.2 eslint-import-resolver-node: specifier: ^0.3.9 version: 0.3.9 @@ -33,8 +33,8 @@ dependencies: specifier: ^6.8.0 version: 6.8.0(eslint@8.54.0) eslint-plugin-playwright: - specifier: ^0.18.0 - version: 0.18.0(eslint@8.54.0) + specifier: ^0.19.0 + version: 0.19.0(eslint@8.54.0) eslint-plugin-react: specifier: ^7.33.2 version: 7.33.2(eslint@8.54.0) @@ -45,8 +45,8 @@ dependencies: specifier: ^0.4.4 version: 0.4.4(eslint@8.54.0) eslint-plugin-vue: - specifier: ^9.18.1 - version: 9.18.1(eslint@8.54.0) + specifier: ^9.19.2 + version: 9.19.2(eslint@8.54.0) eslint-plugin-vuejs-accessibility: specifier: ^2.2.0 version: 2.2.0(eslint@8.54.0) @@ -62,11 +62,11 @@ dependencies: devDependencies: '@types/eslint': - specifier: ^8.44.7 - version: 8.44.7 + specifier: ^8.44.8 + version: 8.44.8 '@types/node': - specifier: ^20.10.0 - version: 20.10.0 + specifier: ^20.10.1 + version: 20.10.1 bumpp: specifier: ^9.2.0 version: 9.2.0 @@ -90,7 +90,7 @@ devDependencies: version: 5.3.2 vitepress: specifier: 1.0.0-rc.31 - version: 1.0.0-rc.31(@algolia/client-search@4.20.0)(@types/node@20.10.0)(sass@1.69.5)(search-insights@2.10.0)(typescript@5.3.2) + version: 1.0.0-rc.31(@algolia/client-search@4.20.0)(@types/node@20.10.1)(sass@1.69.5)(search-insights@2.10.0)(typescript@5.3.2) vue: specifier: ^3.3.9 version: 3.3.9(typescript@5.3.2) @@ -733,8 +733,8 @@ packages: dev: true optional: true - /@types/eslint@8.44.7: - resolution: {integrity: sha512-f5ORu2hcBbKei97U73mf+l9t4zTGl74IqZ0GQk4oVea/VS8tQZYkUveSYojk+frraAVYId0V2WC9O4PTNru2FQ==} + /@types/eslint@8.44.8: + resolution: {integrity: sha512-4K8GavROwhrYl2QXDXm0Rv9epkA8GBFu0EI+XrrnnuCl7u8CWBRusX7fXJfanhZTDWSAL24gDI/UqXyUM0Injw==} dependencies: '@types/estree': 1.0.3 '@types/json-schema': 7.0.14 @@ -778,8 +778,8 @@ packages: resolution: {integrity: sha512-6L6VymKTzYSrEf4Nev4Xa1LCHKrlTlYCBMTlQKFuddo1CvQcE52I0mwfOJayueUC7MJuXOeHTcIU683lzd0cUA==} dev: true - /@types/node@20.10.0: - resolution: {integrity: sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ==} + /@types/node@20.10.1: + resolution: {integrity: sha512-T2qwhjWwGH81vUEx4EXmBKsTJRXFXNZTL4v0gi01+zyBmCwzE6TyHszqX01m+QHTEq+EZNo13NeJIdEqf+Myrg==} dependencies: undici-types: 5.26.5 dev: true @@ -1025,7 +1025,7 @@ packages: vite: ^4.0.0 || ^5.0.0 vue: ^3.2.25 dependencies: - vite: 5.0.2(@types/node@20.10.0)(sass@1.69.5) + vite: 5.0.2(@types/node@20.10.1)(sass@1.69.5) vue: 3.3.9(typescript@5.3.2) dev: true @@ -1858,8 +1858,8 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - /eslint-config-flat-gitignore@0.1.1: - resolution: {integrity: sha512-ysq0QpN63+uaxE67U0g0HeCweIpv8Ztp7yvm0nYiM2TBalRIG6KQLO5J6lAz2gkA8KVis/QsJppe+BR5VigtWQ==} + /eslint-config-flat-gitignore@0.1.2: + resolution: {integrity: sha512-PcBsqtd5QHEZH4ROvpnRN4EP0qcHh9voCCHgtyHxnJZHGspJREcZn7oPqRG/GfWt9m3C0fkC2l5CuBtMig2wXQ==} dependencies: parse-gitignore: 2.0.0 dev: false @@ -2004,8 +2004,8 @@ packages: object.fromentries: 2.0.7 dev: false - /eslint-plugin-playwright@0.18.0(eslint@8.54.0): - resolution: {integrity: sha512-VLvKOAaDvRTonUeI3J8plXIJQuReXjbjrgDGoNwsiydwdqk3lt+mbzgsBcxJscMJDHc9XgnLVo0nWTiaYHLGYQ==} + /eslint-plugin-playwright@0.19.0(eslint@8.54.0): + resolution: {integrity: sha512-/pk5oDxusdPnsPNo16o7kWk4Pq8e0Jw7vM0xI/G4wDHhYw1ImQpclB3fQGbjKAO1eauGRLWtJAq5l1Xq3oF16A==} peerDependencies: eslint: '>=7' eslint-plugin-jest: '>=25' @@ -2059,8 +2059,8 @@ packages: string.prototype.matchall: 4.0.10 dev: false - /eslint-plugin-vue@9.18.1(eslint@8.54.0): - resolution: {integrity: sha512-7hZFlrEgg9NIzuVik2I9xSnJA5RsmOfueYgsUGUokEDLJ1LHtxO0Pl4duje1BriZ/jDWb+44tcIlC3yi0tdlZg==} + /eslint-plugin-vue@9.19.2(eslint@8.54.0): + resolution: {integrity: sha512-CPDqTOG2K4Ni2o4J5wixkLVNwgctKXFu6oBpVJlpNq7f38lh9I80pRTouZSJ2MAebPJlINU/KTFSXyQfBUlymA==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.2.0 || ^7.0.0 || ^8.0.0 @@ -4053,7 +4053,7 @@ packages: vfile-message: 4.0.2 dev: true - /vite@5.0.2(@types/node@20.10.0)(sass@1.69.5): + /vite@5.0.2(@types/node@20.10.1)(sass@1.69.5): resolution: {integrity: sha512-6CCq1CAJCNM1ya2ZZA7+jS2KgnhbzvxakmlIjN24cF/PXhRMzpM/z8QgsVJA/Dm5fWUWnVEsmtBoMhmerPxT0g==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -4081,7 +4081,7 @@ packages: terser: optional: true dependencies: - '@types/node': 20.10.0 + '@types/node': 20.10.1 esbuild: 0.19.6 postcss: 8.4.31 rollup: 4.5.0 @@ -4090,7 +4090,7 @@ packages: fsevents: 2.3.3 dev: true - /vitepress@1.0.0-rc.31(@algolia/client-search@4.20.0)(@types/node@20.10.0)(sass@1.69.5)(search-insights@2.10.0)(typescript@5.3.2): + /vitepress@1.0.0-rc.31(@algolia/client-search@4.20.0)(@types/node@20.10.1)(sass@1.69.5)(search-insights@2.10.0)(typescript@5.3.2): resolution: {integrity: sha512-ikH9pIjOOAbyoYAGBVfTz8TzuXp+UoWaIRMU4bw/oiTg8R65SbAaGKY84xx6TuL+f4VqUJ8lhzW82YyxSLvstA==} hasBin: true peerDependencies: @@ -4115,7 +4115,7 @@ packages: mrmime: 1.0.1 shikiji: 0.7.4 shikiji-transformers: 0.7.4 - vite: 5.0.2(@types/node@20.10.0)(sass@1.69.5) + vite: 5.0.2(@types/node@20.10.1)(sass@1.69.5) vue: 3.3.9(typescript@5.3.2) transitivePeerDependencies: - '@algolia/client-search' diff --git a/src/configs/playwright.ts b/src/configs/playwright.ts index d0f2617..43b55c0 100644 --- a/src/configs/playwright.ts +++ b/src/configs/playwright.ts @@ -39,7 +39,8 @@ const playwrightRules: FlatConfigItem['rules'] = { 'playwright/no-networkidle': 'error', 'playwright/no-nested-step': 'error', 'playwright/prefer-to-contain': 'error', - 'playwright/prefer-to-have-count': 'error' + 'playwright/prefer-to-have-count': 'error', + 'playwright/valid-title': 'error' } diff --git a/src/configs/vue.ts b/src/configs/vue.ts index 78e09f6..3cca6fb 100644 --- a/src/configs/vue.ts +++ b/src/configs/vue.ts @@ -30,7 +30,7 @@ const vueRules = (pluginVue: any, options: VueOptions): FlatConfigItem['rules'] } ], 'vue/custom-event-name-casing': ['error', 'camelCase'], - 'vue/define-emits-declaration': ['error', 'type-based'], + 'vue/define-emits-declaration': ['error', 'type-literal'], 'vue/define-props-declaration': ['error', 'type-based'], 'vue/html-button-has-type': ['error', { button: true, submit: true, reset: true }], 'vue/next-tick-style': ['error', 'promise'], @@ -88,6 +88,7 @@ const vueRules = (pluginVue: any, options: VueOptions): FlatConfigItem['rules'] 'vue/v-for-delimiter-style': ['error', 'in'], 'vue/v-on-handler-style': ['error', ['method', 'inline-function'], { ignoreIncludesComment: false }], 'vue/valid-define-options': 'error', + 'vue/no-unused-emit-declarations': 'error', // Extension Rules 'vue/camelcase': [