Skip to content
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

@wordpress/eslint-plugin not adding spaces #47794

Open
John-H-Smith opened this issue Feb 6, 2023 · 1 comment
Open

@wordpress/eslint-plugin not adding spaces #47794

John-H-Smith opened this issue Feb 6, 2023 · 1 comment
Labels
[Tool] ESLint plugin /packages/eslint-plugin [Tool] Prettier config /packages/prettier-config [Type] Enhancement A suggestion for improvement.

Comments

@John-H-Smith
Copy link

John-H-Smith commented Feb 6, 2023

Description

Withing brackets, there should be spaces according to the coding standards for javascript.
Example: var arr = [ 9, 4, 15 ];

With @wordpress/eslint-plugin and @wordpress/prettier-config installed, it still gives that error:
error Replace '·9,·4,·15·' with '9,·4,·15' prettier/prettier

Step-by-step reproduction instructions

  1. Set up a type: module node application
  2. Install eslint, prettier, @wordpress/eslint-plugin and @wordpress/prettier-config using npm
  3. Append "prettier": "@wordpress/prettier-config" to your package.json
  4. Create a .eslintrc.json in your root and fill it with the content:
{
    "env": {
        "browser": true,
        "es2021": true
    },
    "parserOptions": {
        "ecmaVersion": "latest",
        "sourceType": "module"
    },
    "extends": [
        "plugin:@wordpress/eslint-plugin/recommended"
    ]
}
  1. Run npx eslint <filename>

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@gziolo gziolo added the [Tool] Prettier config /packages/prettier-config label Feb 7, 2023
@gziolo
Copy link
Member

gziolo commented Feb 7, 2023

It might be the same issue with using the official Prettier vs WP fork in the @wordpress/eslint-plugin to enforce WordPress JavaScript coding standards as discussed in #21872.

@gziolo gziolo added the [Tool] ESLint plugin /packages/eslint-plugin label Feb 7, 2023
@kathrynwp kathrynwp added the [Type] Enhancement A suggestion for improvement. label Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Tool] ESLint plugin /packages/eslint-plugin [Tool] Prettier config /packages/prettier-config [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants