Skip to content

feat: apply stylistic recommended rules to examples #966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

MikeMcC399
Copy link
Collaborator

Situation

Examples are currently stylistically linted according to @stylistic/eslint-plugin to lint styling in the repo according to the configuration in eslint.config.mjs which specifies:

    plugins: {
      '@stylistic': stylistic,
    },
    rules: {
      '@stylistic/indent': ['error', 2, { 'SwitchCase': 1, 'MemberExpression': 'off' }],
      '@stylistic/comma-dangle': ['error', 'always-multiline'],
      '@stylistic/quotes': ['error', 'single'],
      '@stylistic/semi': ['error', 'never'],

The rules marked as Recommended in eslint-plugin/rules.md are not applied as a group.

Change

  • Apply rule configuration stylistic.configs.recommended

  • Add the following rules for consistency with Cypress coding conventions:

    • '@stylistic/arrow-parens': ['error', 'always']
    • '@stylistic/space-before-function-paren': ['error', 'always']
  • Ignore also app/assets/js/todo/ as this is an imported third-party app

  • Use npx eslint --fix to auto-fix. These are white-space and quote usage changes.

  • Manually map the auto-fix changes into the app.

Test

Execute the following and confirm that no errors are reported and no changes are suggested:

git clean -xfd
npm ci
npx eslint
npm run test:ci

The following warning is a separate issue caused by transient dependencies including typescript and Cypress incorrectly assuming that this is a TypeScript project:

Couldn't find tsconfig.json. tsconfig-paths will be skipped

@cypress-app-bot
Copy link
Collaborator

@MikeMcC399 MikeMcC399 self-assigned this Jun 2, 2025
@MikeMcC399 MikeMcC399 marked this pull request as ready for review June 2, 2025 15:29
Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Need to trigger Cypress to update after these updates.

@jennifer-shehane jennifer-shehane merged commit 29a02fb into cypress-io:master Jun 3, 2025
12 checks passed
@cypress-app-bot
Copy link
Collaborator

🎉 This PR is included in version 4.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@MikeMcC399

This comment was marked as outdated.

@MikeMcC399
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants