A game of chess, is like a sword fight. You must think first, before you move.
This page contains a high-level overview of some of the core concepts of 🐊Putout.
🐊Putout is a configurable linter and declarative code transformer. It helps you find and fix problems in your:
- ✅ JSX;
- ✅ TypeScript;
- ✅ Flow;
- ✅ Yaml;
- ✅ Markdown;
- ✅ JSON;
- ✅ Ignore;
Processors makes this transforms possible. Problems can be anything from potential runtime bugs, to not following best practices or styling issues.
Crocodile is dengerous beast that can make drastic changes to environment it lives in. Balk signifies borders that makes crocodile act in a predictable way. Tamed beast can be a good friend 😏.
Rules are the core building block of 🐊Putout that makes code transformation. A rule validates if your code meets a certain expectation, and what to do if it does not meet that expectation. Rules can also contain additional configuration options specific to that rule.
For example, the apply-array-at
rule lets you specify whether or not to use array.at()
.
You can set the rule to always require array.at()
.
🐊Putout contains hundreds of built-in transformations that you can use. You can also create custom rules or use rules that others have created with plugins.
🐊Putout uses configuration file to learn it's limits. You can include built-in rules, how you want them enforced, plugins with custom rules, which files you want rules to apply to, and more.
For more information, refer to Configuration.
A 🐊Putout plugin is an npm module that can contain a set of 🐊Putout rules. Often plugins include custom rules.
For more information, refer to Plugins API.
A 🐊Putout processor extracts JavaScript code from other kinds of files, then lets 🐊Putout lint the JavaScript code. Alternatively, you can use a processor to manipulate JavaScript code before parsing it with 🐊Putout.
For example, @putout/processor-markdown
contains a custom processor that lets you lint JavaScript code inside of Markdown code blocks.
A 🐊Putout formatter controls the appearance of the linting results in the CLI.
For more information, refer to Formatters.