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).
yarn add patched
- 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.
- Plugin groups are automatically determined at runtime by testing for some simple criteria (eg: file extension, source code content, dependency existence, etc.)
- 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 finaleslint config
. (ie:tsconfigRootDir
,project
,import/resolver
, etc.)
- 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).
Name | Value |
---|---|
space type | space |
space size | 2 |
if/else style | stroustrup |
semi | prefer ASI, except for ;((){ }) |
quotes | double |
quote props | when necessary |
line length | 88 (Hi, Black!) |
- coc.nvim: Forking coc-eslint was simple enough, so patched integration will be available soon.