Skip to content

Configuration

Linting with Flint must be configured by at least one flint.config.* configuration file, in the root of a repository to be linted. That file may be any extension recognized by your version of Node.js.

Flint configs must default-export the result of calling the defineConfig function imported from the flint package. flint also exports a globs object for common file globs, as well as objects for each of the core plugins.

Defines a new configuration for linting. It takes in an object with one required property, use:

flint.config.ts
import {
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

defineConfig
,
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
} from "flint";
export default
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

defineConfig
({
ConfigDefinition.use: ConfigUseDefinition[]
use
: [
{
ConfigUseDefinition.files: AnyLevelDeep<FilesValue>
files
:
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports calling a function with a value typed as `any` as an argument."; readonly id: "anyArguments"; readonly preset: "logical"; }, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | ... 1 more ... | "unsafeTupleSpread", undefined>, ... 69 more ..., Rule<...>]>.files: Record<"all", FilesValue>
files
.
all: FilesValue
all
,
ConfigUseDefinition.rules: AnyLevelDeep<ConfigRuleDefinition>
rules
:
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports calling a function with a value typed as `any` as an argument."; readonly id: "anyArguments"; readonly preset: "logical"; }, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | ... 1 more ... | "unsafeTupleSpread", undefined>, ... 69 more ..., Rule<...>]>.presets: PluginPresets<RuleAbout, "logical" | "untyped" | "stylistic">
presets
.
logical: Rule<RuleAbout, object, object, string, AnyOptionalSchema | undefined>[]
logical
,
},
],
});

The only required object property to pass to defineConfig is use, an array of definitions containing two properties:

  • files: glob pattern(s) describing which file(s) to lint
  • rules: any number of rules to enable for those files

Any number of glob pattern(s) describing file(s) to lint. This can be a string, any level deep array of strings, or an object containing exclude and include.

For example, this files selector matches all TypeScript test files by extension and in a directory:

flint.config.ts
import {
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

defineConfig
,
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
} from "flint";
export default
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

defineConfig
({
ConfigDefinition.use: ConfigUseDefinition[]
use
: [
{
ConfigUseDefinition.files: AnyLevelDeep<FilesValue>
files
: ["src/**/*.test.*.ts", "test/**/*.ts"],
ConfigUseDefinition.rules: AnyLevelDeep<ConfigRuleDefinition>
rules
:
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports calling a function with a value typed as `any` as an argument."; readonly id: "anyArguments"; readonly preset: "logical"; }, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | ... 1 more ... | "unsafeTupleSpread", undefined>, ... 69 more ..., Rule<...>]>.presets: PluginPresets<RuleAbout, "logical" | "untyped" | "stylistic">
presets
.
logical: Rule<RuleAbout, object, object, string, AnyOptionalSchema | undefined>[]
logical
,
},
],
});

See the Node.js file system glob documentation for details on glob patterns.

In addition to plain strings, files selectors can also be objects with two properties:

  • exclude: glob pattern(s) to not include in the files group
  • include: glob pattern(s) to include in the files group

For example, this files selector matches all TypeScript source files that don’t have a *.test.* extension:

flint.config.ts
import {
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

defineConfig
,
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
} from "flint";
export default
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

defineConfig
({
ConfigDefinition.use: ConfigUseDefinition[]
use
: [
{
ConfigUseDefinition.files: AnyLevelDeep<FilesValue>
files
: {
FilesGlobObject.exclude: AnyLevelDeep<FilesValue>
exclude
: "**/*.test.*",
FilesGlobObject.include: AnyLevelDeep<FilesValue>
include
:
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports calling a function with a value typed as `any` as an argument."; readonly id: "anyArguments"; readonly preset: "logical"; }, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | ... 1 more ... | "unsafeTupleSpread", undefined>, ... 69 more ..., Rule<...>]>.files: Record<"all", FilesValue>
files
.
all: FilesValue
all
,
},
ConfigUseDefinition.rules: AnyLevelDeep<ConfigRuleDefinition>
rules
:
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports calling a function with a value typed as `any` as an argument."; readonly id: "anyArguments"; readonly preset: "logical"; }, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | ... 1 more ... | "unsafeTupleSpread", undefined>, ... 69 more ..., Rule<...>]>.presets: PluginPresets<RuleAbout, "logical" | "untyped" | "stylistic">
presets
.
logical: Rule<RuleAbout, object, object, string, AnyOptionalSchema | undefined>[]
logical
,
},
],
});

Any number of rule(s) to enable on the corresponding files. These may be arrays of rules, such as from presets exported by plugins, and/or calls to plugin rules themselves.

For example, this rules entry enables all the recommended logical and stylistic TypeScript rules:

flint.config.ts
import {
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

defineConfig
,
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
} from "flint";
export default
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

