» npm install eslint-plugin-unicorn
Recently created my own eslint config and stumbled across https://github.com/sindresorhus/eslint-plugin-unicorn which has a few reasonable rules in there that have the potential to massively contribute to code quality, e.g. prefer-array-find, prefer-modern-dom-apis.
I was also unaware of https://github.com/testing-library/eslint-plugin-testing-library as well as the included eslint-plugin-jest which... should definitely have your attention if you use testing-library and/or jest.
https://github.com/benmosher/eslint-plugin-import also has import/order which may alphabetically group your imports, improving readability.
Anything else I've been missing out on?
You need to add unicorn in eslintConfig section for plugins
"plugins": [
"unicorn"
],
Reference: Usage Documentation
The accepted answer didn't work for me. After playing around with the configuration, I found the following to work:
"devDependencies": {
"xo": "^0.42.0"
},
"xo": {
"rules": {
"unicorn/prefer-module": 0
}
}
I'm using all the defaults - just not ready to change ALL my doe to modules just yet. Thought I'd share since it's a bit more concise.