eslint-config-edusoho

edusoho的eslint自定义配置

Usage no npm install needed!

<script type="module">
  import eslintConfigEdusoho from 'https://cdn.skypack.dev/eslint-config-edusoho';
</script>

README

eslint-config-edusoho

中文

Installation

// npm
$ npm install --save-dev eslint eslint-config-edusoho

// yarn
$ yarn add -D eslint eslint-config-edusoho

Basic usage

Once the eslint-config-edusoho package is installed, you can use it by seting the extends section of your ESLint configuration as edusoho

{
  "extends": "edusoho",
  "rules": {
    // Additional, per-project rules...
  }
}

【Recommend to use】Using the edusoho config with eslint:recommended

There are some default rules in the eslint:recommended that Edusoho's do not cantain

To use Edusoho style with ESLint's recommended, extending them both, making sure to list edusoho last:

{
  "extends": ["eslint:recommended", "edusoo"],
  "rules": {
    // Additional, per-project rules...
  }
}

custom setting

If you don't want to use the default rules, specifying rules what you want in the [rules] section of your [Eslint], which will replace the style of [extends].

{
  "extends": ["eslint:recommended", "edusoo"],
  "rules": {
    "camelcase": 0,
    "max-len": [2, { code: 120 }],
    "no-tabs": 0,
    "quotes": [2, "single"],
  }
}