defineConfig
({
ConfigDefinition.use: ConfigUseDefinition[]
use
: [
{
ConfigUseDefinition.files: AnyLevelDeep<FilesValue>
files
:
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports calling a function with a value typed as `any` as an argument."; readonly id: "anyArguments"; readonly preset: "logical"; }, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | ... 1 more ... | "unsafeTupleSpread", undefined>, ... 69 more ..., Rule<...>]>.files: Record<"all", FilesValue>
files
.
all: FilesValue
all
,
ConfigUseDefinition.rules: AnyLevelDeep<ConfigRuleDefinition>
rules
: [
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports calling a function with a value typed as `any` as an argument."; readonly id: "anyArguments"; readonly preset: "logical"; }, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | ... 1 more ... | "unsafeTupleSpread", undefined>, ... 69 more ..., Rule<...>]>.presets: PluginPresets<RuleAbout, "logical" | "untyped" | "stylistic">
presets
.
logical: Rule<RuleAbout, object, object, string, AnyOptionalSchema | undefined>[]
logical
,
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports calling a function with a value typed as `any` as an argument."; readonly id: "anyArguments"; readonly preset: "logical"; }, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | ... 1 more ... | "unsafeTupleSpread", undefined>, ... 69 more ..., Rule<...>]>.presets: PluginPresets<RuleAbout, "logical" | "untyped" | "stylistic">
presets
.
stylistic: Rule<RuleAbout, object, object, string, AnyOptionalSchema | undefined>[]
stylistic
],
},
],
});

Rules can be configured or even disabled by calling to the rules method of their plugin. That method takes in an object where the keys are rule names and values are what to do with the rule:

  • true: enable it (if it wasn’t already)
  • false: disable it (if it was previously enabled)
  • Object containing options: enable it with those options

For example, this rules entry disables one rule and reconfigures another:

flint.config.ts
import {
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

defineConfig
,
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
} from "flint";
export default
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

defineConfig
({
ConfigDefinition.use: ConfigUseDefinition[]
use
: [
{
ConfigUseDefinition.files: AnyLevelDeep<FilesValue>
files
:
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports calling a function with a value typed as `any` as an argument."; readonly id: "anyArguments"; readonly preset: "logical"; }, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | ... 1 more ... | "unsafeTupleSpread", undefined>, ... 69 more ..., Rule<...>]>.files: Record<"all", FilesValue>
files
.
all: FilesValue
all
,
ConfigUseDefinition.rules: AnyLevelDeep<ConfigRuleDefinition>
rules
: [
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports calling a function with a value typed as `any` as an argument."; readonly id: "anyArguments"; readonly preset: "logical"; }, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | ... 1 more ... | "unsafeTupleSpread", undefined>, ... 69 more ..., Rule<...>]>.presets: PluginPresets<RuleAbout, "logical" | "untyped" | "stylistic">
presets
.
logical: Rule<RuleAbout, object, object, string, AnyOptionalSchema | undefined>[]
logical
,
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports calling a function with a value typed as `any` as an argument."; readonly id: "anyArguments"; readonly preset: "logical"; }, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | ... 1 more ... | "unsafeTupleSpread", undefined>, ... 69 more ..., Rule<...>]>.presets: PluginPresets<RuleAbout, "logical" | "untyped" | "stylistic">
presets
.
stylistic: Rule<RuleAbout, object, object, string, AnyOptionalSchema | undefined>[]
stylistic
,
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports calling a function with a value typed as `any` as an argument."; readonly id: "anyArguments"; readonly preset: "logical"; }, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | ... 1 more ... | "unsafeTupleSpread", undefined>, ... 69 more ..., Rule<...>]>.rules: (rulesOptions: PluginRulesOptions<[Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>) => [...]
rules
({
debuggerStatements?: boolean
debuggerStatements
: false,
namespaceDeclarations?: boolean | {
allowDeclarations?: boolean | undefined;
allowDefinitionFiles?: boolean | undefined;
} | undefined
namespaceDeclarations
: {
allowDeclarations?: boolean | undefined
allowDeclarations
: true,
},
}),
],
},
],
});

A helper object containing file selectors with dynamic computed values. Currently it contains only one selector, all.

Includes all files previously selected by the configuration.

For example, this config enables the spelling plugin on all files that are being linted, which includes multiple languages:

flint.config.ts
import {
const spelling: Plugin<RuleAbout, string | undefined, [Rule<{
readonly description: "Runs the CSpell spell checker on any source code file.";
readonly id: "cspell";
readonly preset: "logical";
}, TextNodes, TextFileServices, "issue", undefined>]>
spelling
} from "@flint.fyi/plugin-spelling";
import {
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

defineConfig
,
const globs: {
all: FilesComputer;
}
globs
,
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly preset: "stylistic";
}, MarkdownNodesByName, MarkdownFileServices, "bareUrl", undefined>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly preset: "logical";
}, MarkdownNodesByName, MarkdownFileServices, "emptyDefinition", undefined>, ... 11 more ..., Rule<...>]>
md
,
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
} from "flint";
export default
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

