README
eslint-config-bucketplace
ESlint shareable config for
bucketplace
ESLint rules for bucketplace projects.
Install
This will install all the dependencies required to use bucketplace ESLint config.
$ npm install --save-dev eslint @bucketplace/eslint-config-bucketplace @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-plugin-react
Usage
Add extends field to .eslintrc (create one if you haven't already):
{
"extends": [
"@bucketplace/eslint-config-bucketplace",
"@bucketplace/eslint-config-bucketplace/react",
"@bucketplace/eslint-config-bucketplace/typescript"
]
}
Or if you prefer package.json:
{
"eslintConfig": {
"extends": [
"@bucketplace/eslint-config-bucketplace",
"@bucketplace/eslint-config-bucketplace/react",
"@bucketplace/eslint-config-bucketplace/typescript"
]
}
}
Available configs
You can use those configs in combination with the base config. All other configs are meant to be used with @bucketplace/eslint-config-bucketplace config.
{
"extends": [
"@bucketplace/eslint-config-bucketplace",
"@bucketplace/eslint-config-bucketplace/node",
"@bucketplace/eslint-config-bucketplace/react",
"@bucketplace/eslint-config-bucketplace/typescript"
]
}
@bucketplace/eslint-config-bucketplace- The base config for JavaScript projects.@bucketplace/eslint-config-bucketplace/node- The config for Node.js environments.@bucketplace/eslint-config-bucketplace/react- The config for React projects with support for JSX.@bucketplace/eslint-config-bucketplace/typescript- The config for TypeScript projects.
Tips
Browser environment
If you are on browser environment, you may want to add browser option to env field in order to support browser-specific language features:
Please read this issue for more details.
{
"env": {
"browser": true
}
}
Globals
Sometimes you need to have global variables for special cases (e.g. refering external libraries). In this case, you can configure global variables inside of your config file, set globals property to an object containing keys named for each of the global variables you want to use. This will prevent ESLint from complaining about the use of global variables. It basically tells ESLint that "these variables are populated in global already, so do not warn about their usage".
{
"globals": {
"