# tslint-config-ali

> An TSLint Shareable Config for Ali

Latest version **0.2.5** (published 2020-10-12) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install tslint-config-ali
pnpm add tslint-config-ali
yarn add tslint-config-ali
bun add tslint-config-ali
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.5 |
| Published | 2020-10-12 |
| First published | 2018-12-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 26.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Damujiangr |
| Maintainers | atool, damujiangr, test_zy |
| Keywords | tslint, config, ali |

## Links

- npm: https://www.npmjs.com/package/tslint-config-ali
- npm.io page: https://npm.io/package/tslint-config-ali

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [tsutils](https://npm.io/package/tsutils.md) ^3.5.2
- [tslint-react](https://npm.io/package/tslint-react.md) ^4.0.0

## Alternatives

- [@regle/core](https://npm.io/package/@regle/core.md) — 47.0K weekly downloads
- [typeof-arguments](https://npm.io/package/typeof-arguments.md) — 12.5K weekly downloads
- [@lokalise/projects-engine-contracts](https://npm.io/package/@lokalise/projects-engine-contracts.md) — 978 weekly downloads
- [@osjwnpm/nam-laboriosam-quibusdam](https://npm.io/package/@osjwnpm/nam-laboriosam-quibusdam.md) — 70 weekly downloads
- [@oridune/validator](https://npm.io/package/@oridune/validator.md) — 16 weekly downloads

## Recent versions

- 0.2.5 (latest) — 2020-10-12
- 0.1.0 (beta) — 2019-03-28
- 0.2.4 — 2019-05-09
- 0.2.3 — 2019-05-09
- 0.2.2 — 2019-05-09
- 0.2.1 — 2019-04-16
- 0.2.0 — 2019-04-16
- 0.0.1-beta.1 — 2018-12-26

## README

> 注意：本包已废弃（由于 [TSLint](https://palantir.github.io/tslint/) 被已废弃并迁移至 ESLint），请使用 [eslint-config-ali/typescript](https://www.npmjs.com/package/eslint-config-ali) 替代

## Usage

#### 1.依赖说明

本包依赖 [typescript](https://www.npmjs.com/package/typescript)、[tslint](https://www.npmjs.com/package/tslint)、[tslint-react](https://www.npmjs.com/package/tslint-react)

#### 2. 安装

```sh
npm install --save-dev tslint-config-ali
```

#### 3. `tslint.json` 文件
支持的包
  + `tslint-config-ali` or `tslint-config-ali/es6`: ES6 相关语法规则 
  + `tslint-config-ali/react`: React 相关语法规则（包含 ES6 相关语法规则）
  + `tslint-config-ali/es5`: ES5 相关语法规则
  + `tslint-config-ali/common`: 一些通用的语法规则，通常作为内部依赖包，不建议在项目中直接引用

找到工程的 `tslint.json` 以使用本包提供的 tslint 配置：

```json
{
  "extends": ["tslint-config-ali"]
}
```

#### 4. 自定义实现的规则
> 均未开启，需要手动开启
1. `common/aliI18NRule`：检测代码中的中文，防止国际化时遗漏
1. `es6/aliMethodLengthRule`：检测文件箭头函数的长度, 超过一定长度时, 给与相关提示。 控制代码行数,提高代码可阅读性。
1. `es6/aliVariableStatementPositionRule`：检测类前面定义的变量长度，超过一定值时，提醒放到类定义后面，提高diamante的阅读性
1. `react/aliKeyRule`：检测 react map 迭代 是否有 key, 如果没有, 给与相关提示， 防止没有 key 造成的数据没有重新渲染

#### 5. 开发说明
1. 自定义的 Rule，可以按照分类放在对应的目录中
```
rules
  ├── common
  ├── es5
  ├── es6
  └── react
```

1. 入口文件为 `src/rules` 下的 json 文件，目前有 
  + `common.json`
  + `es5.json`
  + `es6.json 别名 index.json`
  + `react.json`

1. 命令行
  + 构建命令：`npm run build`
  + 发布命令：`npm publish build/`，**注意只发布 build 下的内容**

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