Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Rowe <[email protected]>
  • Loading branch information
d-rowe authored Dec 2, 2024
1 parent 3f736b7 commit 56656c5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand All @@ -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,
Expand Down

0 comments on commit 56656c5

Please sign in to comment.