Skip to content

Commit 68c5714

Browse files
chore: Cleanup duplication across tsconfig files in packages (#30764)
* Cleanup duplication across tsconfig files in packages * empty commit * Add ts-ignore * Add ts-ignore
1 parent 53d47cf commit 68c5714

File tree

20 files changed

+115
-210
lines changed

20 files changed

+115
-210
lines changed

packages/app/tsconfig.json

-2
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@
1313
],
1414
"compilerOptions": {
1515
"noImplicitThis": true,
16-
"useDefineForClassFields": true,
1716
"paths": {
1817
"@cy/i18n": ["../frontend-shared/src/locales/i18n"],
1918
"@cy/components/*": ["../frontend-shared/src/components/*"],
2019
"@cy/gql-components/*": ["../frontend-shared/src/gql-components/*"],
2120
"@cy/store/*": ["../frontend-shared/src/store/*"],
2221
"@packages/*": ["../*"]
2322
},
24-
"allowJs": true,
2523
"types": [
2624
"cypress",
2725
"cypress-real-events",

packages/config/tsconfig.json

-10
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,9 @@
77
"test"
88
],
99
"compilerOptions": {
10-
"strict": true,
1110
"allowJs": false,
1211
"rootDir": "src",
1312
"noImplicitAny": true,
14-
"resolveJsonModule": true,
15-
"experimentalDecorators": true,
16-
"noUncheckedIndexedAccess": true,
17-
"ignoreDeprecations": "5.0",
18-
/*
19-
* TODO: remove importsNotUsedAsValues after typescript 5.5 and up as it will no longer work. If we want the same behavior
20-
* as importsNotUsedAsValues, we need to use "verbatimModuleSyntax", which will require this package to be an ES Module.
21-
*/
22-
"importsNotUsedAsValues": "error",
2313
"types": ["node"],
2414
"typeRoots": [
2515
"../../node_modules/@types"

packages/data-context/tsconfig.json

-11
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,8 @@
99
],
1010
"compilerOptions": {
1111
"lib": ["esnext"],
12-
"strict": true,
1312
"allowJs": false,
1413
"noImplicitAny": true,
15-
"resolveJsonModule": true,
16-
"experimentalDecorators": true,
17-
"noUnusedLocals": false,
18-
"noUncheckedIndexedAccess": true,
19-
"ignoreDeprecations": "5.0",
20-
/*
21-
* TODO: remove importsNotUsedAsValues after typescript 5.5 and up as it will no longer work. If we want the same behavior
22-
* as importsNotUsedAsValues, we need to use "verbatimModuleSyntax", which will require this package to be an ES Module.
23-
*/
24-
"importsNotUsedAsValues": "error",
2514
"types": ["cypress"],
2615
}
2716
}

packages/driver/tsconfig.json

-8
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,15 @@
33
"compilerOptions": {
44
"target": "ES2016",
55
"lib": ["ES2021", "DOM", "DOM.Iterable"],
6-
"module": "commonjs",
76
"allowJs": true,
8-
"noImplicitAny": false,
97
"noImplicitThis": false,
108
"strictFunctionTypes": true,
119
"preserveWatchOutput": true,
1210
"sourceMap": true,
13-
"importHelpers": true,
1411
"strictNullChecks": true,
15-
"strict": true,
1612
"forceConsistentCasingInFileNames": true,
17-
"skipLibCheck": true,
1813
"noEmit": true,
19-
"noImplicitReturns": true,
20-
"allowSyntheticDefaultImports": true,
2114
"outDir": "dist",
22-
"esModuleInterop": true,
2315
"noErrorTruncation": true,
2416
"types": []
2517
},

packages/errors/tsconfig.json

-10
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,8 @@
44
"src",
55
],
66
"compilerOptions": {
7-
"strict": true,
87
"allowJs": false,
98
"noImplicitAny": true,
10-
"resolveJsonModule": true,
11-
"experimentalDecorators": true,
129
"noImplicitReturns": false,
13-
"noUncheckedIndexedAccess": true,
14-
"ignoreDeprecations": "5.0",
15-
/*
16-
* TODO: remove importsNotUsedAsValues after typescript 5.5 and up as it will no longer work. If we want the same behavior
17-
* as importsNotUsedAsValues, we need to use "verbatimModuleSyntax", which will require this package to be an ES Module.
18-
*/
19-
"importsNotUsedAsValues": "error",
2010
}
2111
}

