This project aims to provide guideline to be followed by JS projects in order to achieve coherent state of code. Configuration provided here differentiates between Production and Development environments to make fast debugging more pleasant, but at the same time to ensure code quality and readability are persisted.
Since most of our JS applications are build in React.js the basic setup extends the recommended setup of eslint-plugin-react as well as recommended options provided by eslint compiler itself.
In order to provide more complex code checking, these plugins are emplyed to help:
- eslint-plugin-import (docs): enhancement of import statement checking
- eslint-plugin-jsx-a11y (docs): checker of HTML elements in JSX files
- eslint-plugin-react (docs): react specific utility checks
To make your project work using configuration in this project, you should install these plugins into your DevDependencies (npm install -D <plugin_name>)
To use different kind of configuration for distinct environments you should include specific configuration to your environment-specific webpack configuration rules:
module: {
rules: [
{
enforce: 'pre',
test: /\.jsx?$/,
use: [
{
loader: 'eslint-loader',
options: {
configFile: path.join(BASE_PATH, '.eslintrc-dev.json')
}
}
],
exclude: /(node_modules)/
},
]
}