# shaw-lint

> Eslint + Prettier + Typescript

Latest version **3.1.0** (published 2022-08-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install shaw-lint
pnpm add shaw-lint
yarn add shaw-lint
bun add shaw-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 | 3.1.0 |
| Published | 2022-08-28 |
| First published | 2022-04-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 21.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | cxshaw |
| Maintainers | konggu0328 |
| Keywords | eslint, prettier |

## Links

- npm: https://www.npmjs.com/package/shaw-lint
- Homepage: https://github.com/cxshaw/shaw-lint/issues
- Issues: https://github.com/cxshaw/shaw-lint.git
- npm.io page: https://npm.io/package/shaw-lint

## Dependencies (9)

- [prettier](https://npm.io/package/prettier.md) ^2.7.1
- [eslint-config-ali](https://npm.io/package/eslint-config-ali.md) ^11.4.1
- [eslint-plugin-react](https://npm.io/package/eslint-plugin-react.md) ^7.31.1
- [eslint-config-prettier](https://npm.io/package/eslint-config-prettier.md) ^8.5.0
- [eslint-plugin-jsx-a11y](https://npm.io/package/eslint-plugin-jsx-a11y.md) ^6.6.1
- [eslint-plugin-prettier](https://npm.io/package/eslint-plugin-prettier.md) ^4.2.1
- [eslint-plugin-spellcheck](https://npm.io/package/eslint-plugin-spellcheck.md) ^0.0.19
- [eslint-plugin-react-hooks](https://npm.io/package/eslint-plugin-react-hooks.md) ^4.6.0
- [eslint-plugin-simple-import-sort](https://npm.io/package/eslint-plugin-simple-import-sort.md) ^7.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
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 3.1.0 (latest) — 2022-08-28
- 3.0.5 — 2022-08-28
- 3.0.4 — 2022-08-28
- 3.0.3 — 2022-08-28
- 3.0.2 — 2022-08-28
- 3.0.1 — 2022-08-28
- 3.0.0 — 2022-08-28
- 2.0.0 — 2022-08-28
- 1.0.4 — 2022-08-28
- 1.0.3 — 2022-08-28
- 1.0.2 — 2022-08-28
- 1.0.1 — 2022-08-21
- 1.0.0 — 2022-04-04

## README

# shaw-lint

# Warning

### This tool will no longer be updated, if you need to use it, please install V1, V3 is not available now


## introduction

shaw-lint integrates `ESLint + PretTier` for code check and format, now supports `React/Vue/Node + typescript`.

## usage

### install

``` bash
npm install eslint typescript prettier yorkie shaw-lint -D

// or yarn

yarn add eslint typescript prettier yorkie shaw-lint -D
```

### eslint config

1、reeact + typescript

``` typescript
module.exports = {
  extends: [require.resolve('shaw-lint/react')],
  rules: {},
};
```

2、vue + typescript

``` typescript
module.exports = {
  extends: [require.resolve('shaw-lint/vue')],
  rules: {},
};
```

3、node + typescript

``` typescript
module.exports = {
  extends: [require.resolve('shaw-lint/node')],
  rules: {},
};
```

### git hooks

####  install packages

``` bash
npm i lint-staged husky -D
// or yarn
yarn add lint-staged husky -D
```

#### package.json config

1. react

``` json
{
  "scripts": {
    "lint": "eslint 'src/**/*.{js,jsx,tsx,ts}' --cache",
    "lint:fix": "eslint 'src/**/*.{js,jsx,tsx,ts}' --cache --fix",
    "prettier": "prettier --write 'src/**/*.{less,scss,css,md,json}'",
  },
  "gitHooks": {
     "pre-commit": "tsc --noEmit && lint-staged"
  },
  "lint-staged": {
    "src/**/*.{js,jsx,ts,tsx}": [
      "eslint --cache --fix",
      "git add ."
    ],
    "*.{less,scss,css,md,json}": [
      "npm run prettier",
      "git add ."
    ]
  },
}

```

2. vue

``` json
{
  "scripts": {
    "lint": "eslint 'src/**/*.{js,vue}' --cache",
    "lint:fix": "eslint 'src/**/*.{js,vue}' --cache --fix",
    "prettier": "prettier --write 'src/**/*.{less,scss,css,md,json}'",
  },
  "gitHooks": {
    "pre-commit": "tsc --noEmit && lint-staged"  // ts项目可通过tsc --noEmit校验类错误
  },
  "lint-staged": {
    "src/**/*.{js,vue}": [
      "eslint --cache --fix",
      "git add ."
    ],
    "*.{less,scss,css,md,json}": [
      "npm run prettier",
      "git add ."
    ]
  },
}
```

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