Skip to content

TypeScript (and JavaScript) Plugin

Rules for linting JavaScript and TypeScript code, including the latest and greatest powerful typed linting rules.
This plugin comes packaged with the flint npm package.

Flint’s TypeScript plugin provides the following presets:

PresetRecommendedDescription
logical✅ AlwaysCommon rules for finding bugs and enforcing good logical practices.
logicalStrict☑️ When ReadyAdditional rules for finding bugs and enforcing good logical practices.
stylistic✅ AlwaysCommon rules for consistent styling and best stylistic practices.
stylisticStrict☑️ When ReadyAdditional rules for consistent styling and best stylistic practices.
untypedExtra rules for files that aren’t type-checked by TypeScript.

If you are just getting started with linting, Flint recommends using the logical and stylistic presets:

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

If you are experienced with both JavaScript/TypeScript and linting, Flint recommends using the logicalStrict and stylisticStrict presets:

flint.config.ts
import { defineConfig, ts } from "flint";
export default defineConfig({
use: [
{
files: ts.files.all,
rules: [ts.presets.logicalStrict, ts.presets.stylisticStrict],
},
],
});

Rules that find bugs and enforce good logical practices for most-to-all JavaScript and TypeScript files.

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

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 using a linter.

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

This preset’s rules are a superset of those in logical.

Rules that enforce consistent styling and best stylistic practices for most-to-all JavaScript and TypeScript files.

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

Additional stylistic 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 using a linter.

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

This preset’s rules are a superset of those in stylistic.

Rules that fill in rudimentary safety practices that would normally be caught by TypeScript.

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

The untyped preset is broadly applicable for JavaScript files that aren’t type-checked by TypeScript. For long-lived projects, Flint recommends using this only as a stopgap measure pending converting files fully to TypeScript.

