Skip to content

fix(stylistic): apply javascript formatting conventions #262

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

@MikeMcC399 MikeMcC399 commented May 30, 2025

Situation

JavaScript code linting for consistent formatting is not implemented in this repo.

Comparison

@stylistic/eslint-plugin has already been implemented in the following repos:

In cypress-docker-images and github-action the following rules are already being applied, in addition to the recommended rules stylistic.configs.recommended from the plugin:

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

Change

  • Add linting using @stylistic/eslint-plugin using stylistic.configs.recommended and the following explicitly applied rules:

    '@stylistic/arrow-parens': ['error', 'always'],
    '@stylistic/indent': ['error', 2],
    '@stylistic/comma-dangle': ['error', 'always-multiline'],
    '@stylistic/quotes': ['error', 'single'],
    '@stylistic/semi': ['error', 'never'],
  • Use npx eslint --fix to conform to formatting rules.

  • Manually fix @stylistic/no-mixed-operators

Verify

npm ci
npm run lint
npm test

and confirm that no linting errors are reported, no changes are made, and that tests continue to work.

@cypress-app-bot
Copy link

@MikeMcC399 MikeMcC399 self-assigned this May 30, 2025
@MikeMcC399 MikeMcC399 marked this pull request as ready for review May 30, 2025 06:07
@MikeMcC399 MikeMcC399 marked this pull request as draft May 30, 2025 11:35
@MikeMcC399 MikeMcC399 force-pushed the add/stylistic-recommended branch from 1bd285c to f132352 Compare May 30, 2025 11:41
@MikeMcC399 MikeMcC399 marked this pull request as ready for review May 30, 2025 11:42
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.

Nice, much cleaner!

@jennifer-shehane jennifer-shehane merged commit bbd33fd into cypress-io:master May 30, 2025
10 checks passed
@jennifer-shehane
Copy link
Member

🎉 This PR is included in version 5.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@MikeMcC399 MikeMcC399 deleted the add/stylistic-recommended branch May 30, 2025 16:04
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