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

ci: drop "eslint-plugin-prettier" dependency #445

Closed
justinmk opened this issue Nov 15, 2024 · 1 comment
Closed

ci: drop "eslint-plugin-prettier" dependency #445

justinmk opened this issue Nov 15, 2024 · 1 comment
Labels
dependencies Pull requests that update a dependency file enhancement feature help wanted

Comments

@justinmk
Copy link
Member

justinmk commented Nov 15, 2024

Problem

raised in #437 (comment) by @mikavilpas

[prettier] being run as part of eslint is an older way and nowadays not recommended.

And https://prettier.io/docs/en/integrating-with-linters.html confirms that. Instead it recommends running prettier --check explicitly.

Proposal

drop the "eslint-plugin-prettier" dependency if (and only if) we can achieve the same functionality we have today, which is that we have one "lint" task and one way to auto-fix lint issues.

  • one npm run lint command that runs prettier --check + eslint
  • one npm run fixlint command that fixes prettier issues + eslint issues
@justinmk justinmk added dependencies Pull requests that update a dependency file enhancement feature help wanted labels Nov 15, 2024
mikavilpas added a commit to mikavilpas/neovim-node-client that referenced this issue Nov 17, 2024
- `npm run lint` now checks formatting with prettier and eslint
- `npm run fixlint` now fixes formatting with `prettier --write` and `eslint --fix`
- lint-staged also uses `npm run fixlint` to keep things consistent
- ci seems to already check formatting with prettier and eslint
- added jsdoc type hints to the eslintrc.js file for autocompletion

Eslint now uses a blocklist instead of allowlist for ignoring files. It might be easier to not
accidentally ignore any new files with this approach.

Solves neovim#445
mikavilpas added a commit to mikavilpas/neovim-node-client that referenced this issue Nov 17, 2024
- `npm run lint` now checks formatting with prettier and eslint
- `npm run fixlint` now fixes formatting with `prettier --write` and `eslint --fix`
- lint-staged also uses `npm run fixlint` to keep things consistent
- ci seems to already check formatting with prettier and eslint
- added jsdoc type hints to the eslintrc.js file for autocompletion

Eslint now uses a blocklist instead of allowlist for ignoring files. It might be easier to not
accidentally ignore any new files with this approach.

Solves neovim#445
@justinmk
Copy link
Member Author

#447

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement feature help wanted
Projects
None yet
Development

No branches or pull requests

1 participant