Skip to content

Performance Plugin

Rules for specialized code designed specifically to be run in performance-critical "hot paths".
This plugin is provided in a standalone @flint.fyi/plugin-performance npm package.

Terminal window
npm install @flint.fyi/plugin-performance

Flint’s performance plugin provides the following preset:

PresetRecommendedDescription
logical✅ AlwaysCommon rules for finding bugs and good practices for high-performance code.

Flint recommends using the logical preset:

flint.config.ts
import { performance } from "@flint.fyi/performance";
import { defineConfig } from "flint";
export default defineConfig({
use: [
{
files: performance.files.all,
rules: [performance.presets.logical],
},
],
});

Rules that find bugs and enforce good performance practices and catch common pitfalls for most-to-all JavaScript and TypeScript files.

flint.config.ts
import { performance } from "@flint.fyi/performance";
import { defineConfig } from "flint";
export default defineConfig({
use: [
{
files: performance.files.all,
rules: performance.presets.logical,
},
],
});
Flint RulePreset
deletesReports using the delete operator.logical
importedNamespaceDynamicAccessesDisallow computed member access on imported namespace identifiers.logical
loopAwaitsReports using await expressions inside loops.logical
loopFunctionsReports function declarations and expressions inside loops that reference variables modified by the loop.logical
spreadAccumulatorsReports spread operations that accumulate values in loops, causing quadratic time complexity.logical
Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.