THE best lint configurations for JS, React, Node, Jest and even React Native!
Stop relying on humans to write consistent and good quality JavaScript. Use jslint-configs to ensure your code is clean from common mistakes of JavaScript/React/Node and while doing that, give your developer-productivity an unfair boost!
jslint-configs support linting for the following technologies:
- JavaScript and ES6
- Node.js
- React.js (with latest React Hooks)
- React Native
💡 For quickly increasing developer's knowledge it also has respective hyperlink for each lint rule as follows:
'arrow-parens': [2, // https://eslint.org/docs/rules/arrow-parens
'as-needed',
],
- Well documented
- Extremely small bundle size:
9~11 KB
Please ensure that
eslint
is already installed in your project
- For Yarn:
yarn add --dev jslint-configs
- For NPM:
npm install --save-dev jslint-configs
The way this lint configuration is setup as follows:
- Base Configuration (Parent configuration - includes all standard JS linting rules)
- React Configuration (Inherits from Base Config - adds up all standard React.js and JSX linting rules)
- React Native Configuration (Inherits from React Config - adds up RN specific rules on top of React rules)
- Node Configuration (Inherits from Base Config - adds up all standard Node.js linting rules)
Let the picture speak a thousand words!
- Install ESLint in your project (
yarn add --dev eslint
) - Create
.eslintrc.js
at the root of your project
If you want to lint only vanilla JavaScript, extend your project's .eslintrc.js
file from config-base as follows:
module.exports = {
extends: "./node_modules/jslint-configs/index.js",
};
If you want to lint JavaScript + React.JS code, extend your project's .eslintrc.js
file from config-react as follows:
module.exports = {
extends: "./node_modules/jslint-configs/config-react.js",
};
If you want to lint JavaScript + React Native code, extend your project's .eslintrc.js
file from config-react as follows:
module.exports = {
extends: "./node_modules/jslint-configs/config-react-native.js",
};
If you want to lint JavaScript + Node.JS, extend your project's .eslintrc.js
file from config-node as follows:
module.exports = {
extends: "./node_modules/jslint-configs/config-node.js",
};
Welcome contributing!
Please use GitHub's Issues/PRs.