Home

Awesome

eslint-config

Dependency status Dev Dependency status

My own eslint configurations.

Installation

$ npm install --save-dev @satazor/eslint-config

Usage

First you need to choose the base configuration to use:

Then enhance it with one or more addons:

Finally, simply create a .eslintrc.json file with the chosen base configuration and addons. Feel free to override rules you won't agree with. You can look at some examples bellow.

Alternatively, you can make your own configuration by using the set of rules individually. If you're interested in doing that, you can check es5.js to see how it is done.

Examples

Cutting edge ES6 with modules in the browser, using react:

{
    "root": true,
    "extends": [
        "@satazor/eslint-config/es6",
        "@satazor/eslint-config/addons/es6-modules",
        "@satazor/eslint-config/addons/browser",
        "@satazor/eslint-config/addons/react"
    ]
}

Cutting edge ES6 with modules in NodeJS (requires babel or similar):

{
    "root": true,
    "extends": [
        "@satazor/eslint-config/es6",
        "@satazor/eslint-config/addons/es6-modules",
        "@satazor/eslint-config/addons/node"
    ]
}

Use ES6 in NodeJS without any transpiler:

{
    "root": true,
    "extends": [
        "@satazor/eslint-config/es6",
        "@satazor/eslint-config/addons/node"
    ]
}

.. and if you are programming against NodeJS v4 please use:

{
    "root": true,
    "extends": [
        "@satazor/eslint-config/es6",
        "@satazor/eslint-config/addons/node"
        "@satazor/eslint-config/addons/node-v4-es6"
    ]
}

Good old ES5 in NodeJS:

{
    "root": true,
    "extends": [
        "@satazor/eslint-config/es5",
        "@satazor/eslint-config/addons/node"
    ]
}

Note that by setting root to true, we ensure that no ancestor configuration is used which also improves eslint performance because no more file lookups need to be done.

File name convention

If your file exports a single class, your filename should be exactly the name of the class. For other cases, the name of the file should be the same as the default exports (prefer camelCase).

License

MIT License