0.16.0 • Published 4 years ago

patched-rulesets v0.16.0

Weekly downloads
2
License
BSD-2-Clause
Repository
github
Last release
4 years ago

Patched Rulesets

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

Installation

yarn add patched-rulesets

createConfig

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

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.

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.

NamePlugins included
coreeslint-comments, node, sort-requires, , sort-destructure-keys, no-loops
coreES6import, simple-import-sort, unused-imports, promise, unicorn
reactreact, react-hooks
reactES6better-styled-components
reduxreact-redux, redux-saga
typescript@typescript-eslint, tsdoc
safetysecurity
prosemarkdown, spellcheck
jsonjson
jsonPackagepackage-json

getPlugins

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

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.

NamePlugin groups used
nodeOnlynone
jscore
jsReactcore, react
jsReactReduxcore, react, redux
tscore, typescript
tsReactcore, typescript, react
tsReactReduxcore, typescript, react, redux
mdJscore, prose
mdJsReactcore, prose, react
mdJsReactReduxcore, prose, react, redux
mdTscore, prose, typescript
mdTsReactcore, prose, react, typescript
mdTsReactReduxcore, prose, react, redux, typescript
jsonjson
jsonPackagejsonPackage
const { configs } = require("patched-rulesets")

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

4 years ago

0.16.0

4 years ago

0.14.0

4 years ago

0.13.0

4 years ago

0.12.0

4 years ago

0.11.0

4 years ago

0.11.1

4 years ago

0.11.2

4 years ago

0.10.0

4 years ago

0.9.0

4 years ago

0.8.5

4 years ago

0.8.4

4 years ago

0.8.3

4 years ago

0.8.2

4 years ago

0.8.1

4 years ago

0.8.0

4 years ago

0.7.0

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago