mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-25 01:49:06 -05:00
chore: replace stop-only package with eslint mocha only rule (#33492)
Co-authored-by: Cacie Prins <cacieprins@users.noreply.github.com>
This commit is contained in:
@@ -474,16 +474,6 @@ commands:
|
||||
- run:
|
||||
name: print yarn version
|
||||
command: yarn versions
|
||||
- unless:
|
||||
condition:
|
||||
# stop-only does not correctly match on windows: https://github.com/bahmutov/stop-only/issues/78
|
||||
equal: [ *windows-executor, << parameters.executor >> ]
|
||||
steps:
|
||||
- run:
|
||||
name: Stop .only # this will catch ".only"s in js/coffee as well
|
||||
command: |
|
||||
source ./scripts/ensure-node.sh
|
||||
yarn stop-only-all
|
||||
- run:
|
||||
name: Check terminal variables
|
||||
## make sure the TERM is set to 'xterm' in node (Linux only)
|
||||
|
||||
@@ -82,12 +82,6 @@ yarn lint
|
||||
|
||||
# Lint and auto-fix specific scopes
|
||||
yarn lint:fix
|
||||
|
||||
# Remove accidental .only from test files (specific file types)
|
||||
yarn stop-only
|
||||
|
||||
# Remove .only from all test files in packages/
|
||||
yarn stop-only-all
|
||||
```
|
||||
|
||||
> **Note**: This project does **not** use Prettier. All formatting is enforced via ESLint.
|
||||
@@ -207,7 +201,7 @@ yarn clean-deps && yarn
|
||||
- **TypeScript**: `strict: true` base, but `noImplicitAny: false` (implicit `any` allowed for pragmatic reasons).
|
||||
- **Type-only imports**: `importsNotUsedAsValues: "error"` — use `import type` for type-only imports.
|
||||
- **Unused vars**: Prefix with `_` to suppress (`argsIgnorePattern: '^_'`).
|
||||
- **No `.only` in tests** — `mocha/no-exclusive-tests: 'error'`; `yarn stop-only` removes them.
|
||||
- **No `.only` in tests** — `mocha/no-exclusive-tests: 'error'` (ESLint). Caught by `yarn lint` and by pre-commit ESLint (`lint-staged`). For intentional `.only` in fixtures or type samples, use `eslint-disable-next-line mocha/no-exclusive-tests` (with a short comment).
|
||||
- **`.skip` requires a comment** — Must include `NOTE:`, `TODO:`, or `FIXME:` comment explaining why.
|
||||
- **Blank line before `return`** — Enforced via `padding-line-between-statements`.
|
||||
- **Sync FS calls** — Flagged with a warning (except `existsSync`); prefer async variants.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable mocha/no-exclusive-tests -- dtslint-style samples for Mocha/Cypress API typings */
|
||||
namespace CypressLodashTests {
|
||||
Cypress._ // $ExpectType LoDashStatic
|
||||
Cypress._.each([1], (item) => {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
!.*
|
||||
**/package-lock.json
|
||||
test/fixtures
|
||||
node_modules
|
||||
|
||||
@@ -55,8 +55,6 @@
|
||||
"sanitize:mocha:results": "node ./scripts/sanitize-mocha-results.js",
|
||||
"prestart": "yarn ensure-deps",
|
||||
"start": "cypress open --dev --global",
|
||||
"stop-only": "npx stop-only --skip .cy,.publish,.projects,node_modules,dist,dist-test,fixtures,lib,bower_components,src,__snapshots__,patches --exclude cypress-tests.ts,*only.cy.js",
|
||||
"stop-only-all": "yarn stop-only --folder packages",
|
||||
"pretest": "yarn ensure-deps",
|
||||
"test": "yarn lerna exec yarn test --scope=cypress --scope=@packages/{config,data-context,driver,electron,errors,extension,https-proxy,icons,launcher,net-stubbing,network,packherd-require,proxy,rewriter,scaffold-config,socket,v8-snapshot-require,telemetry,stderr-filtering,types} --scope=@tooling/{electron-mksnapshot,v8-snapshot}",
|
||||
"test-debug": "lerna exec yarn test-debug --ignore=@packages/{driver,root,static,web-config}",
|
||||
@@ -192,7 +190,6 @@
|
||||
"sinon": "7.3.2",
|
||||
"sinon-chai": "3.7.0",
|
||||
"snap-shot-it": "7.9.10",
|
||||
"stop-only": "3.4.1",
|
||||
"strip-ansi": "6.0.1",
|
||||
"tar": "6.2.1",
|
||||
"term-to-html": "1.2.0",
|
||||
|
||||
@@ -185,6 +185,7 @@ export const baseConfig = <InfiniteDepthConfigWithExtends[]>[
|
||||
'@typescript-eslint/no-wrapper-object-types': 'off',
|
||||
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
|
||||
|
||||
'mocha/no-exclusive-tests': 'error',
|
||||
'mocha/no-mocha-arrows': 'off',
|
||||
'mocha/no-setup-in-describe': 'off',
|
||||
'mocha/max-top-level-suites': 'off',
|
||||
|
||||
@@ -14232,13 +14232,6 @@ debug@4.3.4:
|
||||
dependencies:
|
||||
ms "2.1.2"
|
||||
|
||||
debug@4.3.7, debug@~4.3.1:
|
||||
version "4.3.7"
|
||||
resolved "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52"
|
||||
integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==
|
||||
dependencies:
|
||||
ms "^2.1.3"
|
||||
|
||||
debug@^3.1.0, debug@^3.2.7:
|
||||
version "3.2.7"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"
|
||||
@@ -14246,6 +14239,13 @@ debug@^3.1.0, debug@^3.2.7:
|
||||
dependencies:
|
||||
ms "^2.1.1"
|
||||
|
||||
debug@~4.3.1:
|
||||
version "4.3.7"
|
||||
resolved "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52"
|
||||
integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==
|
||||
dependencies:
|
||||
ms "^2.1.3"
|
||||
|
||||
decamelize-keys@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9"
|
||||
@@ -16239,19 +16239,6 @@ execa@0.10.0:
|
||||
signal-exit "^3.0.0"
|
||||
strip-eof "^1.0.0"
|
||||
|
||||
execa@0.11.0:
|
||||
version "0.11.0"
|
||||
resolved "https://registry.yarnpkg.com/execa/-/execa-0.11.0.tgz#0b3c71daf9b9159c252a863cd981af1b4410d97a"
|
||||
integrity sha512-k5AR22vCt1DcfeiRixW46U5tMLtBg44ssdJM9PiXw3D8Bn5qyxFCSnKY/eR22y+ctFDGPqafpaXg2G4Emyua4A==
|
||||
dependencies:
|
||||
cross-spawn "^6.0.0"
|
||||
get-stream "^4.0.0"
|
||||
is-stream "^1.1.0"
|
||||
npm-run-path "^2.0.0"
|
||||
p-finally "^1.0.0"
|
||||
signal-exit "^3.0.0"
|
||||
strip-eof "^1.0.0"
|
||||
|
||||
execa@4.1.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a"
|
||||
@@ -17602,7 +17589,7 @@ get-stream@^2.0.0:
|
||||
object-assign "^4.0.1"
|
||||
pinkie-promise "^2.0.0"
|
||||
|
||||
get-stream@^4.0.0, get-stream@^4.1.0:
|
||||
get-stream@^4.1.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
|
||||
integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==
|
||||
@@ -29235,15 +29222,6 @@ stop-iteration-iterator@^1.0.0, stop-iteration-iterator@^1.1.0:
|
||||
es-errors "^1.3.0"
|
||||
internal-slot "^1.1.0"
|
||||
|
||||
stop-only@3.4.1:
|
||||
version "3.4.1"
|
||||
resolved "https://registry.yarnpkg.com/stop-only/-/stop-only-3.4.1.tgz#c4c407a82270f0d540dd57b551c7bd16ce81a457"
|
||||
integrity sha512-zMxczK6GJG5h1UZgk3VPJjOQJ0w7C9MclgqgcQPct8KgOWUItrUz7sK7MjoRQWvFJQJaDUpXrcV/OHyhqB9pZQ==
|
||||
dependencies:
|
||||
debug "4.3.7"
|
||||
execa "0.11.0"
|
||||
minimist "1.2.8"
|
||||
|
||||
stream-browserify@3.0.0, stream-browserify@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-3.0.0.tgz#22b0a2850cdf6503e73085da1fc7b7d0c2122f2f"
|
||||
|
||||
Reference in New Issue
Block a user