# @wspro/linter

> Linter configs

Latest version **1.0.8** (published 2024-07-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install @wspro/linter
pnpm add @wspro/linter
yarn add @wspro/linter
bun add @wspro/linter
```

## 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.0.8 |
| Published | 2024-07-08 |
| First published | 2022-07-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | https://github.com/wsp-repo/ |
| Maintainers | wspro |
| Keywords | prettier, eslint, tslint |

## Links

- npm: https://www.npmjs.com/package/@wspro/linter
- Repository: https://github.com/wsp-repo/linter
- Homepage: https://github.com/wsp-repo/linter#readme
- Issues: https://github.com/wsp-repo/linter/issues
- npm.io page: https://npm.io/package/@wspro/linter

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

- 1.0.8 (latest) — 2024-07-08
- 1.0.7 — 2023-10-21
- 1.0.6 — 2023-10-21
- 1.0.5 — 2022-07-04
- 1.0.4 — 2022-07-03
- 1.0.3 — 2022-07-03
- 1.0.2 — 2022-07-03
- 1.0.1 — 2022-07-03

## README

## Установка модуля
```
npm i --save-dev --save-exact @wspro/linter@latest
```

## Подключение конфигов

### eslint
Пример конфига **.eslintrc.js** из корня сервиса.
```
const jsEslintConfig = require('@wspro/linter/eslint/js');
const tsEslintConfig = require('@wspro/linter/eslint/ts');

module.exports = {
  overrides: [
    {
      ...jsEslintConfig,
      files: ['*.js'],
    },
    {
      ...tsEslintConfig,
      files: ['*.ts'],
      parser: '@typescript-eslint/parser',
      parserOptions: {
        include: ['./src/**/*.ts', './test/**/*.ts'],
        project: './tsconfig.json',
      },
    },
  ],
  root: true,
};
```

### prettier
Добавить в **package.json** в корневую секцию:
```
"prettier": "@wspro/linter/prettier"
```

## Использование

### Подключение "коротких" команд
Добавить в **package.json** в секцию **scripts**:
```
"format": "prettier --write 'src/**/*.ts'",
"lint": "eslint 'src/**/*.{ts,js}' --quiet",
"lint:fix": "eslint 'src/**/*.{js,ts}' --quiet --fix",
"lint:warns": "eslint 'src/**/*.ts' --max-warnings 0",
```

### Автоматизация при работе в репозитории
Установить пакет **husky**:
```
npm i --save-dev --save-exact husky@latest
```

Добавить в **package.json** в корневую секцию:
```
"lint-staged": {
  "*.{js,ts}": [
    "eslint --quiet --max-warnings 0",
    "eslint --quiet --fix",
    "prettier --write"
  ]
},
"husky": {
  "hooks": {
    "pre-commit": "lint-staged --allow-empty"
  }
},
```

### Версии пакетов с отсуствием конфликтов
```
"devDependencies": {
  "@typescript-eslint/eslint-plugin": "6.21.0",
  "@typescript-eslint/parser": "6.21.0",
  "eslint": "8.57.0",
  "eslint-config-airbnb-base": "15.0.0",
  "eslint-config-airbnb-typescript": "17.1.0",
  "eslint-config-prettier": "9.1.0",
  "eslint-plugin-import": "2.29.1",
  "eslint-plugin-jest": "28.5.0",
  "eslint-plugin-jsx-a11y": "6.8.0",
  "eslint-plugin-prettier": "5.1.3",
  "eslint-plugin-simple-import-sort": "12.1.0",
  "eslint-plugin-typescript-sort": "0.1.11",
  "jest": "29.7.0",
  "prettier": "3.2.5",
  "typescript": "5.4.5"
}
```

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