Implemented: 236 of 404 (58.4%)
Flint RulePreset
accessorPairTypesReports mismatched types between getter and setter accessor pairs.logical
anyArgumentsReports calling a function with a value typed as any as an argument.logical
anyAssignmentsReports assigning a value with type any to variables and properties.logical
anyCallsReports calling a value with type any.logical
anyMemberAccessReports member access on a value with type any.logical
anyReturnsReports returning a value with type any from a function.logical
argumentsReports using the arguments object instead of rest parameters.logical
arrayConstructorsReports using the Array constructor to create arrays instead of array literal syntax.logical
arrayElementDeletionsReports using the delete operator on array values.logical
arrayEmptyCallbackSlotsReports array methods with callbacks that will never be invoked on arrays with empty slots.logical
arrayMapIdentitiesReports using .flatMap() with an identity function that returns its argument unchanged.logical
arrayUnnecessaryLengthChecksReports unnecessary array length checks before .some() or .every() calls.logical
asyncFunctionAwaitslogical
asyncPromiseExecutorsReports using async functions as Promise executor functions.logical
asyncUnnecessaryPromiseWrappersReports unnecessary Promise.resolve() or Promise.reject() in async contexts.logical
awaitThenablelogical
caseDuplicatesReports switch statements with duplicate case clause test expressions.logical
caseFallthroughsReports switch case clauses that fall through unexpectedly.logical
catchCallbackTypesReports Promise catch callback parameters that are not typed as unknown.logical
charAtComparisonsReports comparing charAt() results with strings longer than one character.logical
constVariableslogical
dateConstructorClonesPrefer passing a Date directly to the Date constructor when cloning, rather than calling getTime().logical
debuggerStatementsReports using debugger statements.logical
defaultCaseLastReports switch statements where the default clause is not last.logical
deprecatedDisallow using code marked as @deprecated.logical
dynamicDeletesDisallow using the delete operator on computed key expressions.logical
elseIfDuplicatesReports duplicate conditions in if-else-if chains that make code unreachable.logical
emptyDestructuresReports using empty destructuring patterns that destructure no values.logical
emptyEnumsReports empty enum declarations with no members.logical
emptyExportsReports empty export statements that don't make a file a module.logical
emptyObjectTypesReports empty object type literals and empty interfaces that are often used incorrectly.logical
enumMixedValueslogical
enumValueConsistencyReports enums that contain both string and number members.logical
enumValueDuplicatesReports enum members with duplicate values.logical
equalityOperatorslogical
errorUnnecessaryCaptureStackTracesReports unnecessary Error.captureStackTrace() calls in Error subclass constructors.logical
evalsReports uses of the eval function.logical
exceptionAssignmentsReports reassigning exception parameters in catch clauses.logical
explicitAnysReports explicit uses of the any type.logical
exportMutablesReports exporting mutable bindings (let or var).logical
fetchMethodBodiesDisallow providing a body with GET or HEAD fetch requests.logical
finallyStatementSafetyReports control flow statements in finally blocks that can override control flow in try/catch blocks.logical
floatingPromiseslogical
forInArraysReports iterating over an array with a for-in loop.logical
functionCurryingRedundancyReports using .apply() or .call() or when the context (this value) provides no benefit.logical
functionNewCallsReports using the Function constructor to create functions from strings.logical
generatorFunctionYieldsReports generator functions that do not yield values.logical
impliedEvalsReports using string arguments in setTimeout, setInterval, setImmediate, execScript, or the Function constructor.logical
importEmptyBlocksReports empty named import blocks.logical
importSelflogical
importTypeSideEffectsReports imports that use inline type qualifiers on all specifiers when a top-level type qualifier should be used instead.logical
instanceOfArraysReports using instanceof Array instead of Array.isArray().logical
irregularWhitespacesReports irregular whitespace characters that can cause issues with code parsing and display.logical
isNaNComparisonsReports comparisons with NaN, which should use Number.isNaN() instead.logical
meaninglessVoidOperatorsReports using the void operator on expressions that are already void or undefined.logical
misleadingVoidExpressionsRequire expressions of type void to appear in statement position.logical
misusedPromiseslogical
moduleSpecifierListsRequire non-empty specifier lists in import and export statements.logical
namespaceDeclarationsReports using legacy namespace declarations.logical
negativeZeroComparisonsReports comparisons with -0 that may not behave as expected.logical
newDefinitionsReports misleading constructor and new definitions in interfaces and classes.logical
newExpressionsReports standalone new expressions that don't use the constructed object.logical
nonNullAssertedOptionalChainsReports non-null assertions on optional chain expressions.logical
nonOctalDecimalEscapesReports non-octal decimal escape sequences (\8 and \9) in string literals.logical
numberMethodRangesReports when number method arguments are outside their valid range.logical
numericErasingOperationsReports operations that always result in zero, such as multiplication by zero.logical
numericPrecisionReports numeric literals that lose precision when converted to JavaScript numbers.logical
objectCallsPrefer {} object literal notation or Object.create instead of calling or constructing Object.logical
objectPrototypeBuiltInsReports direct calls to Object.prototype methods on object instances.logical
objectSpreadUnnecessaryFallbacksReports empty object fallbacks in object spread expressions that have no effect.logical
parameterPropertyAssignmentlogical
parameterReassignmentsDisallow reassignment of function parameters.logical
parseIntRadixesReports parseInt calls that are missing or have an invalid radix parameter.logical
plusOperandslogical
promiseExecutorReturnslogical
promiseFinallyReturnslogical
promiseMethodSingleArrayArgumentslogical
promiseRejectErrorslogical
recursionOnlyArgumentsReports function parameters that are only used in recursive calls.logical
redundantTypeConstituentsReports union and intersection type constituents that are redundant or override other types.logical
regexAllGlobalFlagsReports matchAll() and replaceAll() calls with regex arguments missing the global flag.logical
regexAmbiguousInvalidityReports regex patterns that use ambiguous or invalid syntax from Annex B.logical
regexContradictoryAssertionsReports elements in regular expressions that contradict assertions.logical
regexControlCharacterEscapesReports control characters that are not escaped using standard escape sequences.logical
regexControlCharactersReports control characters in regular expressions.logical
regexDuplicateCharacterClassCharactersReports duplicate characters in regular expression character classes.logical
regexDuplicateDisjunctionslogical
regexEmptyAlternativesReports empty alternatives in regular expressions that may indicate a mistake.logical
regexEmptyCapturingGroupsReports capturing groups that only capture empty strings.logical
regexEmptyCharacterClassesReports character classes that match no characters.logical
regexEmptyGroupsReports empty groups in regular expressions.logical
regexEmptyLazyQuantifiersReports lazy quantifiers at the end of regular expressions.logical
regexEmptyLookaroundsAssertionsReports empty lookahead and lookbehind assertions in regular expressions.logical
regexEmptyStringLiteralsReports empty string literals in character classes.logical
regexIgnoreCaseFlagsReports regex patterns that can be simplified by using the i (ignore case) flag.logical
regexInvisibleCharactersReports invisible characters in regex patterns that should use escape sequences instead.logical
regexLiteralslogical
regexLookaroundQuantifierOptimizationsReports non-constant quantifiers in lookaround assertions that could be simplified.logical
regexMisleadingCapturingGroupsReports capturing groups that capture less text than their pattern suggests.logical
regexMisleadingQuantifiersReports quantifiers whose minimum implies they must match but whose element can match empty.logical
regexMisleadingUnicodeCharactersReports characters in regex character classes that appear as single visual characters but are made of multiple code points.logical
regexNamedCaptureGroupsReports capturing groups in regular expressions that do not have a name.logical
regexNonStandardFlagsReports non-standard regular expression flags.logical
regexObscureRangesReports obscure character ranges in regular expressions.logical
regexOctalEscapesReports octal escape sequences in regular expressions.logical
regexQuantifierOptimizationslogical
regexSetOperationOptimizationsReports set operations in regular expressions that can be simplified.logical
regexStandaloneBackslashesReports standalone backslashes in regex patterns that look like incomplete escape sequences.logical
regexSuperLinearBacktrackingReports regular expressions with exponential or polynomial backtracking.logical
regexSuperLinearMovesReports quantifiers that can cause quadratic regex matching time.logical
regexUnnecessaryAssertionslogical
regexUnnecessaryBackreferenceslogical
regexUnnecessaryCharacterClasseslogical
regexUnnecessaryCharacterRangeslogical
regexUnnecessaryDisjunctionslogical
regexUnnecessaryDollarReplacementslogical
regexUnnecessaryLookaroundAssertionslogical
regexUnnecessaryNestedAssertionslogical
regexUnnecessaryNestedQuantifierslogical
regexUnnecessaryNumericQuantifierslogical
regexUnnecessaryOptionalAssertionslogical
regexUnnecessaryReferentialBackreferenceslogical
regexUnnecessarySetOperandslogical
regexUnusedCapturingGroupslogical
regexUnusedFlagslogical
regexUnusedLazyQuantifierslogical
regexUnusedQuantifierslogical
regexValiditylogical
regexZeroQuantifierslogical
requireImportslogical
returnAwaitPromiseslogical
selfAssignmentsReports self-assignments which have no effect and are likely errors.logical
singleVariableDeclarationslogical
sparseArraysReports array literals with holes (sparse arrays).logical
strictBooleanExpressionslogical
stringCaseMismatcheslogical
templateExpressionValueslogical
thisAliaseslogical
throwErrorslogical
tripleSlashReferenceslogical
tripleSlashReferenceValiditylogical
tsCommentslogical
typeConstituentDuplicateslogical
unboundMethodslogical
unnecessaryBindlogical
unnecessaryCatchesReports catch clauses that only rethrow the caught error without modification.logical
unnecessaryComparisonslogical
unnecessaryConditionslogical
unnecessaryContinueslogical
unnecessaryLogicalComparisonslogical
unnecessaryMathClampslogical
unnecessaryNumericFractionslogical
unnecessarySpreadslogical
unnecessaryTemplateExpressionslogical
unnecessaryTypeArgumentslogical
unnecessaryTypeAssertionslogical
unnecessaryTypeConstraintslogical
unnecessaryTypeConversionslogical
unnecessaryTypeParameterslogical
unnecessaryUndefinedDefaultslogical
unnecessaryUseStrictslogical
unsafeDeclarationmerginglogical
unsafeEnumComparisonslogical
unsafeFunctionTypeslogical
unsafeToStringlogical
unsafeTypeAssertionslogical
unsafeUnaryNegationslogical
unusedExpressionslogical
unusedPrivateClassMemberslogical
unusedSwitchStatementslogical
unusedValueslogical
unusedVariableslogical
uselessDefaultAssignmentslogical
wrapperObjectsFlags using new with Boolean, Number, or String, which creates wrapper objects instead of primitives.logical
wrapperObjectTypeslogical
accessorThisRecursionReports recursive access to this within getters and setters.logical (strict)
awaitInsidePromiseMethodslogical (strict)
caughtErrorCauseslogical (strict)
dateNowTimestampsPrefer the shorter Date.now() to get the number of milliseconds since the Unix Epoch.logical (strict)
directivePairslogical (strict)
enumMemberLiteralsRequires all enum members to be literal values.logical (strict)
errorMessagesRequires a message value when creating a built-in error.logical (strict)
errorSubclassPropertiesReports incorrect Error subclass definitions that don't follow best practices.logical (strict)
invalidVoidTypeslogical (strict)
nonNullAssertedNullishCoalescesReports non-null assertions on the left side of nullish coalescing operators.logical (strict)
nonNullAssertionslogical (strict)
numberStaticMethodsReports using legacy global functions instead of Number static methods.logical (strict)
reduceTypeParametersReports Array#reduce calls using type assertions on initial values instead of type parameters.logical (strict)
returnThisTypeslogical (strict)
selfComparisonsReports comparing a value to itself.logical (strict)
stringCodePointslogical (strict)
unifiedSignaturesReports function overloads that could be unified.logical (strict)
extraneousClassesReports classes used as static namespaces.logicalStrict
importExtraneousDependenciesnone
accessorPairGroupsReports getter and setter accessors for the same property that are not adjacent.stylistic
arrayDeleteUnnecessaryCountsReports using .length or Infinity as the deleteCount or skipCount argument of Array#splice() or Array#toSpliced().stylistic
arrayExistenceChecksConsistencyReports inconsistent styles for checking element existence using index methods.stylistic
arrayFindsReports using .filter()[0] instead of .find() when looking for a single element.stylistic
arrayFlatUnnecessaryDepthsReports using 1 as the depth argument of .flat() since it is the default.stylistic
arrayIncludesReports using .indexOf() comparisons that can be replaced with .includes().stylistic
arrayLoopsReports using .forEach() when a for-of loop can be used.stylistic
arrayMutableReversesReports .reverse() calls on arrays that mutate the original array.stylistic
arrayMutableSortsReports .sort() calls on arrays that mutate the original array.stylistic
arraySliceUnnecessaryEndReports unnecessary end argument in .slice() calls when it equals the length or is Infinity.stylistic
arrayTernarySpreadingConsistencyReports inconsistent types when spreading a ternary in an array literal.stylistic
arrayTypesReports array type syntax that doesn't match the configured style.stylistic
asConstAssertionsReports using explicit literal types when as const can be used.stylistic
assignmentOperatorShorthandsPrefer logical assignment operator shorthand expressions.stylistic
builtinConstructorNewsEnforces using new for constructors that require it, and disallows new for primitive coercion functions.stylistic
chainedAssignmentsReports using chained assignment expressions (e.g., a = b = c).stylistic
classLiteralPropertiesReports getters that return literal values instead of using readonly class fields.stylistic
consecutiveNonNullAssertionsReports unnecessary extra non-null assertions.stylistic
constructorGenericCallsReports inconsistent placement of type arguments in constructor calls.stylistic
emptyBlocksReports empty block statements that should contain code.stylistic
emptyModuleAttributesReports empty import/export attributes that serve no purpose.stylistic
emptyStaticBlocksReports empty static initialization blocks within class declarations.stylistic
emptyTypeParameterListsReports empty type parameter lists in type aliases and interfaces.stylistic
exponentiationOperatorsPrefers the ** operator over Math.pow().stylistic
exportFromImportsReports imports that are re-exported and could use export...from syntax instead.stylistic
forDirectionsReports for loops with counter variables that move in the wrong direction.stylistic
functionApplySpreadsPrefer the spread operator over .apply() calls.stylistic
functionTypeDeclarationsstylistic
importCyclesstylistic
importDuplicatesstylistic
importUnnecessaryPathSegmentsstylistic
indexedObjectTypesReports indexed object types that don't match the configured style.stylistic
jsdocAccessTagsstylistic
jsdocEmptyBlocksstylistic
jsdocEmptyTagsstylistic
jsdocImplementsTagsstylistic
jsdocParameterNamesstylistic
jsdocPropertyNamesstylistic
jsdocRedundantTypesstylistic
jsdocTemplateNamesstylistic
jsdocTypesSyntaxstylistic
jsdocUnnecessaryReturnsstylistic
jsdocUnnecessaryYieldsstylistic
jsdocValidTypesstylistic
jsdocValuesstylistic
jsdocYieldsstylistic
literalConstructorWrappersPrefers literal syntax over constructor function calls for primitive values.stylistic
methodSignatureStylesstylistic
multilineAmbiguitiesReports ambiguous multiline expressions that could be misinterpreted.stylistic
namespaceKeywordsReports using module keyword instead of namespace for TypeScript namespaces.stylistic
nestedStandaloneIfsReports if statements that are the only statement inside an else block or inside another if without an else.stylistic
nonNullableTypeAssertionsReports type assertions that can be replaced with non-null assertions.stylistic
nullishCoalescingOperatorsPrefer nullish coalescing operator (??) over logical OR (||) for nullish values.stylistic
numericLiteralParsingReports parseInt calls with binary, hexadecimal, or octal strings that can be replaced with numeric literals.stylistic
objectAssignSpreadsPrefer object spread syntax over Object.assign() when the first argument is an object literal.stylistic
objectHasOwnsPrefer Object.hasOwn() over Object.prototype.hasOwnProperty.call() for checking own properties.stylistic
objectShorthandObject property and method definitions can use shorthand syntax when the key matches the value identifier or when a function expression is assigned.stylistic
objectTypeDefinitionsPrefer interface declarations over type aliases for object types.stylistic
operatorAssignmentShorthandPrefer assignment operator shorthand where possible.stylistic
optionalChainOperatorsstylistic
overloadSignaturesAdjacentRequire that function overload signatures be consecutive.stylistic
promiseFunctionAsyncstylistic
propertyAccessNotationReports bracket notation property access when dot notation can be used.stylistic
regexCharacterClassRangesReports character class elements that can be simplified to ranges.stylistic
regexCharacterClassSetOperationsReports lookarounds that can be replaced with character class set operations.stylistic
regexConciseCharacterClassNegationsReports negated character classes that can use shorthand escapes.stylistic
regexDollarEscapesReports replacement strings with unescaped $ that should use $$.stylistic
regexEscapeBackspacesReports escape backspace ([\b]) in character classes.stylistic
regexPredefinedAssertionsstylistic
regexRepeatQuantifiersstylistic
regexTestMethodsReports match() and exec() calls that should use RegExp.prototype.test() for boolean checks.stylistic
regexUnicodeEscapesEnforces consistent Unicode escape style in regex patterns by preferring codepoint escapes.stylistic
regexUnicodePropertiesstylistic
regexUnnecessaryEscapesstylistic
responseMethodsstylistic
returnAssignmentsReports using assignment expressions in return statements.stylistic
shadowsstylistic
stringStartsEndsWithstylistic
symbolDescriptionsReports Symbol() calls without description arguments.stylistic
tslintCommentsstylistic
typeAssertionsstylistic
typeExportsstylistic
typeImportsstylistic
undefinedInitialValuesstylistic
unicodeBOMsReports files with Unicode Byte Order Marks (BOMs).stylistic
unnecessaryBlocksReports standalone block statements that don't create a meaningful scope.stylistic
unnecessaryBooleanCastsstylistic
unnecessaryComputedKeysstylistic
unnecessaryConcatenationReports string concatenation using the + operator when both operands are string literals.stylistic
unnecessaryConstructorsstylistic
unnecessaryEscapesstylistic
unnecessaryQualifiersstylistic
unnecessaryRenamesstylistic
unnecessaryReturnsstylistic
unnecessaryTypeAnnotationsstylistic
unusedLabelsstylistic
varDeclarationsstylistic
voidOperatorReports using the void operator.stylistic
arrayFilteredFindsReports using .filter() when only the first or last matching element is needed.stylistic (strict)
arrayFlatMapMethodsReports using .map().flat() when .flatMap() can be used.stylistic (strict)
arrayFlatMethodsReports legacy techniques to flatten arrays instead of using .flat().stylistic (strict)
arrayIncludesMethodsReports using Array#some() with simple equality checks that can be replaced with .includes().stylistic (strict)
arrayIndexOfMethodsReports using .findIndex() or .findLastIndex() with simple equality checks that can be replaced with .indexOf() or .lastIndexOf().stylistic (strict)
arraySomeMethodsReports patterns that can be replaced with .some() for checking array element existence.stylistic (strict)
atAccessesPrefer using .at() for accessing elements at negative indices.stylistic (strict)
builtinCoercionsReports functions that wrap native coercion functions like String, Number, BigInt, Boolean, or Symbol.stylistic (strict)
caughtVariableNamesEnforces a consistent naming convention for catch clause error variables.stylistic (strict)
classMethodsThisReports class methods that do not use this.stylistic (strict)
combinedPushesReports consecutive array.push() calls that could be combined into a single call.stylistic (strict)
destructuringConsistencyUse destructured variables over properties for consistency.stylistic (strict)
directiveRequireDescriptionsstylistic (strict)
elseReturnsReports unnecessary else blocks following if statements that always return or throw.stylistic (strict)
emptyFilesReports files that contain no meaningful code.stylistic (strict)
emptyFunctionsReports empty functions that should contain code or a comment.stylistic (strict)
escapeSequenceCasingReports escape sequences with lowercase hexadecimal characters.stylistic (strict)
functionDefinitionScopeConsistencystylistic (strict)
globalThisAliasesReports using window, self, or global instead of globalThis.stylistic (strict)
jsdocAsterisksstylistic (strict)
jsdocInformativeDocsstylistic (strict)
jsdocMisleadingBlocksstylistic (strict)
jsdocMultilineBlocksstylistic (strict)
jsdocParameterDescriptionHyphensstylistic (strict)
jsdocTagNamesstylistic (strict)
mathMethodsPrefer modern Math methods over legacy patterns.stylistic (strict)
namedDefaultExportsReports anonymous functions and classes as the default export.stylistic (strict)
namespaceImplicitAmbientImportsReports declared namespaces that implicitly export all members.stylistic (strict)
negativeIndexLengthMethodsPrefer negative index over .length - index for at, slice, splice, and similar methods.stylistic (strict)
nonNullAssertionPlacementReports confusing placement of non-null assertions next to comparison or assignment operators.stylistic (strict)
numericSeparatorGroupsReports numeric literals with inconsistent separator grouping.stylistic (strict)
objectEntriesMethodsPrefer Object.fromEntries() over reduce patterns that build objects from key-value pairs.stylistic (strict)
regexCharacterClassesReports regex alternations that can be simplified to character classes.stylistic (strict)
regexDigitMatchersReports character classes with multiple adjacent characters that could use a range instead.stylistic (strict)
regexExecutorsReports String.prototype.match calls that can be replaced with RegExp.prototype.exec.stylistic (strict)
regexGraphemeStringLiteralsReports string literals inside character classes with the v flag that contain multiple graphemes.stylistic (strict)
regexHexadecimalEscapesReports regex character escapes that can be expressed more consistently using hexadecimal escapes.stylistic (strict)
regexLetterCasingReports inconsistent letter casing in regex sequences.stylistic (strict)
regexLookaroundAssertionsstylistic (strict)
regexMatchNotationReports inconsistent notations for matching any character in regular expressions.stylistic (strict)
regexNamedBackreferencesReports backreferences that do not use the name of their referenced capturing group.stylistic (strict)
regexNamedReplacementsReports indexed references in replacement strings that should use named references.stylistic (strict)
regexPlusQuantifiersstylistic (strict)
regexQuestionQuantifiersstylistic (strict)
regexResultArrayGroupsReports indexed access on regex result arrays when named capturing groups should be used.stylistic (strict)
regexStarQuantifiersReports quantifiers {0,} in regular expressions that should use * instead.stylistic (strict)
regexUnicodeCodepointEscapesReports surrogate pair escapes in regular expressions that can be replaced with Unicode codepoint escapes.stylistic (strict)
regexUnnecessaryNonCapturingGroupsstylistic (strict)
regexWordMatchersstylistic (strict)
setHasExistenceChecksstylistic (strict)
setSizeLengthChecksstylistic (strict)
sizeComparisonOperatorsstylistic (strict)
staticMemberOnlyClassesstylistic (strict)
stringSliceMethodsstylistic (strict)
stringTrimMethodsstylistic (strict)
structuredCloneMethodsstylistic (strict)
topLevelAwaitsstylistic (strict)
undefinedTypeofChecksstylistic (strict)
unnecessaryTernariesstylistic (strict)
arrayCallbackReturnsReports missing return statements in callbacks of array methods.untyped
caseDeclarationsReports lexical declarations in case clauses without wrapping them in blocks.untyped
classAssignmentsReports reassigning class declarations.untyped
classFieldDeclarationsReports assigning literal values to this in constructors instead of using class field declarations.untyped
classMemberDuplicatesReports duplicate class member names that will be overwritten.untyped
constantAssignmentsReports attempting to reassign variables declared with const.untyped
constructorReturnsReports returning values from constructor functions.untyped
constructorSupersReports constructors of derived classes that do not call super(), and constructors of non-derived classes that call super().untyped
defaultParameterLastEnforce default parameters to be last.untyped
duplicateArgumentsReports functions with duplicate parameter names in their signatures.untyped
exportUniqueNamesReports duplicate export names in a module.untyped
functionAssignmentsReports reassigning variables declared with function declarations.untyped
getterReturnsReports getter functions that do not return values.untyped
globalAssignmentsReports attempting to assign to read-only global variables such as undefined, NaN, Infinity, Object, etc.untyped
globalObjectCallsReports calling global objects like Math, JSON, or Reflect as functions.untyped
importAssignmentsuntyped
invalidThisuntyped
nativeObjectExtensionsReports extending the prototype of native JavaScript objects.untyped
newNativeNonConstructorsDisallows using new with global non-constructor functions like Symbol and BigInt.untyped
objectKeyDuplicatesReports unnecessary duplicate keys that override previous values.untyped
objectProtoReports using the deprecated proto property to access or modify an object's prototype.untyped
octalEscapesReports using octal escape sequences in string literals.untyped
octalNumbersReports using legacy octal numeric literals.untyped
sequencesReports using the comma operator in expressions.untyped
setterReturnsuntyped
shadowedRestrictedNamesReports variable declarations that shadow JavaScript's restricted names.untyped
thisBeforeSuperuntyped
typeofComparisonsReports typeof expressions that compare impossible string literals.untyped
unassignedVariablesReports variables that are declared but never assigned a value.untyped
undefinedVariablesReports using variables that are not defined.untyped
unreachableStatementsuntyped
unsafeNegationsReports negating the left operand of in or instanceof relations.untyped
unsafeOptionalChainsuntyped
usageBeforeDefinitionuntyped
useStrictDirectivesuntyped
variableBlockScopeUsageuntyped
variableDeletionsReports attempting to delete variables with the delete operator.untyped
variableRedeclarationsuntyped
withStatementsReports using with statementsuntyped
consoleCallsReports calls to console methods.(none)
enumInitializersReports enum members without explicit initial values.(none)
equalityOperatorNegationsReports negated expressions on the left side of equality checks.(none)
forInGuardsReports for-in loops without an if statement to filter inherited properties.(none)
functionDeclarationStylesReports functions that don't match the configured style (declaration vs expression).(none)
functionNameMatchesReports function names that don't match the variable or property they're assigned to.(none)
regexUnicodeFlagRequire regex patterns to have the unicode ('u') or unicodeSets ('v') flag for proper Unicode character handling.(none)
restrictedGlobals(none)
restrictedIdentifiers(none)
restrictedImports(none)
restrictedProperties(none)
restrictedSyntax(none)
restrictedTypes(none)
evolvingVariableTypesReports variables declared without type annotation or initializer.(none)

Flint’s TypeScript plugin provides the following file selector:

  • all: **/*.{cjs,js,jsx,mjs,ts,tsx}
Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.