eslint-config-js-stack
v1.0.8
Published
ESLint and Prettier configuration for JavaScript stack, providing comprehensive and optimized setups for React and Node.js projects.
Downloads
19
Readme
Eslint Config JS Stack
ESLint and Prettier configuration for JavaScript stack, providing comprehensive and optimized setups for React and Node.js projects.
Plugins
This configuration utilizes the following ESLint plugins:
- @typescript-eslint/eslint-plugin
- @typescript-eslint/parser
- eslint-plugin-jsx-a11y
- eslint-plugin-prettier
- eslint-plugin-react
- eslint-plugin-react-hooks
- prettier
Installation
npm install eslint-config-js-stack --save-dev
Usage
To use the ESLint and Prettier configurations provided by eslint-config-js-stack, add the following to your project's ESLint configuration file:
{
"extends": "eslint-config-js-stack/react"
// "extends": "eslint-config-js-stack/node"
}
For React projects, use "eslint-config-js-stack/react" in the "extends" array. For Node.js projects, use "eslint-config-js-stack/node" in the "extends" array.
Overriding ESLint Configuration
You can add or override any ESLint configuration rules by creating your own .eslintrc.json file in your project and extending the eslint-config-js-stack configuration. Here's an example:
{
"extends": [
"eslint-config-js-stack/react",
"my-custom-config"
],
"rules": {
"my-custom-rule": "error"
}
}
In the example above, we extend both the eslint-config-js-stack/react configuration and another custom configuration called "my-custom-config". We can also add or override specific ESLint rules in the "rules" object.
Ignoring Files
To enhance the integration of ESLint and Prettier in your project, it's recommended to add .eslintignore and .prettierignore files to exclude certain files and directories from version control and code formatting. You can use the following examples on my gist as a starting point