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 webpack from '@cypress/webpack-preprocessor'
import { createEsbuildPlugin } from '@badeball/cypress-cucumber-preprocessor/esbuild'
import createBundler from '@bahmutov/cypress-esbuild-preprocessor'
import { defineConfig } from 'cypress'
const setupNodeEvents = async (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) => {
await addCucumberPreprocessorPlugin(on, config, {
omitAfterRunHandler: true,
})
async function setupNodeEvents(
on: Cypress.PluginEvents,
config: Cypress.PluginConfigOptions,
): Promise<Cypress.PluginConfigOptions> {
await addCucumberPreprocessorPlugin(on, config)
on(
'file:preprocessor',
webpack({
webpackOptions: {
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,
},
],
},
],
},
},
createBundler({
plugins: [createEsbuildPlugin(config)],
}),
)

View File

@ -1,8 +1,10 @@
/* 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 { loginPage } from '#pages/LoginPage'
import { welcomePage } from '#pages/WelcomePage'
import { loginPage } from '../../pages/LoginPage'
import { welcomePage } from '../../pages/WelcomePage'
Given('The web browser is at the login page', () => {
cy.visit('/login')

View File

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

View File

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