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

Add prettier / remove prettier from eslint config #199

Closed
tobeycodes opened this issue Nov 6, 2023 · 2 comments
Closed

Add prettier / remove prettier from eslint config #199

tobeycodes opened this issue Nov 6, 2023 · 2 comments

Comments

@tobeycodes
Copy link
Member

This might be more appropriate for 10up-toolkit. I believe we should use prettier for formatting and not part of linting. I am proposing the following changes

  1. Add a prettier config to the root of wp-scaffold. The current config baked into the eslint-config can be used
  2. Add a npm command format to format the code
  3. Add format to run with husky/lint-staged on commit
  4. (future: add generic job configs for gitlab ci/github actions/circleci) that'll run this as a job with --check
  5. remove the duplicate .editorconfig in the theme and the mu-plugin

The reason I am proposing this change is that we can currently only formatting JS files. The formatting should be applied to all files in the repo that match the prettierconfig and the .editorconfig. Currently the repo does not match the editorconfig in a lot of files and that would be resolved by running prettier as it will use the prettier config and the editor config. This will fix the formatting in non JS files such as JSON, MD, etc.

@nicholasio
Copy link
Member

Opened an issue in the 10up-toolkit repo. This would be a big change and can add up to the confusion folks aready have when dealing with eslint/prettier.

@tobeycodes
Copy link
Member Author

I feel like this could potentially make things less confusing. Prettier can be explained as the tool that only formats your code and Eslint is the tool that tells you when you have a potential code smell. Thanks for opening the toolkit issue. We can close this one

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

No branches or pull requests

2 participants