💎 eslint configuration
Previously I kept my ESLint configuration in my dotfiles repository. But I'm a lazy developer, and I got tired of opening up GitHub, navigating to the repository, finding the file, and copy / pasting it to each new project I started. So I made my entire ESLint configuration an npm package and published it!
🔌 plugins
Beyond setting all of the basic rules, I've also included a few plugins in my configuration.
eslint-plugin-jsx-a11y
eslint-plugin-react
eslint-plugin-react-hooks
As I'm primarily a React developer, these plugins help me with basic linting and the new rules of hooks. Additionally, the jsx-a11y
plugin nags me to write more accessible HTML.
💋 no prettier
As some of you may have noticed, this configuration does not include Prettier. I've intentionally kept my Prettier and ESLint configurations separate. I came to this conclusion because ESLint only applies to JavaScript, whereas Prettier can format multiple languages, so I didn't think it made sense to bundle them together.
👨🏼🏫 usage
First, install the configuration with command below. This not only installs the ESLint configuration, but all peer dependencies as well (like ESLint and the plugins).
Next, create a .eslintrc
file in the root of your project and instruct it to extend the bradgarropy
configuration.
You should now be good to go! If you wish to further customize the configuration, you can edit your .eslintrc
and add more settings.
If you run into any trouble, create an issue and I'll take a look! And if you like it, give it a ⭐.