packages/extension/tsconfig.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
{
2+
"extends": "../ts/tsconfig.json",
23
"compilerOptions": {
34
"target": "es2015",
4-
"module": "commonjs",
5-
"allowJs": true,
6-
"allowSyntheticDefaultImports": true,
7-
"esModuleInterop": true,
8-
"noImplicitAny": false,
9-
"importHelpers": true,
105
"strict": false
116
}
127
}
+2-57
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,12 @@
11
{
2+
"extends": "../ts/tsconfig.json",
23
"compilerOptions": {
3-
/* Basic Options */
4-
"target": "ES2018",
54
"module": "esnext",
65
"lib": ["dom", "ESNext"],
7-
/*
8-
* Allow javascript files to be compiled.
9-
* Override this in modules that need JS
10-
*/
11-
"noEmit": true,
126
"jsx": "preserve",
137
"preserveWatchOutput": true,
14-
// "checkJs": true, /* Report errors in .js files. */
15-
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
16-
/* Generates corresponding '.d.ts' file. */
17-
// "declaration": true,
18-
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
19-
/* Generates corresponding '.map' file. */
20-
"sourceMap": true,
21-
/* Import emit helpers from 'tslib'. */
22-
"importHelpers": true,
23-
"strictNullChecks": true,
24-
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
25-
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
26-
/* Strict Type-Checking Options */
27-
// "traceResolution": true,
28-
"strict": true,
29-
"noImplicitAny": false,
308
"noImplicitThis": false,
31-
"forceConsistentCasingInFileNames": true,
32-
/**
33-
* Skip type checking of all declaration files (*.d.ts).
34-
* TODO: Look into changing this in the future
35-
*/
36-
/* Additional Checks */
37-
"skipLibCheck": true,
38-
/* Report errors on unused locals. */
39-
// "noEmit": true,
40-
"noUnusedLocals": false,
41-
// "noUnusedParameters": true, /* Report errors on unused parameters. */
42-
/* Report error when not all code paths in function return a value. */
43-
"noImplicitReturns": true,
44-
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
45-
/* Module Resolution Options */
46-
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
47-
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
48-
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
49-
// "rootDirs": ["../driver/src"], /* List of root folders whose combined content represents the structure of the project at runtime. */
50-
// "typeRoots": [] /* List of folders to include type definitions from. */
51-
52-
/* Type declaration files to be included in compilation. */
9+
"noErrorTruncation": true,
5310
"paths": {
5411
"@cy/i18n": ["../frontend-shared/src/locales/i18n"],
5512
"@cy/components/*": ["../frontend-shared/src/components/*"]
@@ -63,17 +20,5 @@
6320
"cypress-real-events",
6421
"cypress"
6522
],
66-
"allowSyntheticDefaultImports": true,
67-
"esModuleInterop": true,
68-
"noErrorTruncation": true,
69-
"experimentalDecorators": true,
70-
"resolveJsonModule": true,
71-
"ignoreDeprecations": "5.0",
72-
/*
73-
* TODO: remove importsNotUsedAsValues after typescript 5.5 and up as it will no longer work. If we want the same behavior
74-
* as importsNotUsedAsValues, we need to use "verbatimModuleSyntax", which will require this package to be an ES Module.
75-
*/
76-
"importsNotUsedAsValues": "error",
77-
"useUnknownInCatchVariables": false
7823
}
7924
}

packages/graphql/src/utils/nexusTypegenUtils.ts

-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ const nexusTypegenDebounced = (cfg: NexusTypegenCfg) => {
9292
debounced[cfg.filePath] =
9393
debounced[cfg.filePath] ?? _.debounce(nexusTypegen, 500)
9494

95-
// @ts-expect-error
9695
debounced[cfg.filePath](cfg)
9796
}
9897

packages/graphql/tsconfig.json

-11
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,8 @@
1010
],
1111
"compilerOptions": {
1212
"lib": ["esnext"],
13-
"strict": true,
1413
"allowJs": false,
1514
"noImplicitAny": true,
16-
"noUnusedLocals": false,
17-
"resolveJsonModule": true,
18-
"experimentalDecorators": true,
19-
"noUncheckedIndexedAccess": true,
20-
"ignoreDeprecations": "5.0",
21-
/*
22-
* TODO: remove importsNotUsedAsValues after typescript 5.5 and up as it will no longer work. If we want the same behavior
23-
* as importsNotUsedAsValues, we need to use "verbatimModuleSyntax", which will require this package to be an ES Module.
24-
*/
25-
"importsNotUsedAsValues": "error",
2615
"types": []
2716
},
2817
}

packages/icons/tsconfig.json

