# patched-rulesets

> Rulesets for the Patched linter and formatter

Latest version **0.16.0** (published 2020-03-27) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install patched-rulesets
pnpm add patched-rulesets
yarn add patched-rulesets
bun add patched-rulesets
```

## 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.16.0 |
| Published | 2020-03-27 |
| First published | 2020-03-11 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 225 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alex Seitsinger |
| Maintainers | alexseitsinger |
| Keywords | eslint, eslintconfig |

## Links

- npm: https://www.npmjs.com/package/patched-rulesets
- Repository: https://github.com/alexseitsinger/patched-rulesets
- Issues: https://github.com/alexseitsinger/patched-rulesets/issues
- npm.io page: https://npm.io/package/patched-rulesets

## Dependencies (4)

- [deepmerge](https://npm.io/package/deepmerge.md) ^4.2.2
- [lodash.uniq](https://npm.io/package/lodash.uniq.md) ^4.5.0
- [read-pkg-up](https://npm.io/package/read-pkg-up.md) ^7.0.1
- [confusing-browser-globals](https://npm.io/package/confusing-browser-globals.md) ^1.0.9

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

- 0.16.0 (latest) — 2020-03-27
- 0.15.0 — 2020-03-26
- 0.14.0 — 2020-03-26
- 0.13.0 — 2020-03-25
- 0.12.0 — 2020-03-22
- 0.11.2 — 2020-03-20
- 0.11.1 — 2020-03-20
- 0.11.0 — 2020-03-20
- 0.10.0 — 2020-03-19
- 0.9.0 — 2020-03-19
- 0.8.5 — 2020-03-18
- 0.8.4 — 2020-03-18
- 0.8.3 — 2020-03-18
- 0.8.2 — 2020-03-18
- 0.8.1 — 2020-03-18
- … 12 more at https://npm.io/package/patched-rulesets/versions

## README

# Patched Rulesets

Collection of eslint configs for various plugins. There are automatically loaded by [Patched Linter & Formatter][1].

## Installation

```bash
yarn add patched-rulesets
```

***

#### createConfig

Returns a complete eslint configuration object that contains rules for the plugins of
each specified plugin group.

```javascript
const { createConfig, getPlugins } = require("patched-rulesets")

const jsConfig = createConfig({
  pluginNames: getPlugins(["react"]),
})

module.exports = {
  overrides: [
    {
      files: ["*.js", "*.jsx"],
      ...jsConfig,
    }
  ],
}
```

---

#### getRuleSet

Returns the rules, patches, and options for the specified plugin. This is used
internally by createConfig, but exposed in case some extra manual adjustments are
necessary.

```javascript
const { getRuleSet } = require("patched-rulesets")

const reactRuleSet = getRuleSet("react")
// { rules: {...}, patches: {...}, options: {...} }

module.exports = {
  // ...
  ...reactRuleSet.options,
  rules: {
    ...reactRuleSet.patches.eslint,
    ...reactRuleSet.rules,
  },
}
```

---

#### groups

Returns an object of groups, with each containing an array of plugin names.

Name        | Plugins included
---         | ---
core        | eslint-comments, node, sort-requires, , sort-destructure-keys, no-loops
coreES6     | import, simple-import-sort, unused-imports, promise, unicorn
react       | react, react-hooks
reactES6    | better-styled-components
redux       | react-redux, redux-saga
typescript  | @typescript-eslint, tsdoc
safety      | security
prose       | markdown, spellcheck
json        | json
jsonPackage | package-json

---

#### getPlugins

Converts the provided array of group names into the actual list of plugin names.

```javascript
const { getPlugins } = require("patched-rulesets")

const plugins = getPlugins(["react"])
// -> ["react", "react-hooks"]
```

---

#### configs

A collection of preset configurations that are generated from the methods above. While this only provides the rules, it may be useful if someone is manually piecing together
ther own eslint config.

Name           | Plugin groups used
---            | ---
nodeOnly       | none
js             | core
jsReact        | core, react
jsReactRedux   | core, react, redux
ts             | core, typescript
tsReact        | core, typescript, react
tsReactRedux   | core, typescript, react, redux
mdJs           | core, prose
mdJsReact      | core, prose, react
mdJsReactRedux | core, prose, react, redux
mdTs           | core, prose, typescript
mdTsReact      | core, prose, react, typescript
mdTsReactRedux | core, prose, react, redux, typescript
json           | json
jsonPackage    | jsonPackage

```javascript
const { configs } = require("patched-rulesets")

module.exports = {
  overrides: [
    {
      files: ["*.js", "*.jsx"],
      ...configs.js,
    },
  ],
}
```

[1]: https://github.com/alexseitsinger/patched

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