Skip to content

Commit 8ba5ccb

Browse files
committedJan 15, 2025
eslint for packages/data-context
1 parent d035fa9 commit 8ba5ccb

29 files changed

+141
-94
lines changed
 

‎eslint.config.ts

+45-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const baseConfig: InfiniteDepthConfigWithExtends[] = [
7171
rules: {
7272
'no-console': 'error',
7373
'no-restricted-properties': [
74-
'error',
74+
'warn',
7575
{
7676
object: 'process',
7777
property: 'geteuid',
@@ -85,14 +85,55 @@ export const baseConfig: InfiniteDepthConfigWithExtends[] = [
8585
],
8686
'no-restricted-syntax': [
8787
// esquery tool: https://estools.github.io/esquery/
88-
'error',
88+
'warn',
8989
{
9090
// match sync FS methods except for `existsSync`
9191
// examples: fse.readFileSync, fs.readFileSync, this.ctx.fs.readFileSync...
9292
selector: `MemberExpression[object.name='fs'][property.name=/^[A-z]+Sync$/]:not(MemberExpression[property.name='existsSync']), MemberExpression[property.name=/^[A-z]+Sync$/]:not(MemberExpression[property.name='existsSync']):has(MemberExpression[property.name='fs'])`,
9393
message: 'Synchronous fs calls should not be used in Cypress. Use an async API instead.',
9494
},
9595
],
96+
'padding-line-between-statements': [
97+
'error',
98+
{
99+
'blankLine': 'always',
100+
'prev': '*',
101+
'next': 'return',
102+
},
103+
{
104+
'blankLine': 'always',
105+
'prev': [
106+
'const',
107+
'let',
108+
'var',
109+
'if',
110+
'while',
111+
'export',
112+
'cjs-export',
113+
'import',
114+
'cjs-import',
115+
'multiline-expression',
116+
],
117+
'next': '*',
118+
},
119+
{
120+
'blankLine': 'any',
121+
'prev': [
122+
'const',
123+
'let',
124+
'var',
125+
'import',
126+
'cjs-import',
127+
],
128+
'next': [
129+
'const',
130+
'let',
131+
'var',
132+
'import',
133+
'cjs-import',
134+
],
135+
},
136+
],
96137
},
97138
},
98139

@@ -120,6 +161,7 @@ export const baseConfig: InfiniteDepthConfigWithExtends[] = [
120161
'@typescript-eslint/triple-slash-reference': 'off',
121162
'@typescript-eslint/no-empty-object-type': 'off',
122163
'@typescript-eslint/no-wrapper-object-types': 'off',
164+
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
123165

124166
'vue/multi-word-component-names': 'off',
125167
'vue/html-closing-bracket-spacing': 'off',
@@ -157,6 +199,7 @@ export const baseConfig: InfiniteDepthConfigWithExtends[] = [
157199
ignores: [
158200
'.releaserc.js',
159201
'dist/**/*',
202+
'**/__snapshots__/*',
160203
],
161204
},
162205

‎packages/data-context/.eslintignore

-9
This file was deleted.
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { baseConfig } from '../../eslint.config'
2+
import globals from 'globals'
3+
4+
export default [
5+
...baseConfig,
6+
{
7+
languageOptions: {
8+
globals: {
9+
...globals.node,
10+
},
11+
},
12+
},
13+
]

‎packages/data-context/src/actions/CodegenActions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface ReactComponentDescriptor {
1515
export class CodegenActions {
1616
constructor (private ctx: DataContext) {}
1717

18-
async getReactComponentsFromFile (filePath: string, reactDocgen?: typeof import('react-docgen')): Promise<{components: ReactComponentDescriptor[], errored?: boolean }> {
18+
async getReactComponentsFromFile (filePath: string, reactDocgen?: typeof import('react-docgen')): Promise<{ components: ReactComponentDescriptor[], errored?: boolean }> {
1919
try {
2020
// this dance to get react-docgen is for now because react-docgen is a module and our typescript settings are set up to transpile to commonjs
2121
// which will require the module, which will fail because it's an es module. This is a temporary workaround.

‎packages/data-context/src/actions/DataEmitterActions.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ export class DataEmitterActions extends DataEmitterEvents {
226226
* the particular event. When the `listenerCount` is zero, then there are no
227227
* longer any subscribers for that event
228228
*/
229-
subscribeTo <T> (evt: keyof DataEmitterEvents, opts?: {sendInitial: boolean, initialValue?: T, filter?: (val: any) => boolean, onUnsubscribe?: (listenerCount: number) => void }): AsyncGenerator<T> {
229+
subscribeTo <T> (evt: keyof DataEmitterEvents, opts?: { sendInitial: boolean, initialValue?: T, filter?: (val: any) => boolean, onUnsubscribe?: (listenerCount: number) => void }): AsyncGenerator<T> {
230230
const { sendInitial = true } = opts ?? {}
231231
let hasSentInitial = false
232232
let dfd: pDefer.DeferredPromise<any> | undefined
@@ -279,7 +279,7 @@ export class DataEmitterActions extends DataEmitterEvents {
279279
throw: async (error: Error) => {
280280
throw error
281281
},
282-
return: async (): Promise<{ done: true, value: T | undefined}> => {
282+
return: async (): Promise<{ done: true, value: T | undefined }> => {
283283
this.pub.off(evt, subscribed)
284284

285285
if (opts?.onUnsubscribe) {

‎packages/data-context/src/actions/MigrationActions.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-dupe-class-members */
21
import path from 'path'
32
import debugLib from 'debug'
43
import { fork } from 'child_process'

‎packages/data-context/src/actions/ProjectActions.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export interface ProjectApiShape {
4747
makeProjectSavedState(projectRoot: string): void
4848
getDevServer (): {
4949
updateSpecs(specs: SpecWithRelativeRoot[]): void
50-
start(options: {specs: Cypress.Spec[], config: FullConfig}): Promise<{port: number}>
50+
start(options: { specs: Cypress.Spec[], config: FullConfig }): Promise<{ port: number }>
5151
close(): void
5252
emitter: EventEmitter
5353
}
@@ -490,7 +490,7 @@ export class ProjectActions {
490490
}
491491
}
492492

493-
async runSpec ({ specPath }: { specPath: string}) {
493+
async runSpec ({ specPath }: { specPath: string }) {
494494
const waitForBrowserToOpen = async () => {
495495
const browserStatusSubscription = this.ctx.emitter.subscribeTo('browserStatusChange', { sendInitial: false })
496496

‎packages/data-context/src/data/LegacyPluginsIpc.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-dupe-class-members */
21
import type { ChildProcess } from 'child_process'
32
import EventEmitter from 'events'
43
import type { CypressError } from '@packages/errors'
@@ -16,7 +15,7 @@ export class LegacyPluginsIpc extends EventEmitter {
1615
})
1716
}
1817

19-
send(event: 'loadLegacyPlugins', legacyConfig: LegacyCypressConfigJson): boolean
18+
send (event: 'loadLegacyPlugins', legacyConfig: LegacyCypressConfigJson): boolean
2019
send (event: string, ...args: any[]) {
2120
if (this.childProcess.killed || !this.childProcess.connected) {
2221
return false
@@ -25,10 +24,10 @@ export class LegacyPluginsIpc extends EventEmitter {
2524
return this.childProcess.send({ event, args })
2625
}
2726

28-
on(event: 'ready', listener: () => void): this
29-
on(event: 'loadLegacyPlugins:error', listener: (error: CypressError) => void): this
30-
on(event: 'childProcess:unhandledError', listener: (legacyConfig: LegacyCypressConfigJson) => void): this
31-
on(event: 'loadLegacyPlugins:reply', listener: (legacyConfig: LegacyCypressConfigJson) => void): this
27+
on (event: 'ready', listener: () => void): this
28+
on (event: 'loadLegacyPlugins:error', listener: (error: CypressError) => void): this
29+
on (event: 'childProcess:unhandledError', listener: (legacyConfig: LegacyCypressConfigJson) => void): this
30+
on (event: 'loadLegacyPlugins:reply', listener: (legacyConfig: LegacyCypressConfigJson) => void): this
3231
on (evt: string, listener: (...args: any[]) => void) {
3332
return super.on(evt, listener)
3433
}

‎packages/data-context/src/data/ProjectConfigIpc.ts

+15-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-dupe-class-members */
21
import { CypressError, getError } from '@packages/errors'
32
import type { FullConfig, TestingType } from '@packages/types'
43
import { ChildProcess, fork, ForkOptions, spawn } from 'child_process'
@@ -36,7 +35,7 @@ const isSandboxNeeded = () => {
3635
export interface SetupNodeEventsReply {
3736
setupConfig: Cypress.ConfigOptions | null
3837
requires: string[]
39-
registrations: Array<{event: string, eventId: string}>
38+
registrations: Array<{ event: string, eventId: string }>
4039
}
4140

4241
export interface LoadConfigReply {
@@ -96,10 +95,10 @@ export class ProjectConfigIpc extends EventEmitter {
9695
}
9796

9897
// TODO: options => Cypress.TestingTypeOptions
99-
send(event: 'execute:plugins', evt: string, ids: {eventId: string, invocationId: string}, args: any[]): boolean
100-
send(event: 'setupTestingType', testingType: TestingType, options: Cypress.PluginConfigOptions): boolean
101-
send(event: 'loadConfig'): boolean
102-
send(event: 'main:process:will:disconnect'): void
98+
send (event: 'execute:plugins', evt: string, ids: { eventId: string, invocationId: string }, args: any[]): boolean
99+
send (event: 'setupTestingType', testingType: TestingType, options: Cypress.PluginConfigOptions): boolean
100+
send (event: 'loadConfig'): boolean
101+
send (event: 'main:process:will:disconnect'): void
103102
send (event: string, ...args: any[]) {
104103
if (this._childProcess.killed || !this._childProcess.connected) {
105104
return false
@@ -108,29 +107,29 @@ export class ProjectConfigIpc extends EventEmitter {
108107
return this._childProcess.send({ event, args })
109108
}
110109

111-
on(evt: 'childProcess:unhandledError', listener: (err: CypressError) => void): this
112-
on(evt: 'export:telemetry', listener: (data: string) => void): void
113-
on(evt: 'main:process:will:disconnect:ack', listener: () => void): void
114-
on(evt: 'warning', listener: (warningErr: CypressError) => void): this
110+
on (evt: 'childProcess:unhandledError', listener: (err: CypressError) => void): this
111+
on (evt: 'export:telemetry', listener: (data: string) => void): void
112+
on (evt: 'main:process:will:disconnect:ack', listener: () => void): void
113+
on (evt: 'warning', listener: (warningErr: CypressError) => void): this
115114
on (evt: string, listener: (...args: any[]) => void) {
116115
return super.on(evt, listener)
117116
}
118117

119-
once(evt: `promise:fulfilled:${string}`, listener: (err: any, value: any) => void): this
118+
once (evt: `promise:fulfilled:${string}`, listener: (err: any, value: any) => void): this
120119

121120
/**
122121
* When the config is loaded, it comes back with either a "reply", or an "error" if there was a problem
123122
* sourcing the config (script error, etc.)
124123
*/
125-
once(evt: 'ready', listener: () => void): this
126-
once(evt: 'loadConfig:reply', listener: (payload: SerializedLoadConfigReply) => void): this
127-
once(evt: 'loadConfig:error', listener: (err: CypressError) => void): this
124+
once (evt: 'ready', listener: () => void): this
125+
once (evt: 'loadConfig:reply', listener: (payload: SerializedLoadConfigReply) => void): this
126+
once (evt: 'loadConfig:error', listener: (err: CypressError) => void): this
128127

129128
/**
130129
* When
131130
*/
132-
once(evt: 'setupTestingType:reply', listener: (payload: SetupNodeEventsReply) => void): this
133-
once(evt: 'setupTestingType:error', listener: (error: CypressError) => void): this
131+
once (evt: 'setupTestingType:reply', listener: (payload: SetupNodeEventsReply) => void): this
132+
once (evt: 'setupTestingType:error', listener: (error: CypressError) => void): this
134133
once (evt: string, listener: (...args: any[]) => void) {
135134
return super.once(evt, listener)
136135
}

‎packages/data-context/src/globalPubSub.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-dupe-class-members */
21
import EventEmitter from 'events'
32
import type { DataContext } from './DataContext'
43

@@ -11,20 +10,20 @@ type MenuItem = 'log:out'
1110
* to reset the global state for testing / resetting when there is an error
1211
*/
1312
export class GlobalPubSub extends EventEmitter {
14-
on(msg: 'reset:data-context', listener: (ctx: DataContext) => void): this
15-
on(msg: 'menu:item:clicked', listener: (item: MenuItem) => void): this
16-
on(msg: 'test:cleanup', listener: (...args: any[]) => void): this
13+
on (msg: 'reset:data-context', listener: (ctx: DataContext) => void): this
14+
on (msg: 'menu:item:clicked', listener: (item: MenuItem) => void): this
15+
on (msg: 'test:cleanup', listener: (...args: any[]) => void): this
1716
on (msg: string, listener: (...args: any[]) => void) {
1817
return super.on(msg, listener)
1918
}
2019

21-
emit(msg: 'menu:item:clicked', arg: MenuItem): boolean
22-
emit(msg: 'reset:data-context', arg: DataContext): boolean
20+
emit (msg: 'menu:item:clicked', arg: MenuItem): boolean
21+
emit (msg: 'reset:data-context', arg: DataContext): boolean
2322
emit (msg: string, ...args: any[]) {
2423
return super.emit(msg, ...args)
2524
}
2625

27-
emitThen(msg: 'test:cleanup'): Promise<void>
26+
emitThen (msg: 'test:cleanup'): Promise<void>
2827
async emitThen (msg: string, ...args: any[]): Promise<void> {
2928
// @ts-expect-error
3029
const events = this._events
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable padding-line-between-statements */
21
// created by autobarrel, do not modify directly
32

43
export * from './poller'

‎packages/data-context/src/polling/poller.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class Poller<E extends EventType, T = never, M = never> {
2525
this.pollingInterval = interval
2626
}
2727

28-
start (config: {initialValue?: T, meta?: M, filter?: (val: any) => boolean} = {}) {
28+
start (config: { initialValue?: T, meta?: M, filter?: (val: any) => boolean } = {}) {
2929
const subscriptionId = ++this.#subscriptionId
3030

3131
debug(`subscribing to ${this.event} with initial value %o and meta %o`, config?.initialValue, config?.meta)

‎packages/data-context/src/sources/BrowserDataSource.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if (os.platform() === 'win32') {
2323

2424
const platform = os.platform()
2525

26-
function getBrowserKey<T extends {name: string, version: string | number}> (browser: T) {
26+
function getBrowserKey<T extends { name: string, version: string | number }> (browser: T) {
2727
return `${browser.name}-${browser.version}`
2828
}
2929

‎packages/data-context/src/sources/CloudDataSource.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ const REMOTE_SCHEMA_URLS = {
3838
production: 'https://cloud.cypress.io',
3939
}
4040

41-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
4241
type StartsWith<T, Prefix extends string> = T extends `${Prefix}${infer _U}` ? T : never
4342
type CloudQueryField = StartsWith<keyof NexusGen['fieldTypes']['Query'], 'cloud'>
4443

@@ -121,10 +120,10 @@ export class CloudDataSource {
121120
...urqlCacheKeys,
122121
updates: {
123122
Mutation: {
124-
_cloudCacheInvalidate: (parent, { args }: {args: Parameters<Cache['invalidate']>}, cache, info) => {
123+
_cloudCacheInvalidate: (parent, { args }: { args: Parameters<Cache['invalidate']> }, cache, info) => {
125124
cache.invalidate(...args)
126125
},
127-
_showUrqlCache: (parent, { args }: {args: Parameters<Cache['invalidate']>}, cache, info) => {
126+
_showUrqlCache: (parent, { args }: { args: Parameters<Cache['invalidate']> }, cache, info) => {
128127
this.#lastCache = JSON.stringify(cache, function replacer (key, value) {
129128
if (value instanceof Map) {
130129
const reducer = (obj: any, mapKey: any) => {

‎packages/data-context/src/sources/ProjectDataSource.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export function getPathFromSpecPattern ({
149149
{ specPattern: string
150150
testingType: TestingType
151151
fileExtensionToUse?: FileExtension
152-
name?: string}) {
152+
name?: string }) {
153153
function replaceWildCard (s: string, fallback: string) {
154154
return s.replace(/\*/g, fallback)
155155
}

‎packages/data-context/src/sources/RelevantRunsDataSource.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class RelevantRunsDataSource {
4444
#pollingInterval: number = 30
4545
#cached: RelevantRun = RUNS_EMPTY_RETURN
4646

47-
#runsPoller?: Poller<'relevantRunChange', RelevantRun, { name: RelevantRunLocationEnum}>
47+
#runsPoller?: Poller<'relevantRunChange', RelevantRun, { name: RelevantRunLocationEnum }>
4848

4949
constructor (private ctx: DataContext) {}
5050

‎packages/data-context/src/sources/RemoteRequestDataSource.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface OperationDefinition {
2727
operation: string
2828
operationDoc: DocumentNode
2929
operationHash: string
30-
operationVariableDefs: [string, {type: TypeNode, defaultValue?: ValueNode}][]
30+
operationVariableDefs: [string, { type: TypeNode, defaultValue?: ValueNode }][]
3131
remoteQueryField: string
3232
fieldArgMapping: Record<string, string>
3333
}
@@ -312,7 +312,7 @@ export class RemoteRequestDataSource {
312312

313313
const remoteFieldArgs = queryFieldDef.args
314314

315-
const operationVariableDefs: [string, {type: TypeNode, defaultValue?: ValueNode}][] = []
315+
const operationVariableDefs: [string, { type: TypeNode, defaultValue?: ValueNode }][] = []
316316
const fieldArgs: [string, ValueNode][] = []
317317

318318
const fieldArgMapping: Record<string, string> = {}
@@ -371,7 +371,7 @@ export class RemoteRequestDataSource {
371371
// Gather the referenced variables from each of the field nodes we
372372
// are generating a query with
373373
#getReferencedVariables (selectionNodes: readonly SelectionNode[], outerVariableDefs: readonly VariableDefinitionNode[]) {
374-
const variableDefinitions: Record<string, {type: TypeNode, defaultValue?: ValueNode}> = {}
374+
const variableDefinitions: Record<string, { type: TypeNode, defaultValue?: ValueNode }> = {}
375375

376376
selectionNodes.map((node) => {
377377
visit(node, {
@@ -410,7 +410,7 @@ export class RemoteRequestDataSource {
410410
fieldName: string
411411
fieldArgs: [string, ValueNode][]
412412
fieldNodes: readonly SelectionNode[]
413-
operationVariableDefs: [string, {type: TypeNode, defaultValue?: ValueNode}][]
413+
operationVariableDefs: [string, { type: TypeNode, defaultValue?: ValueNode }][]
414414
},
415415
): DocumentNode {
416416
const { operationVariableDefs = [], fieldArgs = [] } = params

‎packages/data-context/src/sources/VersionsDataSource.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export class VersionsDataSource {
110110

111111
try {
112112
response = await this.ctx.util.fetch(NPM_CYPRESS_REGISTRY_URL)
113-
const responseJson = await response.json() as { time: Record<string, string>}
113+
const responseJson = await response.json() as { time: Record<string, string> }
114114

115115
debug('NPM release dates received %o', { modified: responseJson.time.modified })
116116

‎packages/data-context/src/sources/migration/legacyOptions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ const runtimeOptions: Array<RuntimeConfigOption> = [
290290
},
291291
]
292292

293-
export const legacyOptions: Array<ResolvedConfigOption|RuntimeConfigOption> = [
293+
export const legacyOptions: Array<ResolvedConfigOption | RuntimeConfigOption> = [
294294
...resolvedOptions,
295295
...runtimeOptions,
296296
]

‎packages/data-context/src/util/DocumentNodeBuilder.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export interface RemoteQueryConfig {
55
variableDefinitions: VariableDefinitionNode[]
66
}
77

8-
export type DocumentNodeBuilderParams = Pick<GraphQLResolveInfo, 'fieldNodes' | 'parentType'> & {isNode?: boolean, isRemoteFetchable?: boolean, variableDefinitions: readonly VariableDefinitionNode[] | undefined, operationName: string}
8+
export type DocumentNodeBuilderParams = Pick<GraphQLResolveInfo, 'fieldNodes' | 'parentType'> & { isNode?: boolean, isRemoteFetchable?: boolean, variableDefinitions: readonly VariableDefinitionNode[] | undefined, operationName: string }
99

1010
/**
1111
* Builds a DocumentNode from a given GraphQLResolveInfo payload

‎packages/data-context/src/util/autoBindDebug.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const debugLibCache: Record<string, debugLib.Debugger> = {}
1111
* to the constructor of the class for which you want to enable logging, you can then
1212
* set DEBUG=cypress-trace:<ClassName> to utilize the logging
1313
*/
14-
export function autoBindDebug <T extends object> (obj: T): T {
14+
export function autoBindDebug<T extends object> (obj: T): T {
1515
const ns = `trace-cypress:${obj.constructor.name}`
1616
const debug = debugLibCache[ns] = debugLibCache[ns] || debugLib(ns)
1717

‎packages/data-context/src/util/cached.ts

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export const cached = <T>(
2727
throw new Error('@cached target must be configurable')
2828
} else {
2929
descriptor.get = function () {
30-
// eslint-disable-next-line
3130
const value = originalMethod.apply(this, arguments as any)
3231
const newDescriptor: PropertyDescriptor = {
3332
configurable: false,

‎packages/data-context/src/util/config-file-updater.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ function setSubKeysSplicers (
200200

201201
const keysToUpdateWithObjects: string[] = []
202202

203-
const objSubkeys = Object.keys(obj).filter((key) => typeof obj[key] === 'object').reduce((acc: Array<{parent: string, subkey: string}>, key) => {
203+
const objSubkeys = Object.keys(obj).filter((key) => typeof obj[key] === 'object').reduce((acc: Array<{ parent: string, subkey: string }>, key) => {
204204
keysToUpdateWithObjects.push(key)
205205
Object.entries(obj[key]).forEach(([subkey, value]) => {
206206
if (['boolean', 'number', 'string'].includes(typeof value)) {
@@ -294,7 +294,7 @@ function isUndefinedOrNull (value: NodePath['node']): value is namedTypes.Identi
294294
return value.type === 'Identifier' && ['undefined', 'null'].includes(value.name)
295295
}
296296

297-
interface Splicer{
297+
interface Splicer {
298298
start: number
299299
end: number
300300
replaceString: string

‎packages/data-context/src/util/testCounts.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export async function getTestCounts (specs: SpecWithRelativeRoot[]) {
1313
const startTime = performance.now()
1414

1515
const specCountPromises = specs.map((spec) => {
16-
return new Promise<{path: string, isExample: boolean, testCounts: number}>((resolve, reject) => {
16+
return new Promise<{ path: string, isExample: boolean, testCounts: number }>((resolve, reject) => {
1717
let testCounts = 0
1818

1919
readline.createInterface({
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { FoundBrowser } from "@packages/types";
1+
import { FoundBrowser } from '@packages/types'
22

33
export const foundBrowserChrome: FoundBrowser = {
44
name: 'chrome',
55
family: 'chromium',
66
channel: 'stable',
77
displayName: 'Chrome',
88
path: '/usr/bin/chrome',
9-
version: '100.0.0'
9+
version: '100.0.0',
1010
} as const
1111

1212
export const userBrowser: Cypress.Browser = {
@@ -16,4 +16,4 @@ export const userBrowser: Cypress.Browser = {
1616
isHeadless: false,
1717
family: 'chromium',
1818
majorVersion: '100',
19-
}
19+
}

‎packages/data-context/test/unit/actions/DataEmitterActions.spec.ts

-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ describe('DataEmitterActions', () => {
2020
let completed = false
2121

2222
const testIterator = async () => {
23-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2423
for await (const _value of subscription) {
2524
items += 1
2625
}
@@ -56,7 +55,6 @@ describe('DataEmitterActions', () => {
5655
let completed = false
5756

5857
const testIterator = async () => {
59-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6058
for await (const _value of subscription) {
6159
items += 1
6260
}
@@ -87,7 +85,6 @@ describe('DataEmitterActions', () => {
8785
let completed = false
8886

8987
const testIterator = async () => {
90-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
9188
for await (const _value of subscription) {
9289
items += 1
9390
}
@@ -115,7 +112,6 @@ describe('DataEmitterActions', () => {
115112
}
116113

117114
const testIterator = async () => {
118-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
119115
for await (const _value of subscription) {
120116
returnVal.items += 1
121117
}

‎packages/data-context/test/unit/codegen/files/react/Button.jsx

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
// @ts-nocheck
2-
import React from 'react';
3-
import PropTypes from 'prop-types';
4-
import './button.css';
2+
import React from 'react'
3+
import PropTypes from 'prop-types'
4+
import './button.css'
55

66
/**
77
* Primary UI component for user interaction
88
*/
9-
export default Button = ({ primary, backgroundColor, size, label, ...props }) => {
10-
const mode = primary ? 'button--primary' : 'button--secondary';
9+
const Button = ({ primary, backgroundColor, size, label, ...props }) => {
10+
const mode = primary ? 'button--primary' : 'button--secondary'
11+
1112
return (
1213
<button
1314
type="button"
@@ -17,8 +18,10 @@ export default Button = ({ primary, backgroundColor, size, label, ...props }) =>
1718
>
1819
{label}
1920
</button>
20-
);
21-
};
21+
)
22+
}
23+
24+
export default Button
2225

2326
Button.propTypes = {
2427
/**
@@ -41,11 +44,11 @@ Button.propTypes = {
4144
* Optional click handler
4245
*/
4346
onClick: PropTypes.func,
44-
};
47+
}
4548

4649
Button.defaultProps = {
4750
backgroundColor: null,
4851
primary: false,
4952
size: 'medium',
5053
onClick: undefined,
51-
};
54+
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
<template>
2-
<button type="button" :class="classes" @click="onClick" :style="style">{{ label }}</button>
2+
<button
3+
type="button"
4+
:class="classes"
5+
:style="style"
6+
@click="onClick"
7+
>
8+
{{ label }}
9+
</button>
310
</template>
411

512
<script>
613
// @ts-nocheck
7-
import './button.css';
8-
import { reactive, computed } from 'vue';
14+
import './button.css'
15+
import { reactive, computed } from 'vue'
916
1017
export default {
11-
name: 'my-button',
18+
name: 'MyButton',
1219
1320
props: {
1421
label: {
@@ -22,7 +29,7 @@ export default {
2229
size: {
2330
type: String,
2431
validator: function (value) {
25-
return ['small', 'medium', 'large'].indexOf(value) !== -1;
32+
return ['small', 'medium', 'large'].indexOf(value) !== -1
2633
},
2734
},
2835
backgroundColor: {
@@ -32,8 +39,9 @@ export default {
3239
3340
emits: ['click'],
3441
35-
setup(props, { emit }) {
36-
props = reactive(props);
42+
setup (props, { emit }) {
43+
props = reactive(props)
44+
3745
return {
3846
classes: computed(() => ({
3947
'button': true,
@@ -44,10 +52,10 @@ export default {
4452
style: computed(() => ({
4553
backgroundColor: props.backgroundColor,
4654
})),
47-
onClick() {
48-
emit('click');
49-
}
55+
onClick () {
56+
emit('click')
57+
},
5058
}
5159
},
52-
};
60+
}
5361
</script>

‎packages/data-context/test/unit/polling/poller.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ describe('Poller', () => {
111111
const callback = sinon.stub()
112112
const interval = 5
113113

114-
const poller = new Poller<'relevantRunChange', { name: string }, { name: string}>(ctx, 'relevantRunChange', interval, callback)
114+
const poller = new Poller<'relevantRunChange', { name: string }, { name: string }>(ctx, 'relevantRunChange', interval, callback)
115115

116116
expect(poller.subscriptions).to.have.length(0)
117117

0 commit comments

Comments
 (0)
Please sign in to comment.