eslint-config-airbnb
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
eslint-config-airbnb-base | 15.0.0 | 23.61 kB | MIT | prod | |
eslint-plugin-import | 2.29.1 | 343.75 kB | MIT | prod peer | |
eslint-plugin-jsx-a11y | 6.8.0 | 124.09 kB | MIT | prod peer | 1 1 |
eslint-plugin-react-hooks | 4.6.2 | 114.9 kB | MIT | prod peer | |
eslint-plugin-react | 7.34.1 | 789.64 kB | MIT | prod peer | |
eslint | 8.57.0 | 2.9 MB | MIT | prod peer | |
object.assign | 4.1.5 | 18.68 kB | MIT | prod | |
object.entries | 1.1.8 | 31.8 kB | MIT | prod |
The eslint-config-airbnb
is an npm package that offers Airbnb's .eslintrc configuration as a shareable, extensible configuration. Basically, it provides a set of ESLint rules that follow Airbnb's own coding style guide, including ECMAScript 6+ and React rules. This helps developers maintain quality and consistency in their JavaScript code, making it easier to read, debug and maintain the codebase. The package requires dependencies including eslint
, eslint-plugin-import
, eslint-plugin-react
, eslint-plugin-react-hooks
, and eslint-plugin-jsx-a11y
.
To use the eslint-config-airbnb
package, it needs to be installed along with its peer dependencies. The installation process varies based on the npm version and operating system you're using. Here's a common way to install using npm version 5 or above:
npx install-peerdeps --dev eslint-config-airbnb
Once installed, the configuration can be extended in your project's ESLint configuration file (.eslintrc
). For the default configuration, simply add "extends": "airbnb"
to your .eslintrc
:
{
"extends": "airbnb"
}
If you want to enable the linting rules for React Hooks, the configuration can be extended as follows:
{
"extends": ["airbnb", "airbnb/hooks"]
}
The package also offers other configurations like eslint-config-airbnb/whitespace
for linting whitespace rules and eslint-config-airbnb/base
for cases where React is not needed.
The official documentation of eslint-config-airbnb
, including the usage instructions, linting rules, and other details can be found in the README file of the GitHub repository at https://github.com/airbnb/javascript
. You can also refer to Airbnb's JavaScript style guide at https://github.com/airbnb/javascript
and the ESLint config docs at https://eslint.org/docs/user-guide/configuring#extending-configuration-files
for additional information and usage guidelines.