From 56656c54534cf3e32d5ba415bedf958e35982e56 Mon Sep 17 00:00:00 2001 From: Daniel Rowe <51932404+d-rowe@users.noreply.github.com> Date: Mon, 2 Dec 2024 12:22:05 -0800 Subject: [PATCH] fix lint Signed-off-by: Daniel Rowe <51932404+d-rowe@users.noreply.github.com> --- cypress.config.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cypress.config.ts b/cypress.config.ts index 78deab98eb7d..fb47e76db7a1 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -const { defineConfig } = require('cypress'); +import { defineConfig } from 'cypress'; +import webpackPreprocessor from '@cypress/webpack-preprocessor'; module.exports = defineConfig({ defaultCommandTimeout: 60000, @@ -31,9 +32,11 @@ module.exports = defineConfig({ }, }); -function setupNodeEvents(on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions): Cypress.PluginConfigOptions { - const webpackPreprocessor = require('@cypress/webpack-preprocessor'); - const webpackOptions = webpackPreprocessor.defaultOptions.webpackOptions; +function setupNodeEvents( + on: Cypress.PluginEvents, + config: Cypress.PluginConfigOptions +): Cypress.PluginConfigOptions { + const { webpackOptions } = webpackPreprocessor.defaultOptions; /** * By default, cypress' internal webpack preprocessor doesn't allow imports without file extensions. @@ -43,7 +46,7 @@ function setupNodeEvents(on: Cypress.PluginEvents, config: Cypress.PluginConfigO * This extra rule relaxes this a bit by allowing imports without file extension * ex. import module from './module' */ - webpackOptions.module.rules.unshift({ + webpackOptions!.module!.rules.unshift({ test: /\.m?js/, resolve: { enforceExtension: false,