Error codes
quick-lint-js can find the following warnings and errors in your code:
- E0001: variable assigned before its declaration
- E0002: assignment to const global variable
- E0003: cannot assign to const variable
- E0004: assignment to const variable before its declaration
- E0005: BigInt literal contains decimal point
- E0006: BigInt literal contains exponent
- E0007: classes cannot be named 'let'
- E0008: let statement cannot declare variables named 'let'
- E0009: cannot export variable named 'let'
- E0010: cannot import 'let'
- E0011: character is not allowed in identifiers
- E0012: escaped character is not allowed in identifiers
- E0013: code point out of range
- E0014: expected expression before newline
- E0015: expected expression before semicolon
- E0016: expected hexadecimal digits in Unicode escape sequence
- E0017: if statement needs parentheses around condition
- E0018: if statement is missing '(' or ')' around condition
- E0019: escaping '-' is not allowed in tag names; write '-' instead
- E0020: invalid expression left of assignment
- E0021: invalid lone literal in object literal
- E0022: invalid UTF-8 sequence
- E0023: keywords cannot contain escape sequences
- E0024: const/let/var with no bindings
- E0025: missing comma between object literal entries
- E0026: missing operand for operator
- E0027: missing semicolon after statement
- E0028: number literal contains consecutive underscores
- E0029: number literal contains trailing underscores
- E0030: octal literal may not have exponent
- E0031: octal literal may not have decimal
- E0032: legacy octal literal may not be BigInt
- E0033: redeclaration of global variable
- E0034: redeclaration of variable
- E0035: RegExp literal flags cannot contain Unicode escapes
- E0036: stray comma in let statement
- E0037: unclosed block comment
- E0038: unclosed identifier escape sequence
- E0039: unclosed regexp literal
- E0040: unclosed string literal
- E0041: unclosed template
- E0042: unexpected '@'
- E0043: unexpected '\' in identifier
- E0044: unexpected characters in number literal
- E0045: unexpected control character
- E0046: unexpected characters in binary literal
- E0047: unexpected characters in octal literal
- E0048: unexpected characters in hex literal
- E0049: binary number literal has no digits
- E0050: hex number literal has no digits
- E0051: octal number literal has no digits
- E0052: unexpected '#'
- E0053: missing property name between '.' and '.'
- E0054: unexpected token
- E0055: unmatched indexing bracket
- E0056: unmatched parenthesis
- E0057: use of undeclared variable
- E0058: variable used before declaration
- E0059: assignment to undeclared variable
- E0060: invalid hex escape sequence
- E0061: missing name in function statement
- E0062: missing name or parentheses for function
- E0063: missing operator between expression and arrow function
- E0064: missing body for 'if' statement
- E0065: 'else' has no corresponding 'if'
- E0066: exporting requires '{' and '}'
- E0067: exporting requires 'default'
- E0068: extra ',' is not allowed between function call arguments
- E0069: cannot declare 'await' inside async function
- E0070: commas are not allowed after spread parameter
- E0071: cannot declare 'yield' inside generator function
- E0072: methods should not use the 'function' keyword
- E0073: missing function parameter list
- E0074: '.' operator needs a key name; use + to concatenate strings; use [] to access with a dynamic key
- E0075: indexing requires an expression
- E0076: cannot declare and export variable with 'export default'
- E0077: function call before declaration in blocked scope
- E0078: missing expression between parentheses
- E0079: missing name of exported function
- E0080: missing name of class
- E0081: missing name of exported class
- E0082: assigning to 'async' in a for-of loop requires parentheses
- E0083: missing value for object property
- E0084: do-while loop needs parentheses around condition
- E0085: do-while loop is missing '(' or ')' around condition
- E0086: redundant delete statement on variable
- E0087: while loop needs parentheses around condition
- E0088: while loop is missing '(' or ')' around condition
- E0089: with statement needs parentheses around expression
- E0090: with statement is missing '(' or ')' around expression
- E0091: switch statement needs parentheses around condition
- E0092: switch statement is missing '(' or ')' around condition
- E0093: C-style for loop is missing its third component
- E0094: missing body for 'for' loop
- E0095: Unicode byte order mark (BOM) cannot appear before #! at beginning of script
- E0096: missing for loop header
- E0097: for loop needs an iterable, or condition and update clauses
- E0098: for loop needs an iterable, or condition and update clauses
- E0099: missing semicolon between init and condition parts of for loop
- E0100: missing semicolon between condition and update parts of for loop
- E0101: missing body for do-while loop
- E0102: C-style for loops have only three semicolon-separated components
- E0103: missing 'while (condition)' for do-while statement
- E0104: missing body for while loop
- E0105: missing parameters for arrow function
- E0106: missing body for 'switch' statement
- E0107: expected '{'
- E0108: 'in' disallowed in C-style for loop initializer
- E0109: for-of loop expression cannot have semicolons
- E0110: for-in loop expression cannot have semicolons
- E0111: missing body for class
- E0112: unexpected token in export; expected 'export default ...' or 'export {name}' or 'export * from ...' or 'export class' or 'export function' or 'export let'
- E0113: incomplete export; expected 'export default ...' or 'export {name}' or 'export * from ...' or 'export class' or 'export function' or 'export let'
- E0114: unexpected token in variable declaration; expected variable name
- E0115: unexpected 'case' outside switch statement
- E0116: unexpected 'default' outside switch statement
- E0117: unexpected 'catch' without 'try'
- E0118: unexpected 'finally' without 'try'
- E0119: missing body for catch clause
- E0120: missing body for try statement
- E0121: missing body for finally clause
- E0122: missing catch or finally clause for try statement
- E0123: missing variable name
- E0124: cannot declare variable named keyword
- E0125: missing header and body for 'for' loop
- E0126: expected 'as' between '*' and variable
- E0127: TypeScript's 'enum' feature is not allowed in JavaScript
- E0128: expected 'from' before module specifier
- E0129: expected 'from "name_of_module.mjs"'
- E0130: missing catch variable name between parentheses
- E0131: expected ',' between object literal entries
- E0132: missing ',' between variable declarations
- E0133: error generator function star belongs before name
- E0134: unclosed code block; expected '}' by end of file
- E0135: expected variable name for 'catch'
- E0136: cannot update variable with '+=' while declaring it
- E0137: missing condition for switch statement
- E0138: missing condition for if statement
- E0139: missing condition for while statement
- E0140: expected expression after 'case'
- E0141: expected ')' to close function call
- E0142: missing property name after '.' operator
- E0143: unmatched '}'
- E0144: cannot export variable named keyword
- E0145: cannot import variable named keyword
- E0146: missing ':' in conditional expression
- E0147: unexpected identifier in expression; missing operator before
- E0148: missing body for statement; a function statement is not allowed as the body of statement
- E0149: missing body for statement; a class statement is not allowed as the body of statement
- E0150: missing body for statement; a lexical declaration is not allowed as the body of statement
- E0151: invalid function parameter
- E0152: legacy octal literals may not contain underscores
- E0153: forwarding exports are only allowed in export-from
- E0154: unexpected expression; missing key for object entry
- E0155: cannot reference private variables without object; use 'this.'
- E0156: private properties are not allowed in object literals
- E0157: missing end of array; expected ']'
- E0158: unexpected '=>'; expected parameter for arrow function, but got a literal instead
- E0159: unexpected literal in parameter list; expected parameter name
- E0160: unexpected '=>'; expected parameter for arrow function, but got an expression instead
- E0161: unclosed object literal; expected '}'
- E0162: 'await' is only allowed in async functions
- E0163: newline is not allowed between 'async' and arrow function parameter list
- E0164: JSON syntax error
- E0165: TypeScript style const field
- E0166: "globals" descriptor "shadowable" property must be a boolean
- E0167: "globals" descriptor "writable" property must be a boolean
- E0168: "globals" must be an object
- E0169: "global-groups" must be a boolean or an array
- E0170: "global-groups" entries must be strings
- E0171: "globals" descriptor must be a boolean or an object
- E0172: missing body for function
- E0173: cannot assign to loop variable in for of/in loop
- E0174: functions/methods should not have '=>'
- E0175: expected variable name for 'import'-'as'
- E0176: missing arrow operator for arrow function
- E0177: React/JSX is not allowed in vanilla JavaScript code
- E0178: 'await' cannot be followed by an arrow function; use 'async' instead
- E0179: return statement returns nothing (undefined)
- E0180: stray comma in function parameter
- E0181: unclosed string literal
- E0182: '>' is not allowed directly in JSX text; write {'>'} or > instead
- E0183: '}' is not allowed directly in JSX text; write {'}'} instead
- E0184: missing 'if' after 'else'
- E0185: assignment to imported variable; imported variable declared here
- E0186: missing '...' in JSX attribute spread
- E0187: mismatched JSX tags; expected </foo>
- E0188: '=' changes variables; to compare, use '===' instead
- E0189: missing '<>' and '</>' to enclose multiple children
- E0190: missing comparison; '===' does not extend to the right side of '||'
- E0191: event attributes must be camelCase
- E0192: attribute has wrong capitalization
- E0193: misspelled React attribute; write 'className' instead
-
E0194: missing parentheses around left-hand side of
**
;**
operator cannot be used after unary-
without parentheses -
E0195: missing parentheses around operand of
typeof
;typeof
operator cannot be used before**
without parentheses - E0196: new variable shadows existing variable
- E0197: '“' is not allowed for strings; use " instead
- E0198: unexpected statement before first switch case, expected 'case' or 'default'
- E0199: unclosed class; expected '}' by end of file
- E0200: break can only be used inside of a loop or switch
- E0201: continue can only be used inside of a loop
- E0202: missing '=' after variable
- E0203: depth limit exceeded
- E0204: error generator function star belongs after keyword function
- E0205: error missing initializer in const declaration
- E0206: label named 'await' not allowed in async function
- E0207: code point in Unicode escape sequence must not be greater than U+10FFFF
- E0208: cannot access private identifier outside class
- E0209: commas are not allowed between class methods
- E0210: unopened block comment
- E0211: missing parentheses around self-invoked function
- E0212: integer cannot be represented and will be rounded
- E0213: TypeScript's 'interface' feature is not allowed in JavaScript code
- E0214: use of undeclared type
- E0215: unclosed interface; expected '}' by end of file
- E0216: TypeScript interface properties cannot be 'static'
- E0217: TypeScript interface methods cannot be marked 'async'
- E0218: TypeScript interface methods cannot be marked as a generator
- E0219: interface properties are always public and cannot be private
- E0220: TypeScript interface methods cannot contain a body
- E0221: TypeScript interface fields cannot be initalized
- E0222: 'private' is not allowed in JavaScript
- E0223: missing semicolon after field
- E0224: TypeScript type annotations are not allowed in JavaScript code
- E0225: index signatures require a value type
- E0226: missing semicolon after index signature
- E0227: index signature must be a field, not a method
- E0228: TypeScript optional properties are not allowed in JavaScript code
- E0229: missing name for class method
- E0230: TypeScript's 'readonly' feature is not allowed in JavaScript code
- E0231: methods cannot be readonly
- E0232: 'readonly static' is not allowed; write 'static readonly' instead
- E0233: TypeScript generics are not allowed in JavaScript code
- E0234: 'protected' is not allowed in JavaScript
- E0235: missing quotes around module name
- E0236: assignment-asserted field must have a type annotation
- E0237: interface properties cannot be marked public explicitly
- E0238: assignment-asserted fields are not supported in interfaces
- E0239: TypeScript assignment-asserted fields are not supported in JavaScript
- E0240: '!' is not allowed on methods
- E0241: newline is not allowed between field name and '!'
- E0243: interfaces cannot contain static blocks
- E0244: abstract classes are not allowed in JavaScript
- E0245: missing body for TypeScript interface
- E0246: 'extends' must be before 'implements'
- E0247: TypeScript 'implements' is not allowed in JavaScript
- E0248: extra ',' is not allowed between enum members
- E0249: computed enum member name must be a simple string
- E0250: enum member name cannot be numeric
- E0251: enum value must be a compile-time constant
- E0252: enum member needs initializer; computed value disables enum autoincrement
- E0253: use ':' instead of '=' in object literals
- E0254: unexpected ':' in expression; did you mean 'as'?
- E0255: missing parentheses around parameter; TypeScript type annotation requires parentheses
- E0256: catch variable can only be typed as '*', 'any', or 'unknown'
- E0257: missing ',', ';', or newline between object type entries
- E0258: missing type between '|' and '|' (or '&' and '&')
- E0259: '.' is not allowed after generic arguments
- E0260: TypeScript non-null assertion is not allowed on parameters
- E0261: TypeScript non-null assertions are not allowed in JavaScript
- E0262: leading commas are not allowed in generic parameter lists
- E0263: only one comma is allowed between or after generic parameters
- E0264: expected at least one parameter in generic parameter list
- E0265: missing comma between generic parameters
- E0266: redundant 'await'
- E0267: TypeScript types are not allowed in JavaScript
- E0268: TypeScript type imports cannot import both default and named exports
- E0269: 'async static' is not allowed; write 'static async' instead
- E0270: TypeScript type imports are not allowed in JavaScript
- E0271: TypeScript type imports are not allowed in JavaScript
- E0272: 'type' cannot be used twice in import
- E0273: TypeScript namespaces are not allowed in JavaScript
- E0274: TypeScript import aliases are not allowed in JavaScript
- E0275: newline is not allowed after 'interface'
- E0276: newline is not allowed after 'namespace'
- E0277: newline is not allowed after 'type'
- E0278: TypeScript type exports are not allowed in JavaScript
- E0279: TypeScript type exports are not allowed in JavaScript
- E0280: 'type' cannot be used twice in export
- E0281: TypeScript 'as' type assertions are not allowed in JavaScript
- E0282: use ':' instead of 'as' to type a function parameter
- E0283: TypeScript <Type> casts are not allowed in JSX mode
- E0284: missing TypeScript type
- E0285: generic arrow function needs ',' here in TSX
- E0286: lower case letters compared with toUpperCase
- E0287: upper case letters compared with toLowerCase
- E0288: TypeScript interface properties are always public and cannot be marked protected
- E0289: 'public' is not allowed in JavaScript
- E0290: assignment-assertion fields cannot have default values
- E0291: 'as const' is only allowed on literals (array, object, string, boolean) and enum members
- E0292: missing semicolon after interface method
- E0293: missing semicolon after abstract method
- E0294: abstract methods cannot contain a body
- E0295: abstract fields cannot have default values
- E0296: abstract properties are only allowed in abstract classes
- E0297: abstract properties are not allowed in interfaces
- E0298: abstract methods cannot be marked 'async'
- E0299: abstract methods cannot be marked as a generator
- E0300: newline is not allowed after 'abstract'
- E0301: 'this' parameters are not allowed in arrow functions
- E0302: 'this' parameter not allowed when destructuring
- E0303: 'this' must be the first parameter
- E0304: cannot use '...' on 'this' parameter
- E0305: 'this' parameters are not allowed in JavaScript
- E0306: React/JSX is not allowed in vanilla TypeScript code
- E0307: unexpected '?'
- E0308: TypeScript optional parameters are not allowed in JavaScript
- E0309: unexpected '?' when destructuring
- E0310: optional parameter cannot have both '?' and initializer; remove '?'
- E0311: missing parentheses around parameter; TypeScript optional parameter requires parentheses
- E0312: missing parentheses around parameter; TypeScript optional parameter with type annotation requires parentheses
- E0313: 'readonly' only works with array types and tuple types
- E0315: (name) is not the name of a parameter
- E0316: function overload signature must be named (function name)
- E0317: newline is not allowed between 'async' and 'function'
- E0318: function overload signature cannot have generator '*'
- E0319: missing name for element in named tuple type
- E0320: missing name for element in named tuple type
- E0321: expected '?' to mark tuple element as optional
- E0323: optional tuple elements cannot come after spread elements
- E0324: spread tuple elements cannot be optional
- E0325: cannot delete variables in TypeScript
- E0326: 'async export' is not allowed; write 'export async' instead
- E0327: 'function async' is not allowed; write 'async function' instead
- E0341: using '===' or '!==' against an array literal does not compare items
- E0342: using equality or inequality operators against an arrow function will always produce the same result
- E0343: using '==' against a class literal always returns 'false'
- E0344: using '===' or '!==' against an empty array literal always produces the same result
- E0345: using equality or inequality operators against an object literal always produces the same result
- E0346: using '==' against a regular expression literal always returns 'false'
- E0347: duplicated case clause in switch statement
- E0348: unexpected '?' in type; use '| void' to make an optional type
- E0349: function parameter cannot be parenthesized
- E0358: 'declare' should not be written inside a 'declare namespace'
- E0369: nullish coalescing operator does nothing when left operand is never null
- E0373: unexpected whitespace between '!' and '=='; '!' here treated as the TypeScript non-null assertion operator
- E0374: unexpected whitespace between '!' and '=='
- E0376: JSX prop is missing an expression
- E0379: optional parameter cannot be followed by a required parameter
- E0381: Typescript does not allow keywords to contain escape sequence
- E0383: variable assignment to self is no-op
- E0427: missing 'break;' or '// fallthrough' comment between statement and 'case'
- E0450: misleading use of ',' operator in index
- E0451: misleading use of ',' operator in conditional statement
- E0452: empty parenthesis after control statement
- E0458: typeof result is of type string and so will never equal undefined; use 'undefined' instead
- E0707: classes cannot be named 'await' in async function
- E0708: unexpected '...'; expected expression
- E0709: expected variable name after '...'
- E0710: '^' is the XOR operator; to exponentiate, use '**' instead
- E0711: missing expression in placeholder within template literal
- E0712: missing ',' between array elements
- E0713: getters and setters cannot be generators
- E0714: 'async' keyword is not allowed on getters or setters
-
E0715: cannot use multiple
export default
statements in one module - E0716: unintuitive operator precedence when using & and << or >>
- E0717: namespace alias cannot use 'import type'
- E0718: using a '.' after a '?.' might fail, since '?.' might return 'undefined'
- E0719: TypeScript namespace aliases are not allowed in JavaScript
- E0720: function 'let' call may be confused for destructuring; remove parentheses to declare a variable