SharePoint Framework coding best practice rules

DescriptionSeverityArea of ImpactAdditional ReferenceImpactAction
'Overloaded functions should be defined consecutively'LOWSCALABILITY'''Having overloaded functions at different locations in a class can be confusing.'Reorder the members in the class so that overloaded functions are defined consecutively.'
'Code should be vertically aligned'LOWMANAGEABILITY'''Consistent alignment for code statements helps keep code readable and clear. Statements misaligned from the standard can be harder to read and understand.''Re-align the code'
'T[]or "Array" should be used to define arrays.'HIGHSCALABILITY'''Not using these operators loses type safety''Use "T[]" or "Array" to define arrays.'
'Parenthesis should be used around the parameters of arrow function definitions.'HIGHMANAGEABILITY'''Maintains stylistic consistency with other arrow function definitions.''Add parenthesis around the parameters of arrow function definitions.'
'The shortened version of return should be used in arrow functions'LOWMANAGEABILITY''It's unnecessary to include return and {} brackets in arrow lambdas. Leaving them out results in simpler and easier to read code.'Use () => x instead of () => { return x;}'
Should not use 'await' of a non-Promise value and 'for-await-of' of a non-AsyncIterable value.'HIGHSCALABILITY'''While it is valid JavaScript to await a non-Promise-like value (it will resolve immediately), this pattern is often a programmer error and the resulting semantics can be unintuitive.''Ensure that only Promise-like values are waited for'
'These specific functions or global methods should not be used.'HIGHSECURITY'''Certain functions or global methods can be disallowed by this rule as they are considered unsafe (such as eval)''Replace use of disallowed functions'
'The comma operator should not be used'HIGHMANAGEABILITY'''Using the comma operator can create a potential for many non-obvious bugs or lead to misunderstanding of code.''Avoid using the comma operator'
'"// @ts-ignore comments should not be used'HIGHMANAGEABILITY'''Use of ts-ignore suppresses compilation warnings, and can hide issues in the code.''Remove all usages of ts-ignore comments. Address warnings appropriately.'
'General types representing boxed primitves should not be used'HIGHMANAGEABILITY'''Non-primitive boxed objects are almost never used appropriately in JavaScript code.''Use the primitive types instead.'
'Yoda" expressions should be avoided'LOWMANAGEABILITY''Expressions like 1 + x are sometimes referred to as "Yoda" expressions because they read opposite to how we would normally speak the expression. Sticking to a consistent grammar for conditions helps keep code readable and understandable.''Place literals on the right-hand side of expressions if possible.'
'Interfaces or literal types with only a call signature should be expreesed as function types'LOWSCALABILITY'''An interface or literal type with just a call signature can be written as a function type.''Change the implementation to a function type'
'Class and Interface names should use PascalCase'MEDIUMMANAGEABILITY''JavaScript and general programming convention is to refer to classes in PascalCase. It's confusing to use camelCase or other conventions for class names.''Ensure that Classes and Interfaces are named with PascalCase'
'Single line comments should be consistently formatted'LOWSCALABILITY'''Helps maintain a consistent, readable style in your codebase.''Ensure that single line comments follow a consistent format'
'Only a limited set of comment types should be used'LOWSCALABILITY'''Helps maintain a consistent, readable style in your codebase.''Ensure that only a limited set of comment types are used'
'Important items should have JSDoc comments'MEDIUMMANAGEABILITY'''Important components should be documented.''Ensure that important items include JSDoc comments'
'For loop statements should use braces'HIGHMANAGEABILITY'''Not including braces in loop statements may cause unexpected bugs''Include braces in all loop statements'
'Cyclomatic complexity should not be too high'HIGHMANAGEABILITY'''Cyclomatic complexity is a code metric which indicates the level of complexity in a function. High cyclomatic complexity indicates confusing code which may be prone to errors or difficult to modify.''Refactor to simple functions with self-descriptive names'
'Deprecated APIs should not be used.'HIGHSECURITY'''Using deprecated APIs is a security risk''Upgrade to using supported versions'
'UTF-8 file encoding should be used'MEDIUMSCALABILITY'''Using different encodings can cause issues with code merges, etc''Ensure that code is consistently UTF-8 encoded'
'Files should end with en-of-line'LOWMANAGEABILITY'''It is a standard convention to end files with a newline.''Add a newline character to the end of each file'
'A consistent file header should be used'MEDIUMSCALABILITY'''Using a consistent file header can provide important information across your code base''Ensure that a consistent header is used'
'A consistent file naming convention should be used'MEDIUMSCALABILITY'''Maintaining a consistent style across a file hierarchy makes the code easier to navigate''Ensure that a consistent file naming convention is used'
'for (... in ...) statements should be filtered with an if statement'HIGHSCALABILITY''Using for (... in ...) statements without a filtering if statement can accidental iteration over properties inherited from an object's prototype.'Consider using a Map or Set if you are storing collections of objects. Using Objects can cause occasional edge case bugs, such as if a key is named hasOwnProperty'
'Function constructors should not be used'HIGHSECURITY''Calling the constructor directly is similar to eval, which is a symptom of design issues. String inputs don't receive type checking and can cause performance issues, particularly when dynamically created.'If you need to dynamically create functions, use factory functions that themselves return functions.'
'These specific modules should not be imported'HIGHSECURITY'''For some libraries, importing the library directly can cause unused submodules to be loaded, so you may want to block these imports and require that users directly import only the submodules they need. In other cases, you may simply want to ban an import because using it is undesirable or unsafe.''Validate why a forbidden module was attempted to be imported.'
'Import statement keywords should be properly spaced'LOWMANAGEABILITY'''Proper spacing aids readability''Use at least one whitespace between import statement keywords'
'The explicit += and -= operators should be used'MEDIUMSCALABILITY''It's easy to type +i or i instead of  --i or ++i, and won't always result in invalid code.''Ensure that the operators += and -= are used instead of ++i, --i'
'Spaces should be used instead of tabs'LOWMANAGEABILITY'''Using only one of tabs or spaces for indentation leads to more consistent editor behavior, cleaner diffs in version control, and easier programmatic manipulation.''Replace tabs with four spaces'
'Interface names should begin with I'LOWSCALABILITY'''Makes it easy to differentiate interfaces from regular classes at a glance.''Ensure that all interface names begin with "I"'
'Interfaces should be used instead of type literals'MEDIUMSCALABILITY'''Interfaces are generally preferred over type literals because interfaces can be implemented, extended and merged.''Replace type literals with interfaces'
'JSDoc comments should be follow proper standards'MEDIUMMANAGEABILITY'''Helps maintain a consistent, readable style for JSDoc comments.''Use standards for JSDoc comments'
'Labels should only be used for flow loop control'MEDIUMMANAGEABILITY'''Labels in JavaScript only can be used in conjunction with break or continue, constructs meant to be used for loop flow control. While you can theoretically use labels on any block statement in JS, it is considered poor code structure to do so.''Use labels only in the context of loop flow control.'
'A consistent line break character should be used'MEDIUMMANAGEABILITY'''All files should use the same linebreak character''Ensure that all files use the same line break character'
'A default import shuld have the same name as the declaration it imports'MEDIUMSCALABILITY'''This aids readability of the code''Ensure that a default import has the same name as the declaration it imports.'
'A file should only contain one class'MEDIUMSCALABILITY'''Files should have a single responsibility so that that classes each exist in their own files''Refactor to ensure that each class is defined in its own file'
'Files should not exceed a set number of lines'HIGHSCALABILITY'''Excessively long files indicate that a class is taking on too many responsibilities''Refactor to more modular classes'
'Lines should have a maximum length'LOWMANAGEABILITY'''Limiting the length of a line of code improves code readability. It also makes comparing code side-by-side easier and improves compatibility with various editors, IDEs, and diff viewers.''Ensure that lines do not exceed the maximum allowed size'
'Class members should have explicit visbility declarations'MEDIUMSCALABILITY''Explicit visibility declarations can make code more readable . Also, because TypeScript's default visibility is public, members lacking a visibility declaration may be an indication of an accidental leak of class internals.''Explicitly include member visibility declarations, even if they are "public".'
'Class structure should be consistent'LOWMANAGEABILITY'''A consistent ordering for class members can make classes easier to read, navigate, and edit.''Ensure that all your classes follow the same structure.'
'Parenthesis should be used when invoking a constructor via the new keyword.'MEDIUMMANAGEABILITY'''Maintains stylistic consistency with other function calls.''Use parentheses when invoking a constructor via the new keyword.'
'A return statement should be preceeded by a blank line'LOWMANAGEABILITY'''Helps maintain a readable style in your codebase.''Add carriage returns where necessary'
'Chained method calls should be broken apart onto separate lines'LOWMANAGEABILITY''This style helps to keep code 'òvertical', avoiding the need for side-scrolling in IDEs or text editors.''Chained method calls should be placed in separate lines.'
'"as Type" should be used for type assertions instead of "<Type>"'MEDIUMSCALABILITY'''Both formats of type assertions have the same effect, but only as type assertions work in .tsx files.''Ensure that "as Type" is consistently used'
'"Any" should not be used as a type declaration'HIGHSCALABILITY'''Using any as a type declaration nullifies the compile-time benefits of the type system.'If you are dealing with data of unknown or any types, you shouldn not be accessing members of it. Either add type annotations for properties that may exist or change the data type to the empty object type {}.Alternately, if you are creating storage or handling for consistent but unknown types, such as in data structures or serialization, use <T> template types for generic type handling.'
'"arguments.callee" should not be used'MEDIUMPERFORMANCE'''Using arguments.callee makes various performance optimizations impossible.''Do not use arguments.callee'
'Bitwise operators should not be used'HIGHMANAGEABILITY'''Bitwise operators are often typos - for example bool1 & bool2 instead of bool1 && bool2. They also can be an indicator of overly clever code which decreases maintainability.''Do not use bitwise operators'
'Comparing boolean values to boolean literals should be avoided'LOWMANAGEABILITY'''Comparing boolean values to boolean literals is unnecessary, as those expressions will result in booleans too. Just use the boolean values directly or negate them.''Avoid comparing boolean values to boolean literals'
'Assignments in conditionals should not be used'HIGHMANAGEABILITY'''Assignments in conditionals are often typos: for example if (var1 = var2) instead of if (var1 == var2). They also can be an indicator of overly clever code which decreases maintainability.''Do not use assignments in conditionals'
'More than one consecutive blank line shold be avoided.'LOWMANAGEABILITY'''Extra blank lines take up extra space and add little to a semantic understanding of the code. It can be harder to read through files when fewer components can fit into the screen. If you find a file is so large you feel a need to split them up with extra blank lines or comments, consider splitting your file into smaller files.''Remove unnecessary blank lines.'
'Console methods should not be used'HIGHSECURITY'''Console methods are not appropriate for production code.''Do not use console methods.'
'String, Number, and Boolean constructors should not be used'MEDIUMSCALABILITY'''There is little reason to use String, Number, or Boolean as constructors. In almost all cases, the regular function-call version is more appropriate.''Use the regular function-call version'
'Debugger statements should not be used'HIGHSECURITY''Debugger statements aren't appropriate for production code.''Remove debugger statements'
'Default exports should be avoided in ES6-style modules.'MEDIUMSCALABILITY'''Named imports/exports promote clarity. In addition, current tooling differs on the correct way to handle default imports/exports. Avoiding them all together can help avoid tooling bugs and conflicts.''Use named exports instead.'
'Importing default members from ES6-style modules should be avoided'MEDIUMSCALABILITY'''Named imports/exports promote clarity. In addition, current tooling differs on the correct way to handle default imports/exports. Avoiding them all together can help avoid tooling bugs and conflicts.''Replace default with named imports'
'Multiple import statements from the same module should not be used'LOWSCALABILITY'''Using a single import statement per module will make the code clearer because you can see everything being imported from that module on one line.''Use a single import statement per module'
'Super should only be called once in constructors'HIGHSCALABILITY''The second call to 'super()' will fail at runtime.'Remove any extra calls to super()'
'Switch statements should not contain duplicate cases'LOWMANAGEABILITY'''Duplicate cases in switch statements are always a mistake''Remove the duplicate cases'
'Duplicate variables should not be defined in the same block scope'HIGHMANAGEABILITY'''duplicate variable declarations in the same block scope will cause problems at runtime. This is only possible when using the var keyword - the compiler will detect redeclarations of let and const variables.''Remove duplicate variables'
'The delete operator should not be used with computed key expressions'HIGHMANAGEABILITY'''Deleting dynamically computed keys is dangerous and not well optimized.'Consider using a Map or Set if you are storing collections of objects. Using Objects can cause occasional edge case bugs, such as if a key is named hasOwnProperty'
'Empty blocks should not be uses'LOWSCALABILITY'''Empty blocks are often indicators of missing code.''Remove, or complete, empty blocks'
'Empty interfaces (interfaces declaring no members) should not be used'HIGHSCALABILITY'''An empty interface is equivalent to its supertype (or {}). Therefore it is unnecessary and can be confusing.''Remove the empty interface or add methods to it.'
'The eval() function should not be used'HIGHSECURITY'''eval() is dangerous as it allows arbitrary code execution with full privileges''Remove all uses of the eval function'
'Unhandled promises should not be used'MEDIUMSCALABILITY'''Unhandled Promises can cause unexpected behavior, such as resolving at unexpected times.''Return Promises from functions that start them, then handle them in calling code.'
'Arrays should not be iterated with a for - in loop'MEDIUMSCALABILITY''A for-in loop (for (var k in o)) iterates over the properties of an Object. While it is legal to use for-in loops with array types, it is not common. for-in will iterate over the indices of the array as strings, omitting any holes in the array.''Use a for-of loop instead'
Modules which are not listed as dependency in the project's package.json should not be imported'HIGHSECURITY'''Uncontrolled module imports can be a security risk''Ensure that only controlled modules are imported'
'Imports with explicit side-effects should not be used'MEDIUMSCALABILITY'''Imports with side effects may have behavior which is hard for static verification.''Avoid import statements with side-effect.'
'Trivially inferred types should not be used'LOWSCALABILITY'''Explicitly declaring the type of a variable which is initialized adds unneed verbosity.''Remove the type declaration.'
'Type inference of {} (empty object type) at function and constructor call sites should not be used'MEDIUMMANAGEABILITY'''Prior to TypeScript 3.4, generic type parameters for functions and constructors are inferred as {} (the empty object type) by default when no type parameter is explicitly supplied or when the compiler cannot infer a more specific type. This is often undesirable as the call is meant to be of a more specific type.''Use specific type parameters'
The internal 'module' syntax should not be used'MEDIUMSCALABILITY'''Using module leads to a confusion of concepts with external modules.''Use the newer namespace keyword instead.'
'The sequence "${" should not be used in non-template strings'LOWSCALABILITY'''Interpolation will only work for template strings.''Use "${" only in template strings'
'The "this" keyword should not be used outside classes'MEDIUMMANAGEABILITY'''this outside of a class in code that is using ES6-class syntax is almost always a mistake.''Remove usages of this outside classes'
'Irregular whitespace should be avoided'LOWMANAGEABILITY'''Irregular whitespace hurts readability''Use of whitespace sholud be consistent'
'Magic numbers should not be used'HIGHMANAGEABILITY'''Magic numbers should be avoided as they often lack documentation.''Use a named constant to provide implicint documentation via the variable name.'
'Mergeable namespaces should not be used in the same file.'MEDIUMSCALABILITY'''Splitting the declaration of namespace members in a single file can cause confusion''Group all namespace members in a single declaration'
'The "new" keyword should not be used to define constructors for interfaces'MEDIUMSCALABILITY''Interfaces in TypeScript aren't meant to describe constructors on their implementations. The new descriptor is primarily for describing JavaScript libraries.'If you are trying to describe a function known to be a class, it is typically better to declare class.'
'Module and Namespace should not be used'MEDIUMSCALABILITY'''ES6-style external modules are the standard way to modularize code. Using module {} and namespace {} are outdated ways to organize TypeScript code.''Use the ES6 style for declaring external modules.'
'The non null assertion should not be used.'HIGHSCALABILITY'''Using non-null assertion cancels the benefits of the strict null checking mode.''Ensure that the type system is aware that an instance is required to not be null.'
'The "null" keyword literal should not be used'MEDIUMMANAGEABILITY''JavaScript originally intended undefined to refer to a value that doesn't yet exist, while null was meant to refer to a value that does exist but points to nothing. That's confusing.'Use "undefined". "undefined" is the default value when object members don't exist, and is the return value for newer native collection APIs such as Map.get when collection values don't exist.'
'Object literals should not appear in type assertion expressions'HIGHMANAGEABILITY''Always prefer const x: T = { ... }; to const x = { ... } as T; . The type assertion in the latter case is either unnecessary or hides an error.''Use const x: T = { ... }'
'Parameter properties should not be used in class constructors'HIGHMANAGEABILITY'''Parameter properties can be confusing to those new to TS as they are less explicit than other ways of declaring and initialising class members.''Keep member variable declarations in one list directly above the class constructor (instead of mixed between direct class members and constructor parameter properties).'
'Function parameters should not be reassinged inside the function'HIGHMANAGEABILITY'''Changing the value of incoming parameters to a function is confusing and can cause hard to debug issues.''Avoid reassigning parameters.'
'JSDoc which duplicates TypeScript functionality should not be used'LOWMANAGEABILITY'''It is redundant to add JSDoc which describes the intent of functionality provided by TypeScript''Remove the redundant JSDoc'
'<reference> should not be used to load other files'MEDIUMSCALABILITY'''Using /// <reference path=> comments to load other files is outdated.''Use ES6-style imports to reference other files.'
'References to imported types should not be used'LOWMANAGEABILITY'''It is redundant to use <reference types="foo" /> if you already "import foo"''Remove the redundant reference'
'The `require()` function should be avoided.'LOWMANAGEABILITY'''Prefer the newer ES6-style imports over require().''Refactor to use imports'
'"Event", "name" and "length" should not be used as global variables'LOWMANAGEABILITY'''Disallowing usage of specific global variables can be useful if you want to allow a set of global variables by enabling an environment, but still want to disallow some of those.''Use different global variable names'
'Unnecessary "return await" calls should not be used'MEDIUMSCALABILITY'''An async function always wraps the return value in a Promise. Using return awaitjust adds extra time before the overreaching promise is resolved without changing the semantics.''Remove these unnecessary calls'
'Shadowin variable declarations should not be used'MEDIUMSCALABILITY'''When a variable in a local scope and a variable in the containing scope have the same name, shadowing occurs. Shadowing makes it impossible to access the variable in the containing scope and obscures to what value an identifier actually refers.''Rename the shadowing variables'
'Arrays should not be defined with empty elements'LOWSCALABILITY'''Missing elements are probably an accidentally duplicated comma.''Ensure duplicated commas in array definitions are removed'
'Unnecessary string literal property access should not be used'LOWSCALABILITY''If --noImplicitAny is turned off, property access via a string literal will be "any" if the property does not exist.'Use instead of obj["property"] .'
'Throwing plain strings should be avoided'MEDIUMSCALABILITY'''Only Error objects contain a .stack member equivalent to the current stack trace. Primitives such as strings do not.''Throw an Error with the String message.'
'Submodule imports should not be used'HIGHSCALABILITY''Submodules of some packages are treated as private APIs and the import paths may change without deprecation periods. It's best to stick with top-level package exports.''Remove submodule imports'
'Falling through case statements should be avoided'MEDIUMSCALABILITY'''Fall though in switch statements is often unintentional and a bug.''Remove falling through case statements'
'Unnecessary references to "this" should be avoided'HIGHSCALABILITY'''Assigning a variable to this instead of properly using arrow lambdas may be a symptom of pre-ES6 practices or not managing scope well.''Instead of storing a reference to this and using it inside a function, Use () => arrow lambdas, as they preserve this scope'
'Whitespace should be removed from the end of lines'LOWMANAGEABILITY'''Keeps version control diffs clean as it prevents accidental whitespace from being committed.''Remove trailing whitespace at the end of lines'
'Methods should not be used outside method calls'MEDIUMSCALABILITY''Class functions don't preserve the class scope when passed as standalone variables.''Either use an arrow lambda (() => {...}) or call the function with the correct scope.'
'Using a callback wrapper on a directly called function should be avoided'LOWPERFORMANCE''There's generally no reason to wrap a function with a callback wrapper if it's directly called anyway. Doing so creates extra inline lambdas that slow the runtime down.''Replace x => f(x) with just f'
'Unnecessary classes should not be defined'MEDIUMMANAGEABILITY'''Users who come from a Java-style OO language may wrap their utility functions in an extra class, instead of putting them at the top level.''Remove unnecessary classes'
'Var / let statements should not be explicitly initializaed to "undefined"'LOWSCALABILITY''Values in JavaScript default to undefined. There's no need to do so manually.''Remove the unneeded initialization'
'Unnecessary namespace qualifiers should be avoided'LOWSCALABILITY'''Unnecessary namespace qualifiers are redundant''Remove the unnecessary namespace qualifiers'
'Unnecessary type assertion should not be used'LOWSCALABILITY'''Type assertions which do not change the type of the expression are unnecessary''Do not use type assertions when the do not modify the inferred type'
Expressions of type 'òany' should not be used in a dynamic way'HIGHSCALABILITY''If you're dealing with data of unknown or 'úany'ù types, you shouldn't be accessing members of it''Either add type annotations for properties that may exist or change the data type to the empty object type {}'
'Control flow statements should not be used in finally blocks'LOWSCALABILITY'''When used inside finally blocks, control flow statements, such as return, continue, break and throws override any other control flow statements in the same try/catch scope. This is confusing and unexpected behavior.''Remove control flow statements from finally blocks'
'Unused expression statements should not be used'LOWSCALABILITY'''Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).''Removed any unused expressions'
'Unused variables should be avoided'LOWMANAGEABILITY'''Variables that are declared and not used anywhere in code are likely an error due to incomplete refactoring. Such variables take up space in the code, are mild performance pains, and can lead to confusion by readers.''Remove any unused variables'
'Variables should not be used before their declaration'LOWMANAGEABILITY'''This rule is primarily useful when using the var keyword since the compiler will automatically detect if a block-scoped let and const variable is used before declaration.''Do not use variables before declaring them. In fact, do not use "var" at all.'
'The "var" keyword should not be used'MEDIUMMANAGEABILITY''Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration 'hoisting' (similar to functions) and can appear to be used before declaration.''Use "const" and "let" to define variables instead'
'The var keyword should not be used to specify imports'MEDIUMSCALABILITY'''AMD-style require([]) and CommonJS-style require("") statements are environment-specific and more difficult to statically analyse.''Use ES2015-style imports instead. They are part of the JavaScript language specification and recommended as the path going forward. TypeScript will compile them to environment-specific forms as needed.'
'Expressions of type void should appear in statement position.'MEDIUMMANAGEABILITY''It's misleading returning the results of an expression whose type is void. Attempting to do so is likely a symptom of expecting a different return type from a function.''Do not return expressions of type void'
'Decimal literals shold be consistently formatted'MEDIUMMANAGEABILITY'''Helps keep a consistent style with numeric literals. Non-standard literals are more difficult to scan through and can be a symptom of typos.''Ensure that all decimal literals have digits to the left of the decimal separator, and do not end in 0'
'A consistent convention for quoting object literal properties should be used'LOWMANAGEABILITY'''Object literal property names can be defined in two ways: using literals or using strings. It is a good idea to enforce a consistent style in your code.''Use a standard convention to name object literal property names.'
'ES6 object literal shorthand should be used'LOWMANAGEABILITY'''Shorthand object literal syntax is more compact and should be preferred''Use ES6 object literal shorthand.'
'Object literal keys should be sorted'LOWSCALABILITY'''Useful in preventing merge conflicts''Reorder object literal keys alphabetically'
'Certain tokens should appear on the same line'LOWMANAGEABILITY'''For clarity, certain tokens should be on the same line as the expression preceding them.''Format the code to comply with this rule'
'Only one variable should be declared on a single line'LOWMANAGEABILITY'''For clarity, it is better to declare one variable per line.''Declare one variable per line.'
'Non-arrow functions should not be used.'HIGHSCALABILITY''Traditional functions don't bind lexical scope, which can lead to unexpected behavior when accessing 'òthis'.''Use arrow functions instead.'
'Import statements should be organized'LOWMANAGEABILITY'''For clarity, import statements be alphabetized and grouped.''Organize your imports'
'Conditional expressions should be used to avoid multiple equivalent variable assignments'LOWSCALABILITY'''This reduces duplication and can eliminate an unnecessary variable declaration.''Use a conditional expression instead of assigning to the same thing in each branch of an if statement.'
'The "const" keyword should be used for constants'MEDIUMSCALABILITY''If a variable is only assigned to once when it is declared, it should be declared using 'òconst'''Refactor to use const'
'for-of' loops should be used in preference to for loops with index'LOWMANAGEABILITY''A for-of loop is easier to implement and read when the index is not needed.''Use the for(... of ...) loop syntax'
'Functions should be preferred over class methods'MEDIUMSCALABILITY'''Class methods that do not use "this" should be refactored to functions''Refactor methods into functions'
'The method signature syntax should be used to declare the type of a function'MEDIUMMANAGEABILITY'''"foo(): void" should be used instead of "foo: () => void" in interfaces and types.''Refactor method signatures'
'"Object.assign()" should not be used'LOWSCALABILITY'''Object spread allows for better type checking and inference.''Ese the ES2018 object spread operator instead of Object.assign()'
'Private variables should be marked as `readonly` if they\'re never modified outside of the constructor.'MEDIUMSCALABILITY''Marking never-modified variables as readonly helps enforce the code's intent of keeping them as never-modified. It can also help prevent accidental changes of members not meant to be changed.'Mark private variables as readonly if they're never modified outside of the constructor.'
'Switch statements should be used instead of three or more if - === comparsions'MEDIUMSCALABILITY'''Switch statements are easier to understand than nested if statements''Refactor to use a swtich statement'
'Template expressions should be used instead of string concatenation'LOWPERFORMANCE'''Concatenating more than two strings should be done using template expressions''Refactor string concatenations to use template expressions'
'Loops without initializer or incrementor should use "while" instead of "for"'MEDIUMMANAGEABILITY'''Simplifies the readability of the loop statement, while maintaining the same functionality.''Refactor loops to use while instead of for'
'Functions that return promises should be async'HIGHSCALABILITY'''Non-async Promise-returning functions are technically capable of returning a rejected Promise or throwing an error. This means that consuming code has to handle both cases.''Ensure that Promise-returning functions are always async'
'String literals shold be quoted'MEDIUMMANAGEABILITY'''String literals should be quoted''Ensure that all string literals are quoted'
'"parseInt" should not be called without a radix parameter'MEDIUMSCALABILITY'''Different implementations produce different results when a radix is not specified, usually defaulting the value to 10.''Specify the radix parameter when calling parseInt.'
'The "+" operator should only be used when both sides are numbers or strings'MEDIUMSCALABILITY'''When adding two variables, operands must both be of type number or of type string.''Ensure that both sides of the operation are of the same type, number or string'
'Undefined should be returned instead of null in value-returning functions'LOWMANAGEABILITY''Prefer return;  in void functions and return undefined;  in value-returning functions.''Refactor to return undefined'
'End of statement semicolons should be used consistently'MEDIUMMANAGEABILITY'''A consistent use of semicolons aids code readability''Ensure that ever statement is terminated with a semicolon'
'A whitespace should be included before function parenthesis'LOWSCALABILITY'''A space before function parenthesis aids readability''Insert a space between the function name and the parenthesis'
'A whitespace should be included after a parenthesis'LOWSCALABILITY'''A space after a parenthesis aids readability''Add spaces as needed'
'Only booleans should be used in boolean expressions'MEDIUMSCALABILITY'''Using non-boolean types inside boolean expressions can have unintened effects''Ensure that only boolean types are used in boolean expressions'
'Predicates which are always true or false should not be used'MEDIUMSCALABILITY'''An expression which always evaluates to true or false is useless in a predicate''Ensure that expressions in predicates are not always true or false'
'Switch statements should have a default'LOWSCALABILITY'''Omitting the default case can cause unexpected behaviour at runtime''Ensure that all switch statements have a default case'
'The final clause of a switch statement should end in "break"'MEDIUMSCALABILITY''The final clause of a switch statement should end in break;''Add the break statement'
'Trailing commas should be used whenever possible'LOWMANAGEABILITY'''Trailing commas (sometimes called "final commas") can be useful when adding new elements, parameters, or properties to JavaScript code. If you want to add a new property, you can simply add a new line without modifying the previously last line if that line already uses a trailing comma. This makes version-control diffs cleaner and editing code might be less troublesome.''Use trailing commas in array and object literals, destructuring assignments, function typings, named imports and exports and function parameters.'
'The triple equality operator should be used'LOWSCALABILITY'''The behaviour of the double equals operator can be unexpected in some cases''Use "===" and "!==" instead of "==" and "!="'
'Type member literals should be separated by semicolon'LOWSCALABILITY'''The semicolon separator aids readability''Use the semicolon separator'
'Types should be explicitly defined'HIGHSCALABILITY'''Not including explicit types in the code can cause hard to debug issues''Ensure that types are explicitly defined'
'Whitespace should be used for type definition'LOWMANAGEABILITY'''Adding a whitespace before the colon in a type specifier aids readability.''Ensure that a single whitespace precedes the colon in a type specifier.'
'The "typeof" operator should always compare String types'MEDIUMSCALABILITY'''Using undefined types for typeof comparsions may fail at runtime''Ensure that both sides of the typeof comparison are String'
'Imports should be unified whenever possible'LOWSCALABILITY'''Individual imports add unnecessary verbosity''Unify imports by using a union or an optional/rest parameter.'
'Unnecessary scope binings on functions should be avoided'HIGHSCALABILITY''function expressions that are immediately bound to this are equivalent to () =>arrow lambdas. Additionally, there's no use in binding a scope to an arrow lambda, as it already has one.''Remove the unnecessary scope bindings'
'Blank constructors should not be used'LOWMANAGEABILITY''JavaScript implicitly adds a blank constructor when there isn't one. It's not necessary to manually add one in.''Remove any blank constructors'
'Explicit type declarations on arguments should be avoided if there is a default type'LOWSCALABILITY'''Explicitly specifying the type argument if it is the the default for that type parameter is redundant.''Remove the explicit type declaration for these parameters'
'The isNaN() function should be used to check for NaN references.'HIGHSCALABILITY'''Since NaN !== NaN, comparisons with regular operators will produce unexpected results.''Instead of if (myVar === NaN), do if (isNaN(myVar))'
'Variable naming conventions should be followed'MEDIUMSCALABILITY'''lowerCamelCase should be used for variables, and UPPER_CASE for constants. Typescript keywords should not be used as variable names.''Rename any variables which do not comply with the naming conventions.'
'Whitespace should be used consistently'LOWMANAGEABILITY'''A consistent use of whitespace aids readablitiy.''Ensure that whitespace is used consistently.'