@udea-io/eslint-config
v0.1.12
Published
A shareable ESLint configuration
Downloads
3
Readme
udea-io Eslint Config
ESLint shareable config
@udea-io/eslint-config is a shareable configuration package for eslint built on top of eslint-airbnb-config and modified to meet udea-io's own standards.
Installation
- Install all peer dependencies
npx install-peerdeps --dev @udea-io/eslint-config
- Install @udea-io/eslint-config as a development dependency of your project:
npm install @udea-io/eslint-config --save-dev
Available Configs
@udea-io/eslint-config
The default export contains common rules that are not specific to any framework or environment.
// eslintrc.js
module.exports = {
extends: ['@udea-io/eslint-config'],
};
@udea-io/eslint-config/react
Extends @udea-io/eslint-config
adding specific rules to React.
npm install --save-dev eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks eslint-import-resolver-babel-plugin-root-import
// eslintrc.js
module.exports = {
extends: ['@udea-io/eslint-config/react'],
};
@udea-io/eslint-config/react-native
Extends @udea-io/eslint-config
adding specific rules to React Native.
npm install --save-dev eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks @react-native-community/eslint-config @react-native-community/eslint-plugin eslint-plugin-react-native babel-plugin-root-import eslint-import-resolver-babel-plugin-root-import
// eslintrc.js
module.exports = {
extends: ['@udea-io/eslint-config/react-native'],
};
@udea-io/eslint-config/node
Extends @udea-io/eslint-config
adding specific rules to Node.js.
// eslintrc.js
module.exports = {
extends: ['@udea-io/eslint-config/node'],
};
@udea-io/eslint-config/mocha
Adds specific rules for the mocha
testing framework.
This rule requires installing eslint-plugin-mocha
npm install --save-dev eslint-plugin-mocha
// eslintrc.js
module.exports = {
extends: ['@udea-io/eslint-config/node', '@udea-io/eslint-config/mocha'],
};
Usage
In order to use this config, choose the one you want and add this configuration to your package.json
:
{
"eslintConfig": {
"extends": "@udea-io/eslint-config"
}
}
Or add a .eslintrc.js
file to your project root containing:
module.exports = {
extends: ['@udea-io/eslint-config'],
};
VSCode integration
We recommend turning on VSCode settings to automatically run eslint --fix
on save.
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
}
This will automagically format your code once you save. You don't need VSCode prettier extension enabled or running on
save as eslint will automatically run prettier
for you.