0.3.0 • Published 4 years ago

patched v0.3.0

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

Patched

Comprehensive and opinionated linter and formatter (it's just an ESLint wrapper)

(Inspired by the convenience of XO, the criticism from FreeBSD via Standard, and more...)

After compiling a large number of eslint configs for the many plugins that I try to use, it seemed like a good idea to just bundle them all up together to make things easier. As such, Patched was created!

I haven't written any tests, yet. However, things appear to be functional thus far. That means this is currently a WORK IN PROGRESS.

The goal for Patched, like the other fantastic linters & formatters, is to simplify the very importing linting process by making it:

  • easier: By not requiring any configuration or plugins to install
  • smarter: By detecting features and correctly loading the appropriate rules (and any patches) on it's own).

Installation

yarn add patched

Highlights

  1. Since many plugins often compliment or conflict with eachother, Patched uses predefined plugin groups (based on language, framework, etc.) to load plugins, rather than specifying any plugins individually.
  2. Plugin groups are automatically determined at runtime by testing for some simple criteria (eg: file extension, source code content, dependency existence, etc.)
  3. Each plugin used has its own ruleset loaded which each contain:
  • rules: The default rules to apply for the plugin (as if it were the only rules used).
  • patches: A collection of rules to apply to other plugin's because their rules conflict with ours.
  • options: Any additional options that may need to be included within the final eslint config. (ie: tsconfigRootDir, project, import/resolver, etc.)
  1. Plugins are always loaded in the same order, and the final config is generated in 3 stages to ensure the rules used are always what's expected.
  • Load the rulesets for each plugin.
  • Apply the rules for each plugin (in order)
  • Find & apply any patches (from any sibling rulesets).

Summary

NameValue
space typespace
space size2
if/else stylestroustrup
semiprefer ASI, except for ;((){ })
quotesdouble
quote propswhen necessary
line length88 (Hi, Black!)

Integrations

  1. coc.nvim: Forking coc-eslint was simple enough, so patched integration will be available soon.