From da594847569ed367403dbc8693b440bb75624596 Mon Sep 17 00:00:00 2001 From: KylinDC Date: Tue, 1 Nov 2022 02:28:00 +0800 Subject: [PATCH] feat(basic): add rules to prevent `.only` in tests (#127) --- packages/basic/index.js | 2 ++ packages/basic/package.json | 1 + pnpm-lock.yaml | 7 +++++++ 3 files changed, 10 insertions(+) diff --git a/packages/basic/index.js b/packages/basic/index.js index d73a173..dc7d662 100644 --- a/packages/basic/index.js +++ b/packages/basic/index.js @@ -35,6 +35,7 @@ module.exports = { 'html', 'unicorn', 'antfu', + 'no-only-tests', ], settings: { 'import/resolver': { @@ -155,6 +156,7 @@ module.exports = { files: ['*.test.ts', '*.test.js', '*.spec.ts', '*.spec.js'], rules: { 'no-unused-expressions': 'off', + 'no-only-tests/no-only-tests': 'error', }, }, { diff --git a/packages/basic/package.json b/packages/basic/package.json index 4caeb25..8d77e58 100644 --- a/packages/basic/package.json +++ b/packages/basic/package.json @@ -26,6 +26,7 @@ "eslint-plugin-jsonc": "^2.4.0", "eslint-plugin-markdown": "^3.0.0", "eslint-plugin-n": "^15.2.5", + "eslint-plugin-no-only-tests": "^3.1.0", "eslint-plugin-promise": "^6.0.1", "eslint-plugin-unicorn": "^43.0.2", "eslint-plugin-yml": "^1.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1156272..93c26d8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,6 +63,7 @@ importers: eslint-plugin-jsonc: ^2.4.0 eslint-plugin-markdown: ^3.0.0 eslint-plugin-n: ^15.2.5 + eslint-plugin-no-only-tests: ^3.1.0 eslint-plugin-promise: ^6.0.1 eslint-plugin-unicorn: ^43.0.2 eslint-plugin-yml: ^1.1.0 @@ -76,6 +77,7 @@ importers: eslint-plugin-jsonc: 2.4.0_eslint@8.23.0 eslint-plugin-markdown: 3.0.0_eslint@8.23.0 eslint-plugin-n: 15.2.5_eslint@8.23.0 + eslint-plugin-no-only-tests: 3.1.0 eslint-plugin-promise: 6.0.1_eslint@8.23.0 eslint-plugin-unicorn: 43.0.2_eslint@8.23.0 eslint-plugin-yml: 1.1.0_eslint@8.23.0 @@ -1868,6 +1870,11 @@ packages: semver: 7.3.7 dev: false + /eslint-plugin-no-only-tests/3.1.0: + resolution: {integrity: sha512-Lf4YW/bL6Un1R6A76pRZyE1dl1vr31G/ev8UzIc/geCgFWyrKil8hVjYqWVKGB/UIGmb6Slzs9T0wNezdSVegw==} + engines: {node: '>=5.0.0'} + dev: false + /eslint-plugin-promise/6.0.1_eslint@8.23.0: resolution: {integrity: sha512-uM4Tgo5u3UWQiroOyDEsYcVMOo7re3zmno0IZmB5auxoaQNIceAbXEkSt8RNrKtaYehARHG06pYK6K1JhtP0Zw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}