Sorting Plugin
Flint’s sorting plugin includes rules that automatically sort various aspects of code.
It comes provided with the flint
npm package.
Presets
Section titled “Presets”Flint’s sorting plugin provides the following preset:
Preset | Recommended | Description |
---|---|---|
stylistic | ✅ Always | Common rules sorting various aspects of code. |
Flint recommends using the stylistic
preset:
import { sorting } from "@flint.fyi/sorting";import { defineConfig } from "flint";
export default defineConfig({ use: [ { files: sorting.files.all, rules: [sorting.presets.stylistic], }, ],});
stylistic
Section titled “stylistic”Rules that sort code in most-to-all common web files. This will include, tentatively, all files supported by other Flint plugins: JavaScript/TypeScript, Markdown, and YML.
import { sorting } from "@flint.fyi/sorting";import { defineConfig } from "flint";
export default defineConfig({ use: [ { files: sorting.files.all, rules: sorting.presets.stylistic, }, ],});
Implemented: 0 of 22 (0%)
Selectors
Section titled “Selectors”Flint’s sorting plugin will tentatively provide the following file selector:
all
:**/*.{cjs,js,json,jsx,mjs,md,ts,tsx,yaml,yml}
Made with ❤️🔥 in Boston by
Josh Goldberg and contributors.