eslint-config-sto

1.1.3 • Public • Published

STO eslint

基于airbnb-base、 prettier、 自定义三种规范生成eslint config,自动加载ts的lint规则,并且与prettier插件集成。

Usage

1. 安装

先删除项目中所有的eslint和prettier dependencies,避免重复安装

npm install eslint-config-sto -S -D

2. 添加.eslintrc.js(需安装eslint插件)

module.exports = {
  extends: ['eslint-config-sto/react'],
};

3. 添加.prettierrc.yaml(需安装prettier插件,建议卸载其它的代码格式化插件)

# .prettierrc or .prettierrc.yaml
trailingComma: "all"
semi: true
singleQuote: true
printWidth: 100

4. 添加.editorconfig

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
indent_size = 4
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
indent_size = 4

⚠️注意

添加 typeScript 和 tsconfig.json会在下次打开vscode的时候开启tslints。

Readme

Keywords

Package Sidebar

Install

npm i eslint-config-sto

Weekly Downloads

3

Version

1.1.3

License

UNLICENSE

Unpacked Size

8.65 kB

Total Files

7

Last publish

Collaborators

  • zhiqiangx