* fix: address PR #85 package.json review feedback (issue #95) * fix: add trailing commas to cypress.config.js for comma-dangle rule ESLint comma-dangle rule (always-multiline) requires trailing commas on the last property and closing brace of multiline objects. Adding lint:js coverage of cypress.config.js in package.json exposed these two missing trailing commas at lines 15 and 16. * fix: resolve ESLint errors blocking CI on PR #103 - Remove 'cypress/globals' env key from .eslintrc.js; this key requires eslint-plugin-cypress to be globally installed, which CI tools (Codacy, CodeFactor) do not have. Cypress globals are already declared explicitly in the globals block, making the env key redundant. - Remove trailing commas from cypress.config.js to comply with the comma-dangle: never ESLint rule defined in .eslintrc.js. - Update package-lock.json to include stylelint and stylelint-config-standard which were in devDependencies but missing from the lock file.
51 lines
1.0 KiB
JavaScript
51 lines
1.0 KiB
JavaScript
module.exports = {
|
|
env: {
|
|
browser: true,
|
|
es2021: true,
|
|
node: true
|
|
},
|
|
extends: [
|
|
'eslint:recommended'
|
|
],
|
|
plugins: [
|
|
'cypress'
|
|
],
|
|
parserOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module'
|
|
},
|
|
rules: {
|
|
'comma-dangle': ['error', 'always-multiline'],
|
|
'no-console': 'warn',
|
|
'no-unused-vars': 'warn'
|
|
},
|
|
overrides: [
|
|
{
|
|
// cypress.config.js uses CommonJS (require/module.exports).
|
|
// Override sourceType to 'script' so ESLint does not flag require as undefined.
|
|
files: ['cypress.config.js', 'cypress.config.cjs'],
|
|
parserOptions: {
|
|
sourceType: 'script'
|
|
},
|
|
env: {
|
|
node: true
|
|
}
|
|
}
|
|
],
|
|
globals: {
|
|
cy: 'readonly',
|
|
Cypress: 'readonly',
|
|
describe: 'readonly',
|
|
it: 'readonly',
|
|
expect: 'readonly',
|
|
beforeEach: 'readonly',
|
|
afterEach: 'readonly',
|
|
before: 'readonly',
|
|
after: 'readonly',
|
|
jQuery: 'readonly',
|
|
wpstData: 'readonly',
|
|
wpstModalData: 'readonly',
|
|
wp: 'readonly'
|
|
}
|
|
};
|