build: tighten tsconfig (to include build cache, exclude watch folders) (#6375)

* build: extend cypress tsconfig from build tsconfig

* build: exclude node_modules from watch to improve typechecking perf

* fix: even tighter tsconfigs

* fix: even tighter

* fix: tailor cypress tsconfig to testing

* fix: split them up again

* fix: pr comments
This commit is contained in:
Zach Pomerantz 2023-04-24 16:00:04 -07:00 committed by GitHub
parent cd3cff0202
commit 58417412f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 23 additions and 41 deletions

@ -1,8 +0,0 @@
import { defineConfig } from 'cypress'
export default defineConfig({
projectId: 'yp82ef',
e2e: {
specPattern: 'cypress/release.ts',
},
})

@ -1,4 +1,4 @@
import assert = require('assert')
import assert from 'assert'
describe('Service Worker', () => {
before(() => {

@ -1,21 +0,0 @@
const ONE_MINUTE = 60_000
describe(
'Release',
{
pageLoadTimeout: ONE_MINUTE,
retries: 30,
},
() => {
it('loads swap page', () => {
// TODO: We *must* wait in order to space out the retry attempts. Find a better way to do this.
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(ONE_MINUTE)
.visit('/', {
retryOnStatusCodeFailure: true,
retryOnNetworkFailure: true,
})
.get('#swap-page')
})
}
)

@ -6,11 +6,12 @@
// ***********************************************************
// Import commands.ts using ES2015 syntax:
import { injected } from './ethereum'
import assert = require('assert')
import '@cypress/code-coverage/support'
import assert from 'assert'
import { FeatureFlag } from '../../src/featureFlags/flags/featureFlags'
import { injected } from './ethereum'
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace

@ -1,9 +1,17 @@
{
"compilerOptions": {
"esModuleInterop": true,
"incremental": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"noEmit": true,
"strict": true,
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress"]
"target": "ES5",
"tsBuildInfoFile": "../node_modules/.cache/tsbuildinfo/cypress", // avoid clobbering the build tsbuildinfo
"types": ["cypress", "node"]
},
"include": ["**/*.ts"]
"exclude": ["node_modules"],
"include": ["**/*.ts"],
"watchOptions": {
"excludeDirectories": ["node_modules"]
}
}

@ -24,7 +24,7 @@
"analyze": "source-map-explorer 'build/static/js/*.js'",
"serve": "serve build -l 3000",
"lint": "yarn eslint --ignore-path .gitignore --cache --cache-location node_modules/.cache/eslint/ .",
"typecheck": "tsc --noEmit",
"typecheck": "tsc",
"test": "craco test --coverage",
"test:size": "node scripts/test-size.js",
"cypress:open": "cypress open --browser chrome --e2e",

@ -8,7 +8,6 @@
"downlevelIteration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"incremental": true,
"isolatedModules": true,
"jsx": "react-jsx",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
@ -25,10 +24,13 @@
"strict": true,
"strictNullChecks": true,
"target": "ESNext",
"tsBuildInfoFile": "node_modules/.cache/.tsbuildinfo",
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo/build", // avoid clobbering the cypress tsbuildinfo
"types": ["jest"],
"useUnknownInCatchVariables": false
},
"exclude": ["node_modules", "cypress"],
"include": ["src/**/*", "src/**/*.json"]
"exclude": ["node_modules"],
"include": ["src/**/*", "src/**/*.json"],
"watchOptions": {
"excludeDirectories": ["node_modules"]
}
}