# eslint-config-sf-cosmos

> sf-cosmos的eslint的配置

Latest version **1.1.2** (published 2020-12-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install eslint-config-sf-cosmos
pnpm add eslint-config-sf-cosmos
yarn add eslint-config-sf-cosmos
bun add eslint-config-sf-cosmos
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2020-12-22 |
| First published | 2020-12-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 13 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | renyanan |
| Maintainers | renyanan |

## Links

- npm: https://www.npmjs.com/package/eslint-config-sf-cosmos
- npm.io page: https://npm.io/package/eslint-config-sf-cosmos

## Dependencies (13)

- [eslint](https://npm.io/package/eslint.md) ^7.3.1
- [redux-saga](https://npm.io/package/redux-saga.md) ^1.1.3
- [typescript](https://npm.io/package/typescript.md) ^3.9.5
- [eslint-plugin-react](https://npm.io/package/eslint-plugin-react.md) ^7.20.0
- [eslint-config-airbnb](https://npm.io/package/eslint-config-airbnb.md) ^18.2.0
- [eslint-plugin-import](https://npm.io/package/eslint-plugin-import.md) ^2.22.0
- [eslint-plugin-jsx-a11y](https://npm.io/package/eslint-plugin-jsx-a11y.md) ^6.3.1
- [eslint-plugin-redux-saga](https://npm.io/package/eslint-plugin-redux-saga.md) ^1.1.3
- [@typescript-eslint/parser](https://npm.io/package/@typescript-eslint/parser.md) ^3.4.0
- [eslint-config-airbnb-base](https://npm.io/package/eslint-config-airbnb-base.md) ^14.2.0
- [eslint-plugin-react-hooks](https://npm.io/package/eslint-plugin-react-hooks.md) ^4.0.4
- [eslint-config-airbnb-typescript](https://npm.io/package/eslint-config-airbnb-typescript.md) ^8.0.2
- [@typescript-eslint/eslint-plugin](https://npm.io/package/@typescript-eslint/eslint-plugin.md) ^3.5.0

## Recent versions

- 1.1.2 (latest) — 2020-12-22
- 1.1.1 — 2020-12-22

## README

# eslint-config-sf-cosmos

## 基础说明

这个eslint配置文件是基于airbnb-base，@typescript-eslint的一些规则的基础上进行配置

## 如何使用

先安装对应的这个包

npm i eslint-config-sf-cosmos

安装完成之后在.eslintrc文件中的extends字段下配置上这个对应的扩展包，当然前缀eslint-config-可以省略，直接写sf-cosmos即可

```javascript
module.exports = {
    "root": true,
    "extends": ['sf-cosmos']
};
```

如果在编辑器中集成的话，我们在开发阶段就可以发现错误并改正，极大的增加了开发效率

我们需要在vscode的扩展中先安装eslint的插件

## 说明or规则

***env***

一个环境定义了一组预定义的全局变量

***Globals***

全局变量，对于全局变量，可以设置writable可重写，readonly不允许重写

***Plugins***

第三方插件，在使用的时候你要通过npm进行对应的安装

***rules***

错误级别，当然你也可以修改某个插件中对应的一些错误级别
"off" or 0 - 关闭规则
"warn" or 1 - 将规则视为一个警告（不会影响退出码）
"error" or 2 - 将规则视为一个错误 (退出码为1)

"plugin1/rule1": "2" 表示来自插件plugin1的rule1规则，注释的话使用`/* eslint "plugin1/rule1": "error" */` 这种方式

你可以使用以下的方式来进行注释或者临时禁止规则出现的警告

```javascript
/* eslint-disable */

alert('foo');

/* eslint-enable */

// 也可以对指定的规则启用或者禁用警告，当然，不推荐

/* eslint-disable no-alert, no-console */

alert('foo');
console.log('bar');

/* eslint-enable no-alert, no-console */

// 整个文件禁用警告，注意将/* eslint-disable */放在顶部

/* eslint-disable */

// 还有一些对应的说明详见https://cn.eslint.org/docs/user-guide/configuring
```

js具体的规则信息：https://cn.eslint.org/docs/rules/
ts具体的规则信息：https://github.com/typescript-eslint/typescript-eslint/tree/v2.33.0/packages/eslint-plugin/docs/rules

如有需要，可自行查找

***extends***

可共享配置，是一个npm包，可以省略包的前缀eslint-config-

---
_Source: https://npm.io/package/eslint-config-sf-cosmos · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
