Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions cli/.eslintignore

This file was deleted.

19 changes: 0 additions & 19 deletions cli/.eslintrc.json

This file was deleted.

48 changes: 48 additions & 0 deletions cli/eslint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { baseConfig, cliOverrides } from '@packages/eslint-config'

export default [
...baseConfig,
...cliOverrides,
{
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname,
},
},
},
{
rules: {
'@stylistic/comma-dangle': 'warn',
'@stylistic/comma-spacing': 'warn',
'@stylistic/type-generic-spacing': 'warn',
'@stylistic/quotes': 'warn',
'@stylistic/arrow-parens': 'warn',
'@stylistic/no-multi-spaces': 'warn',
'padding-line-between-statements': 'warn',
'@stylistic/space-unary-ops': 'warn',
'@stylistic/member-delimiter-style': 'warn',
'@stylistic/object-curly-spacing': 'warn',
'@stylistic/semi': 'warn',
'@stylistic/space-in-parens': 'warn',
'@stylistic/space-infix-ops': 'warn',
'@stylistic/template-tag-spacing': 'warn',
'no-var': 'warn',
'@stylistic/space-before-function-paren': ['warn', 'always'],
},
},
{
ignores: [
'**/__snapshots__',
'**/build/**/*',
'package.json',
'**/angular/**/*',
'**/react/**/*',
'**/vue/**/*',
'**/svelte/**/*',
'**/mount-utils/**/*',
'**/types/{bluebird,chai,chai-jquery,jquery,lodash,minimatch,mocha,sinon,sinon-chai}/**/*',
'.mocharc.js',
'**/*.js',
],
},
]
11 changes: 9 additions & 2 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"private": true,
"main": "dist/index.js",
"scripts": {
"build-cli": "tsc && tsc -p tsconfig.esm.json && tsx ./scripts/build.ts && tsx ./scripts/post-build.ts",
"build-cli": "tsc -p tsconfig.build.json && tsc -p tsconfig.esm.json && tsx ./scripts/build.ts && tsx ./scripts/post-build.ts",
"clean": "tsx ./scripts/clean.ts",
"dtslint": "dtslint types",
"postinstall": "patch-package && tsx ./scripts/post-install.ts",
"lint": "eslint --ext .ts,.tsx,.json,.vue .",
"lint": "eslint",
"prebuild": "yarn postinstall && tsx ./scripts/start-build.ts",
"size": "t=\"cypress-v0.0.0.tgz\"; yarn pack --filename \"${t}\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";",
"test": "yarn test-unit",
Expand Down Expand Up @@ -70,6 +70,7 @@
"@cypress/sinon-chai": "2.9.1",
"@cypress/svelte": "0.0.0-development",
"@cypress/vue": "0.0.0-development",
"@packages/eslint-config": "0.0.0-development",
"@packages/root": "0.0.0-development",
"@types/bluebird": "3.5.33",
"@types/chai": "4.2.15",
Expand All @@ -83,7 +84,9 @@
"cross-env": "7.0.3",
"dependency-check": "4.1.0",
"dtslint": "4.2.1",
"eslint": "^9.31.0",
"execa-wrap": "1.4.0",
"jiti": "^2.4.2",
"mock-fs": "5.4.0",
"nock": "13.2.9",
"resolve-pkg": "2.0.0",
Expand Down Expand Up @@ -151,9 +154,13 @@
"workspaces": {
"nohoist": [
"@types/*",
"eslint-plugin-expect-type",
"tsx"
]
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx,json,vue}": "eslint --fix"
},
"nx": {
"targets": {
"build-cli": {
Expand Down
3 changes: 1 addition & 2 deletions cli/scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,9 @@ export default makeUserPackageFile
if (require.main === module) {
makeUserPackageFile(process.env.BRANCH)
.catch((err: any) => {
/* eslint-disable no-console */
console.error('Could not write user package file')
console.error(err)
/* eslint-enable no-console */

process.exit(-1)
})
}
2 changes: 1 addition & 1 deletion cli/scripts/post-install.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node

// @ts-check
/* eslint-disable no-console */

import fs from 'fs-extra'
import { includeTypes } from './utils'
import shell from 'shelljs'
Expand Down
2 changes: 1 addition & 1 deletion cli/scripts/start-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ includeTypes.forEach((folder: string) => {
})

// build the project and copy the build files over to the build directory
shell.exec('tsc -p tsconfig.json')
shell.exec('tsc -p tsconfig.build.json')
shell.exec('tsc -p tsconfig.esm.json')

shell.mkdir('-p', 'build/dist')
Expand Down
22 changes: 22 additions & 0 deletions cli/scripts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"node",
],
"exactOptionalPropertyTypes": true,
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true
},
"include": [
"**/*.ts"
]
}
9 changes: 0 additions & 9 deletions cli/test/.eslintrc.json

This file was deleted.

7 changes: 5 additions & 2 deletions cli/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"noImplicitAny": false,
"types": [
"mocha", "chai", "sinon"
]
}
],
},
"include": [
"**/*.ts"
]
}
17 changes: 17 additions & 0 deletions cli/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"rootDir": "./lib",
"outDir": "./dist",
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the linting allow for these comments?

"module": "commonjs", /* Specify what module code is generated. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
"resolveJsonModule": true,
"strict": true, /* Enable all strict type-checking options. */
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
"noImplicitAny": false,
},
"include": [
"lib/**/*.ts",
]
}
2 changes: 1 addition & 1 deletion cli/tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
"include": [
"lib/**/*.mts"
]
}
}
36 changes: 29 additions & 7 deletions cli/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@
{
"compilerOptions": {
"rootDir": "./lib",
"rootDir": "./",
"outDir": "./dist",
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"module": "commonjs", /* Specify what module code is generated. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
"target": "ES2022",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the other configs extend from this config?

"module": "commonjs",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"strict": true, /* Enable all strict type-checking options. */
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
"strict": true,
"skipLibCheck": true,
"noImplicitAny": false,
"noEmit": true,
"types": [
"mocha"
]
},
"include": [
"lib/**/*.ts",
"test/**/*.ts",
"*.ts"
],
"exclude": [
"types/bluebird",
"types/chai",
"types/chai-jquery",
"types/jquery",
"types/lodash",
"types/minimatch",
"types/mocha",
"types/sinon",
"types/sinon-chai",
"react",
"vue",
"angular",
"svelte",
"mount-utils",
]
}
4 changes: 2 additions & 2 deletions cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,7 @@ declare namespace Cypress {
* cy.get('h1').should('equal', 'Example Domain')
* })
*/
origin<T extends any>(urlOrDomain: string, fn: () => void): Chainable<T>
origin<T>(urlOrDomain: string, fn: () => void): Chainable<T>

/**
* Enables running Cypress commands in a secondary origin.
Expand All @@ -1701,7 +1701,7 @@ declare namespace Cypress {
* expect(foo).to.equal('foo')
* })
*/
origin<T, S extends any>(urlOrDomain: string, options: {
origin<T, S>(urlOrDomain: string, options: {
args: T
}, fn: (args: T) => void): Chainable<S>

Expand Down
Loading
Loading