1001Ferramentas
🔍Dev

ESLint Airbnb Config Generator

Generate an .eslintrc.json using the Airbnb preset, the most popular JavaScript style guide. Standardize your React and Node code and copy the config.


  

Airbnb style rules without the setup guesswork

You want the team to stop arguing about style in code review, and adopting a ready-made preset is the obvious move. The Airbnb guide is the most copied one in the JavaScript ecosystem for exactly that reason: somebody already made the calls. The tedious part is remembering the file shape, which env and parserOptions fields are required, and where React hooks support fits in.

The output extends airbnb and airbnb/hooks, sets env for browser, node and es2022, uses ecmaVersion 2022 with sourceType module, and adds two practical tweaks: no-console dropped to warn and import/prefer-default-export turned off. It is a fixed block with no options on screen. Note the shape as well: this is the legacy .eslintrc.json format, not the flat config in eslint.config.js.

That matters because ESLint 9 defaults to flat config and ignores .eslintrc unless you stay on the 8.x line. Second point: extends installs nothing. You still need eslint-config-airbnb plus its peer plugins for import, react, react-hooks and jsx-a11y. On a Node project without React, swap airbnb for airbnb-base and drop the hooks line. Generation happens locally in the browser.

Frequently asked questions

Why does ESLint not find my config?
You are probably on ESLint 9, which looks for eslint.config.js and ignores .eslintrc.json. Either pin the 8.x line or convert the file to flat config.
Which packages do I have to install?
eslint, eslint-config-airbnb and its peer plugins: eslint-plugin-import, eslint-plugin-react, eslint-plugin-react-hooks and eslint-plugin-jsx-a11y. Running npx install-peerdeps --dev eslint-config-airbnb pulls them all in at once.
Does it work for a Node project without React?
Use airbnb-base instead of airbnb and delete the airbnb/hooks line. Otherwise ESLint complains about React plugins you never installed.

Related Tools