From cd2f5b2cbf5890a11139e6097ebf325f49196297 Mon Sep 17 00:00:00 2001 From: Pionxzh Date: Mon, 27 May 2024 03:19:57 +0800 Subject: [PATCH] chore: disallow `.only` test to be commited --- eslint.config.js | 7 +++++++ package.json | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index da8ac3e4..6cf5238b 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -26,6 +26,13 @@ export default pionxzh( files: ['packages/unminify/**/*.spec.ts'], rules: { 'style/indent': ['error', 2], + 'no-restricted-syntax': [ + 'warn', + { + selector: 'CallExpression[callee.property.name=\'only\']', + message: '`.only` tests are used for local tests only', + }, + ], }, }, { diff --git a/package.json b/package.json index a94ea2ef..c3efa45b 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,8 @@ "test:update": "turbo run test:update", "test:watch": "turbo run test:watch", "test:type": "turbo run test:type", - "lint": "turbo run lint", - "lint:fix": "turbo run lint:fix", + "lint": "turbo run lint --max-warnings=0", + "lint:fix": "turbo run lint:fix --max-warnings=0", "bump-deps": "pnpm exec taze", "generate:pretty-testcases": "esno scripts/pretty-testcases.ts" },