fix linting

This commit is contained in:
mahula 2024-02-22 18:56:13 +01:00
parent f3a3b7ca30
commit e4216a965a
4 changed files with 18 additions and 49 deletions

View File

@ -1,43 +1,18 @@
/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import { addCucumberPreprocessorPlugin } from '@badeball/cypress-cucumber-preprocessor' import { addCucumberPreprocessorPlugin } from '@badeball/cypress-cucumber-preprocessor'
import webpack from '@cypress/webpack-preprocessor' import { createEsbuildPlugin } from '@badeball/cypress-cucumber-preprocessor/esbuild'
import createBundler from '@bahmutov/cypress-esbuild-preprocessor'
import { defineConfig } from 'cypress' import { defineConfig } from 'cypress'
const setupNodeEvents = async (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) => { async function setupNodeEvents(
await addCucumberPreprocessorPlugin(on, config, { on: Cypress.PluginEvents,
omitAfterRunHandler: true, config: Cypress.PluginConfigOptions,
}) ): Promise<Cypress.PluginConfigOptions> {
await addCucumberPreprocessorPlugin(on, config)
on( on(
'file:preprocessor', 'file:preprocessor',
webpack({ createBundler({
webpackOptions: { plugins: [createEsbuildPlugin(config)],
resolve: {
extensions: ['.ts', '.js'],
},
module: {
rules: [
{
test: /\.ts$/,
exclude: [/node_modules/],
use: [
{
loader: 'ts-loader',
},
],
},
{
test: /\.feature$/,
use: [
{
loader: '@badeball/cypress-cucumber-preprocessor/webpack',
options: config,
},
],
},
],
},
},
}), }),
) )

View File

@ -1,8 +1,10 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable import/no-relative-parent-imports */
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor' import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor'
import { loginPage } from '#pages/LoginPage' import { loginPage } from '../../pages/LoginPage'
import { welcomePage } from '#pages/WelcomePage' import { welcomePage } from '../../pages/WelcomePage'
Given('The web browser is at the login page', () => { Given('The web browser is at the login page', () => {
cy.visit('/login') cy.visit('/login')

View File

@ -2,12 +2,7 @@
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "es5",
"lib": ["es5", "dom"], "lib": ["es5", "dom"],
"types": ["cypress", "node"], "types": ["cypress", "node"]
"paths": {
"#pages/*": [
"../pages/*.ts"
]
}
}, },
"include": ["./**/*.ts"] "include": ["./**/*.ts"]
} }

View File

@ -1,13 +1,10 @@
{ {
"compilerOptions": { "compilerOptions": {
"module": "ES2020", "esModuleInterop": true,
"target": "ES2020", "module": "nodenext",
"lib": ["ES2022", "dom"], "lib": ["ES2022", "dom"],
"strict": true, "strict": true,
"types": ["cypress", "node"], "types": ["cypress", "node"]
"paths": {
"#pages/*": ["./cypress/pages/*"]
}
}, },
"include": ["**/*.ts"], "include": ["**/*.ts"],
"exclude": ["node_modules"] "exclude": ["node_modules"]