# eslint-plugin-chinese-check

> 检查变量字符串中是否包含未转换的简体中文(或繁体), 可自动修复；检查变量中是否存在中文字符串；检查1个中文有多个繁体的情况

Latest version **0.2.4** (published 2024-05-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-chinese-check
pnpm add eslint-plugin-chinese-check
yarn add eslint-plugin-chinese-check
bun add eslint-plugin-chinese-check
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.4 |
| Published | 2024-05-18 |
| First published | 2022-12-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 37.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | chinese-check |
| Maintainers | greendev |
| Keywords | eslint, eslintplugin, eslint-plugin |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-chinese-check
- Repository: https://github.com/pjpv/eslint-plugin-chinese-check
- Homepage: https://github.com/pjpv/eslint-plugin-chinese-check#readme
- Issues: https://github.com/pjpv/eslint-plugin-chinese-check/issues
- npm.io page: https://npm.io/package/eslint-plugin-chinese-check

## Dependencies (2)

- [contains-chinese](https://npm.io/package/contains-chinese.md) ^1.0.0
- [vue-eslint-parser](https://npm.io/package/vue-eslint-parser.md) ^5.0.0

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 0.2.4 (latest) — 2024-05-18
- 0.2.3 — 2024-05-18
- 0.2.2 — 2022-12-08
- 0.2.1 — 2022-12-05
- 0.2.0 — 2022-12-05
- 0.1.4 — 2022-12-05
- 0.1.3 — 2022-12-05
- 0.1.2 — 2022-12-05
- 0.1.1 — 2022-12-02
- 0.1.0 — 2022-12-02
- 0.0.3 — 2022-12-02
- 0.0.2 — 2022-12-01

## README

# eslint-plugin-chinese-check

检查变量字符串中是否包含未转换的简体中文(或繁体), 可自动修复；
检查变量中是否存在中文字符串；


## Installation

You'll first need to install [ESLint](https://eslint.org/):

```sh
npm i eslint --save-dev
```

Next, install `eslint-plugin-chinese-check`:

```sh
npm install eslint-plugin-chinese-check --save-dev
```

## Usage

Add `chinese-check` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:

```json
{
    "plugins": [
        "chinese-check"
    ]
}
```

## 1.chinese-check

Then configure the rules you want to use under the rules section.

```javascript
{
    "rules": {
        "chinese-check/chinese-check": 1 // [1, "S"]
    }
}

// 正確
const a = '簡體字轉繁體字'
// 錯誤
const a = '简体字转繁体字'
```

or

```javascript
{
    "rules": {
        "chinese-check/chinese-check": [1, "T"]
    }
}

// 正確
const a = '繁体字转简体字'
// 錯誤
const a = '繁體字轉簡體字'
```

> 一简对多繁等问题需自行处理

可使用一下方法忽略某一行
```js
/* eslint-disable-next-line chinese-check/chinese-check */
const a = "简体字"
```


## 2.contains

```.eslintrc.js```

```javascript
{
    overrides: [
        {
            files: [
                'src/locales/lang/en-US/**/*',
            ],
            rules: {
                'chinese-check/contains': 1
            }
        }
    ]
}
```
## 3.multiple
檢查1個中文有多個繁體的情況

```.eslintrc.js```

```javascript
{
    "rules": {
        "chinese-check/multiple": 1
    }
}
```

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