Flint Plugin
Rules for writing third-party Flint plugins and custom rules. Meta!
This plugin is provided in a standalone @flint.fyi/plugin-flint npm package.
npm install @flint.fyi/plugin-flintpnpm install @flint.fyi/plugin-flintyarn install @flint.fyi/plugin-flintPresets
Section titled “Presets”logical
Section titled “logical”Rules that find bugs and enforce good practices for Flint plugins and rules.
import { flint } from "@flint.fyi/plugin-flint";import { defineConfig, ts } from "flint";
export default defineConfig({ use: [ { files: ts.files.all, rules: flint.presets.logical, }, ],});logicalStrict
Section titled “logicalStrict”Additional logical rules that enforce best practices which are not always straightforward to implement. These rules are recommended for projects where a majority of developers are experienced with both JavaScript/TypeScript and writing plugins for a linter.
import { flint } from "@flint.fyi/plugin-flint";import { defineConfig, ts } from "flint";
export default defineConfig({ use: [ { files: ts.files.all, rules: flint.presets.logicalStrict, }, ],});This preset’s rules are a superset of those in logical.
stylistic
Section titled “stylistic”Rules that enforce consistent styling and best stylistic practices for most-to-all Flint plugins.
import { flint } from "@flint.fyi/plugin-flint";import { defineConfig, ts } from "flint";
export default defineConfig({ use: [ { files: ts.files.all, rules: flint.presets.stylistic, }, ],});Implemented: 2 of 12 (16.6%)
| Flint Rule | Preset |
|---|---|
invalidCodeLinesReports cases for invalid code that isn't formatted across lines. | logical |
missingPlaceholders | logical |
nodePropertyInChecks | logical |
ruleDescriptions | logical |
rulePresets | logical |
ruleURLs | logical |
testCaseDuplicatesReports test cases that are identical to previous test cases. | logical |
testCaseOnlies | logical |
unusedMessageIds | logical |
unusedPlaceholders | logical |
messagePhrases | logical (strict) |
testShorthands | stylistic |
Made with ❤️🔥 in Boston by
Josh Goldberg and contributors.