-12
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
11
{
22
"extends": "../ts/tsconfig.json",
33
"compilerOptions": {
4-
"strict": true,
54
"allowJs": false,
65
"noImplicitAny": true,
7-
"noUnusedLocals": false,
8-
"resolveJsonModule": true,
9-
"experimentalDecorators": true,
10-
"noUncheckedIndexedAccess": true,
11-
"ignoreDeprecations": "5.0",
12-
/*
13-
* TODO: remove importsNotUsedAsValues after typescript 5.5 and up as it will no longer work. If we want the same behavior
14-
* as importsNotUsedAsValues, we need to use "verbatimModuleSyntax", which will require this package to be an ES Module.
15-
*/
16-
"importsNotUsedAsValues": "error",
176
"outDir": "dist",
18-
"declaration": true
197
},
208
}

packages/launcher/tsconfig.json

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"./index.ts"
66
],
77
"compilerOptions": {
8-
"skipLibCheck": true
98
},
109
"files": [
1110
"./../ts/index.d.ts"

packages/reporter/tsconfig.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"extends": "../ts/tsconfig.json",
33
"compilerOptions": {
4-
"useDefineForClassFields": true,
54
"types": [
65
"node",
76
"cypress",

packages/scaffold-config/tsconfig.json

-11
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,8 @@
1010
],
1111
"compilerOptions": {
1212
"lib": ["esnext"],
13-
"strict": true,
1413
"allowJs": false,
1514
"noImplicitAny": true,
16-
"resolveJsonModule": true,
17-
"experimentalDecorators": true,
18-
"noUnusedLocals": false,
19-
"noUncheckedIndexedAccess": true,
20-
"ignoreDeprecations": "5.0",
21-
/*
22-
* TODO: remove importsNotUsedAsValues after typescript 5.5 and up as it will no longer work. If we want the same behavior
23-
* as importsNotUsedAsValues, we need to use "verbatimModuleSyntax", which will require this package to be an ES Module.
24-
*/
25-
"importsNotUsedAsValues": "error",
2615
"types": []
2716
}
2817
}

packages/server/lib/automation/util.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import type playwright from 'playwright-webkit'
22
import { domainMatch } from 'tough-cookie'
33

4+
// @ts-ignore
45
export type CyCookie = Pick<chrome.cookies.Cookie, 'name' | 'value' | 'expirationDate' | 'hostOnly' | 'domain' | 'path' | 'secure' | 'httpOnly'> & {
56
// use `undefined` instead of `unspecified`
67
sameSite?: 'no_restriction' | 'lax' | 'strict'
78
}
89

910
// Cypress uses the webextension-style filtering
1011
// https://developer.chrome.com/extensions/cookies#method-getAll
12+
// @ts-ignore
1113
export type CyCookieFilter = chrome.cookies.GetAllDetails
1214

1315
export const cookieMatches = (cookie: CyCookie | playwright.Cookie, filter: CyCookieFilter) => {

packages/server/lib/modes/interactive.ts

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ export = {
125125
show: true,
126126
frame: true,
127127
transparent: false,
128+
// @ts-ignore
128129
icon: image.createFromPath(cyIcons.getPathToIcon('icon_64x64.png')),
129130
},
130131
}

packages/server/tsconfig.json

-7
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,5 @@
99
],
1010
"compilerOptions": {
1111
"lib": ["esnext"],
12-
"types": [
13-
"mocha",
14-
"node"
15-
],
16-
"resolveJsonModule": true,
17-
"noUnusedLocals": false,
18-
"importHelpers": true
1912
}
2013
}

packages/socket/tsconfig.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"extends": "./../ts/tsconfig.json",
33
"compilerOptions": {
4-
"strict": true,
54
"noImplicitAny": true,
65
"skipLibCheck": false
76
},

packages/telemetry/tsconfig.json

-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,8 @@
44
"compilerOptions": {
55
"outDir": "./dist",
66
"lib": ["esnext", "DOM"],
7-
"strict": true,
87
"allowJs": false,
98
"noImplicitAny": true,
10-
"resolveJsonModule": true,
11-
"experimentalDecorators": true,
12-
"noUnusedLocals": false,
13-
"noUncheckedIndexedAccess": true,
149
"types": ["cypress"],
1510
}
1611
}

packages/ts/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# TS
22

3-
Internal package used to standardize this repo's version of `ts-node` used for development. In production we pre-transpile all of the typescript so this packages `register` export is a no-op
3+
Internal package used to standardize this repo's version of `ts-node` and the base `tsconfig` options used for development. In production we pre-transpile all of the typescript so this packages `register` export is a no-op
44

55
## Installing
66
N/A - handled by the top level `yarn install`

0 commit comments

Comments
 (0)