For our Cypress E2E testing we are using page-objects as below (https://github.com/OWASP/wrongsecrets/blob/master/src/test/e2e/cypress/pages/homePage.js):
export default class HomePage {
static CHALLENGE_TABLE = 'challenge-overview'
static CHALLENGE_TABLE_ROW = 'challenge-row'
static CHALLENGE_0_COMPLETED = '"challenge-0_completed-link"'
static TOTAL_SCORE = 'total-score'
}
when I run eslint9, I get:
/home/runner/work/wrongsecrets/wrongsecrets/src/test/e2e/cypress/pages/homePage.js
2:26 error Parsing error: Unexpected token =
While my eslint.config.mjs is:
import { FlatCompat } from '@eslint/eslintrc'
import mochaPlugin from 'eslint-plugin-mocha'
import globals from "globals";
const compat = new FlatCompat()
export default [
{
languageOptions: {
ecmaVersion: 2022,
sourceType: "commonjs",
globals:{
...globals.browser
}
},
},
mochaPlugin.configs.flat.recommended, {
rules: {
'mocha/no-exclusive-tests': 'error',
'mocha/no-skipped-tests': 'error',
'mocha/no-mocha-arrows': 'off'
}
},
...compat.config(
{
extends: ['plugin:cypress/recommended'],
rules: {
'cypress/no-unnecessary-waiting': 'off'
}
})
]
What is wrong with my eslint.config.mjs? How can I make Eslint accept static properties? Or are my static properties no longer defined properly? Can you please help me?