@kubajastrz/eslint-config-airbnb
v1.0.0
Published
Airbnb-based eslint config supporting TypeScript & Prettier out-of-the-box
Downloads
3
Readme
@kubajastrz/eslint-config-airbnb
Features
Current list of supported features:
- Eslint configuration basing on Airbnb preset for React
- Support for TypeScript* & Prettier out-of-the-box
- Optional preset for Jest test runner
- Extended
airbnb/base
, if you don't use React
* Important: Using Typescript is required for now.
Usage
Install the configuration and required dependencies with install-peerdeps
:
npx install-peerdeps --dev @kubajastrz/eslint-config-airbnb
You can now add the presets of choice to your Eslint configuration file.
React
// .eslintrc.js
module.exports = {
extends: ['@kubajastrz/eslint-config-airbnb', '@kubajastrz/eslint-config-airbnb/jest'],
parserOptions: {
project: './tsconfig.json',
},
};
Create React App
Projects basing on create-react-app require different preset, due to
its annoying nature in v4.0.
This configuration turns every rule with "error"
severity to "warn"
to workaround this problem.
// .eslintrc.js
module.exports = {
extends: [
'@kubajastrz/eslint-config-airbnb/create-react-app',
'@kubajastrz/eslint-config-airbnb/jest',
],
parserOptions: {
project: './tsconfig.json',
},
};
Base (no React)
You can also use the base preset, which extends from eslint-config-airbnb/base
, if you don't use
React in your project.
// .eslintrc.js
module.exports = {
extends: ['@kubajastrz/eslint-config-airbnb/base', '@kubajastrz/eslint-config-airbnb/jest'],
parserOptions: {
project: './tsconfig.json',
},
};