0.1.2 • Published 4 years ago

eslint-config-superstrict v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

eslint-config-superstrict

This is a very opinionated configuration for ESLint, heavily inspired by eslint-config-es with a few modifications and additions. It contains rules for:

  • JavaScript
  • TypeScript
  • Mocha
  • React
  • Vue.js

You don't have to do any further configuration. Just install this configuration and extend from it. It will automatically detect which packages are installed and it will enable the appropriate rules.

This configuration follows the following principles:

  • Tab size of 4 spaces
  • Single quotes before double quotes
  • camelCase before kebap_case
  • LF linebreaks
  • Strict mode

Installation

Install eslint and eslint-config-superstrict:

npm install --save-dev eslint eslint-config-superstrict

The following additional ESLint plugins are included by default, so you don't have to install them:

PluginAutomatically enabled
eslint-plugin-mochaYes
eslint-plugin-reactNo
eslint-plugin-unicornYes
eslint-plugin-vueNo
@typescript-eslint/eslint-pluginNo

To enable support for React and JSX, all you need to do is to install the react module. The appropriate rules will become enabled automatically.

To enable support for Vue.js, all you need to do is to install the vue module. The appropriate rules will become enabled automatically for .vue files.

To enable support for TypeScript, all you need to do is to install the typescript module. The appropriate rules will become enabled automatically for .ts and .tsx files. The generated configuration expects a tsconfig.json at the project root.

Usage

Create a .eslintrc.json file in your project and use the extends keyword to extend from this configuration:

{
    "extends": "superstrict"
}

If you're working on a client-side application extend from the following configuration:

{
    "extends": "superstrict/browser"
}

You can overwrite any rule by adding the appropirate rule property to your configuration file, for example:

{
    "extends": "superstrict",
    "rules": {
        "no-console": "off",
        "no-bitwise": "off"
    }
}

Versioning

This project uses SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License. See the LICENSE file for details.