Hi everyone,
The UI team just updated the eslint configurations to be based on eslint-plugin-patternfly-react.
eslint-plugin-patternfly-react is much more strict when it comes to linting configurations and it is going to help us to catch code issues.
Why we chose patternfly-react linting configurations?
- It will catch issues that developers and reviewers usually don’t notice
- Most of the people who worked with it (under the patternfly repo) liked at and reported about a good experience (It is not annoying).
- It reuses and extends the best linting configurations and plugins (standard, airbnb, prettier).
- It can fix most of the errors automatically.
- It will help us to achieve code similarity between repositories (if they will adopt it, we already have similarity with patternfly-react itself).
- We don’t need to manage and maintain configurations, we rely on a different open-source project for it.
Use it in your terminal:
# run the linter and see all the linter errors
npm run lint
# run the linter and fix errors automatically
npm run lint -- --fix
Use it in your code editor:
I strongly recommend you to install it on your editor so:
- You can see the errors live in your code
- It will automatically fix errors when you save a file
See video, how it works for me with atom:
To use it with atom you should install linter-eslint and linter packages.
If you want to see the actual rules they bring you can visit:
We do some small overrides here:
Thank you!