defineConfig
({
ConfigDefinition.use: ConfigUseDefinition[]
use
: [
{
ConfigUseDefinition.files: AnyLevelDeep<FilesValue>
files
:
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly preset: "stylistic";
}, MarkdownNodesByName, MarkdownFileServices, "bareUrl", undefined>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly preset: "logical";
}, MarkdownNodesByName, MarkdownFileServices, "emptyDefinition", undefined>, ... 11 more ..., Rule<...>]>
md
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports bare URLs that should be formatted as autolinks or links."; readonly id: "bareUrls"; readonly preset: "stylistic"; }, MarkdownNodesByName, MarkdownFileServices, "bareUrl", undefined>, ... 12 more ..., Rule<...>]>.files: Record<"all", FilesValue>
files
.
all: FilesValue
all
,
ConfigUseDefinition.rules: AnyLevelDeep<ConfigRuleDefinition>
rules
:
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly preset: "stylistic";
}, MarkdownNodesByName, MarkdownFileServices, "bareUrl", undefined>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly preset: "logical";
}, MarkdownNodesByName, MarkdownFileServices, "emptyDefinition", undefined>, ... 11 more ..., Rule<...>]>
md
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports bare URLs that should be formatted as autolinks or links."; readonly id: "bareUrls"; readonly preset: "stylistic"; }, MarkdownNodesByName, MarkdownFileServices, "bareUrl", undefined>, ... 12 more ..., Rule<...>]>.presets: PluginPresets<RuleAbout, "logical" | "stylistic">
presets
.
logical: Rule<RuleAbout, object, object, string, AnyOptionalSchema | undefined>[]
logical
,
},
{
ConfigUseDefinition.files: AnyLevelDeep<FilesValue>
files
:
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports calling a function with a value typed as `any` as an argument."; readonly id: "anyArguments"; readonly preset: "logical"; }, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | ... 1 more ... | "unsafeTupleSpread", undefined>, ... 69 more ..., Rule<...>]>.files: Record<"all", FilesValue>
files
.
all: FilesValue
all
,
ConfigUseDefinition.rules: AnyLevelDeep<ConfigRuleDefinition>
rules
: [
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports calling a function with a value typed as `any` as an argument."; readonly id: "anyArguments"; readonly preset: "logical"; }, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | ... 1 more ... | "unsafeTupleSpread", undefined>, ... 69 more ..., Rule<...>]>.presets: PluginPresets<RuleAbout, "logical" | "stylistic" | "untyped">
presets
.
logical: Rule<RuleAbout, object, object, string, AnyOptionalSchema | undefined>[]
logical
,
const ts: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports calling a function with a value typed as `any` as an argument.";
readonly id: "anyArguments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | "unsafeSpread" | "unsafeTupleSpread", undefined>, Rule<{
readonly description: "Reports assigning a value with type `any` to variables and properties.";
readonly id: "anyAssignments";
readonly preset: "logical";
}, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArrayDestructure" | ... 4 more ... | "unsafeObjectPattern", undefined>, ... 68 more ..., Rule<...>]>
ts
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports calling a function with a value typed as `any` as an argument."; readonly id: "anyArguments"; readonly preset: "logical"; }, TypeScriptNodesByName, TypeScriptFileServices, "unsafeArgument" | ... 1 more ... | "unsafeTupleSpread", undefined>, ... 69 more ..., Rule<...>]>.presets: PluginPresets<RuleAbout, "logical" | "stylistic" | "untyped">
presets
.
stylistic: Rule<RuleAbout, object, object, string, AnyOptionalSchema | undefined>[]
stylistic
],
},
{
ConfigUseDefinition.files: AnyLevelDeep<FilesValue>
files
:
const globs: {
all: FilesComputer;
}
globs
.
all: FilesComputer
all
,
ConfigUseDefinition.rules: AnyLevelDeep<ConfigRuleDefinition>
rules
:
const spelling: Plugin<RuleAbout, string | undefined, [Rule<{
readonly description: "Runs the CSpell spell checker on any source code file.";
readonly id: "cspell";
readonly preset: "logical";
}, TextNodes, TextFileServices, "issue", undefined>]>
spelling
.
Plugin<RuleAbout, string | undefined, [Rule<{ readonly description: "Runs the CSpell spell checker on any source code file."; readonly id: "cspell"; readonly preset: "logical"; }, TextNodes, TextFileServices, "issue", undefined>]>.presets: PluginPresets<RuleAbout, "logical">
presets
.
logical: Rule<RuleAbout, object, object, string, AnyOptionalSchema | undefined>[]
logical
,
},
],
});

You can also disable specific rules inline in your code using comment directives. This is useful when you need to suppress a rule for a specific line, block, or file.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.