# @jianghe/sand-lint

> sand项目的lint统一规范

Latest version **2.1.5** (published 2021-07-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jianghe/sand-lint
pnpm add @jianghe/sand-lint
yarn add @jianghe/sand-lint
bun add @jianghe/sand-lint
```

## 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 | 2.1.5 |
| Published | 2021-07-10 |
| First published | 2020-05-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 15 |
| Unpacked size | 17.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jianghe |
| Keywords | sand-lint |

## Links

- npm: https://www.npmjs.com/package/@jianghe/sand-lint
- Repository: https://github.com/372623460jh/sand
- Homepage: https://github.com/372623460jh/sand#readme
- Issues: https://github.com/372623460jh/sand/issues
- npm.io page: https://npm.io/package/@jianghe/sand-lint

## Dependencies (15)

- [prettier](https://npm.io/package/prettier.md) 2.3.2
- [typescript](https://npm.io/package/typescript.md) 3.9.7
- [babel-eslint](https://npm.io/package/babel-eslint.md) 10.1.0
- [stylelint-scss](https://npm.io/package/stylelint-scss.md) 3.19.0
- [eslint-plugin-react](https://npm.io/package/eslint-plugin-react.md) 7.24.0
- [eslint-config-airbnb](https://npm.io/package/eslint-config-airbnb.md) 18.2.1
- [eslint-plugin-import](https://npm.io/package/eslint-plugin-import.md) 2.23.4
- [eslint-config-prettier](https://npm.io/package/eslint-config-prettier.md) 8.3.0
- [eslint-plugin-jsx-a11y](https://npm.io/package/eslint-plugin-jsx-a11y.md) 6.4.1
- [eslint-plugin-prettier](https://npm.io/package/eslint-plugin-prettier.md) 3.4.0
- [@typescript-eslint/parser](https://npm.io/package/@typescript-eslint/parser.md) 3.7.1
- [eslint-plugin-react-hooks](https://npm.io/package/eslint-plugin-react-hooks.md) 4.2.0
- [eslint-import-resolver-alias](https://npm.io/package/eslint-import-resolver-alias.md) 1.1.2
- [@commitlint/config-conventional](https://npm.io/package/@commitlint/config-conventional.md) 12.1.4
- [@typescript-eslint/eslint-plugin](https://npm.io/package/@typescript-eslint/eslint-plugin.md) 3.7.1

## 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

- 2.1.5 (latest) — 2021-07-10
- 2.1.3 — 2021-07-06
- 2.1.2 — 2021-03-27
- 2.1.1 — 2021-01-09
- 2.1.0 — 2020-12-27
- 2.0.1-0 — 2020-12-27
- 2.0.0-1 — 2020-10-18
- 2.0.0-0 — 2020-10-17
- 1.3.0 — 2020-10-17
- 1.2.4 — 2020-09-23
- 1.2.4-0 — 2020-09-19
- 1.2.3 — 2020-09-19
- 1.2.3-12 — 2020-08-23
- 1.2.3-11 — 2020-08-15
- 1.2.3-10 — 2020-08-02
- … 73 more at https://npm.io/package/@jianghe/sand-lint/versions

## README

# sand 项目的 lint 统一规范.

## 简介

> 该包中提供了如下功能

- eslint
  - react(js)
  - react(js)+prettier
  - node(js)
  - node(js)+prettier
  - typescript
  - typescript+prettier
  - vue(TODO:)
- stylelint
- commitlint

## 使用

```
npm i @jianghe/sand-lint --save
```

### eslint

#### 1. react

- 安装依赖.

  1. eslint
  2. @jianghe/sand-lint

- 配置.eslintrc.js

```
module.exports = {
  extends: require.resolve('@jianghe/sand-lint/react'),
  rules: {},
};
```

#### 2. react + prettier

- 安装 Prettier Formatter for Visual Studio Code 插件

- 安装依赖

  1. eslint
  2. @jianghe/sand-lint

- 配置.eslintrc.js

```
module.exports = {
  extends: require.resolve('@jianghe/sand-lint/react/prettier'),
  rules: {},
};
```

- 配置.prettierrc.js

```
const prettierConfig = require('@jianghe/sand-lint/prettier');
// 代码格式化配置
module.exports = prettierConfig;
```

#### 3. typescript

- 安装依赖

  1. eslint
  2. @jianghe/sand-lint

- 配置.eslintrc.js

```
module.exports = {
  extends: require.resolve('@jianghe/sand-lint/typescript'),
  rules: {},
};
```

#### 4. typescript + prettier

- 安装 Prettier Formatter for Visual Studio Code 插件

- 安装依赖

  1. eslint
  2. @jianghe/sand-lint

- 配置.eslintrc.js

```
module.exports = {
  extends: require.resolve('@jianghe/sand-lint/typescript/prettier'),
  rules: {},
};
```

- 配置.prettierrc.js

```
const prettierConfig = require('@jianghe/sand-lint/prettier/typescript');
// 代码格式化配置
module.exports = prettierConfig;
```

#### 5.node

- 安装依赖

  1. eslint
  2. @jianghe/sand-lint

- 配置.eslintrc.js

```
module.exports = {
  extends: require.resolve('@jianghe/sand-lint/node'),
  rules: {},
};
```

#### 6. node + prettier

- 安装 Prettier Formatter for Visual Studio Code 插件

- 安装依赖

  1. eslint
  2. @jianghe/sand-lint

- 配置.eslintrc.js

```
module.exports = {
  extends: require.resolve('@jianghe/sand-lint/node/prettier'),
  rules: {},
};
```

- 配置.prettierrc.js

```
const prettierConfig = require('@jianghe/sand-lint/prettier');
// 代码格式化配置
module.exports = prettierConfig;
```

#### 7. vue 项目

TODO:

### stylelint

#### 配置

- 安装依赖

  1. stylelint
  2. @jianghe/sand-lint

- 配置 .stylelintrc.js

```
module.exports = {
  extends: require.resolve('@jianghe/sand-lint/style'),
  rules: {},
};
```

### commitlint

#### 配置

- 安装依赖

  1. @commitlint/cli
  2. husky
  3. @jianghe/sand-lint

- 配置 commitlint.config.js

```
module.exports = { extends: ['@jianghe/sand-lint/commitlint'] };
```

- 配置 package.json

```
{
  // ...
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
  },
  // ...
}
```

---
_Source: https://npm.io/package/@jianghe/sand-lint · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
