diff --git a/.eslintrc b/.eslintrc index 132dcd6c1c..998aebcf59 100644 --- a/.eslintrc +++ b/.eslintrc @@ -168,6 +168,6 @@ "no-plusplus": 0, "no-prototype-builtins": 2, "prefer-template": 2, - "template-curly-spacing": [2, "never"], + "template-curly-spacing": [2, "never"] } } diff --git a/lib/rules/destructuring-assignment.js b/lib/rules/destructuring-assignment.js index 9f7d28255f..db1f675d5f 100644 --- a/lib/rules/destructuring-assignment.js +++ b/lib/rules/destructuring-assignment.js @@ -127,7 +127,7 @@ module.exports = { handleSFCUsage(node); } if (classComponent) { - handleClassUsage(node, classComponent); + handleClassUsage(node); } }, diff --git a/lib/rules/jsx-closing-bracket-location.js b/lib/rules/jsx-closing-bracket-location.js index 745d0df200..860f6f3871 100644 --- a/lib/rules/jsx-closing-bracket-location.js +++ b/lib/rules/jsx-closing-bracket-location.js @@ -153,10 +153,11 @@ module.exports = { * Get the characters used for indentation on the line to be matched * @param {Object} tokens Locations of the opening bracket, closing bracket and last prop * @param {String} expectedLocation Expected location for the closing bracket - * @param {Number} correctColumn Expected column for the closing bracket + * @param {Number} [correctColumn] Expected column for the closing bracket. Default to 0 * @return {String} The characters used for indentation */ function getIndentation(tokens, expectedLocation, correctColumn) { + correctColumn = correctColumn || 0; let indentation, spaces = []; switch (expectedLocation) { case 'props-aligned': diff --git a/lib/rules/jsx-curly-brace-presence.js b/lib/rules/jsx-curly-brace-presence.js index c9de7fa83f..0020934b1a 100755 --- a/lib/rules/jsx-curly-brace-presence.js +++ b/lib/rules/jsx-curly-brace-presence.js @@ -110,7 +110,7 @@ module.exports = { /** * Report and fix an unnecessary curly brace violation on a node - * @param {ASTNode} node - The AST node with an unnecessary JSX expression + * @param {ASTNode} JSXExpressionNode - The AST node with an unnecessary JSX expression */ function reportUnnecessaryCurly(JSXExpressionNode) { context.report({ diff --git a/lib/rules/jsx-curly-spacing.js b/lib/rules/jsx-curly-spacing.js index f1395e5d07..c684ed6465 100644 --- a/lib/rules/jsx-curly-spacing.js +++ b/lib/rules/jsx-curly-spacing.js @@ -156,8 +156,8 @@ module.exports = { /** * Trims text of whitespace between two ranges * @param {Fixer} fixer - the eslint fixer object - * @param {Location} fromLoc - the start location - * @param {Location} toLoc - the end location + * @param {number} fromLoc - the start location + * @param {number} toLoc - the end location * @param {string} mode - either 'start' or 'end' * @param {string=} spacing - a spacing value that will optionally add a space to the removed text * @returns {Object|*|{range, text}} @@ -183,6 +183,7 @@ module.exports = { * Reports that there shouldn't be a newline after the first token * @param {ASTNode} node - The node to report in the event of an error. * @param {Token} token - The token to use for the report. + * @param {string} spacing * @returns {void} */ function reportNoBeginningNewline(node, token, spacing) { @@ -201,6 +202,7 @@ module.exports = { * Reports that there shouldn't be a newline before the last token * @param {ASTNode} node - The node to report in the event of an error. * @param {Token} token - The token to use for the report. + * @param {string} spacing * @returns {void} */ function reportNoEndingNewline(node, token, spacing) { diff --git a/lib/rules/jsx-indent-props.js b/lib/rules/jsx-indent-props.js index 55844bb8c3..1509b64c89 100644 --- a/lib/rules/jsx-indent-props.js +++ b/lib/rules/jsx-indent-props.js @@ -59,6 +59,7 @@ module.exports = { const extraColumnStart = 0; let indentType = 'space'; + /** @type {number|'first'} */ let indentSize = 4; const sourceCode = context.getSourceCode(); @@ -126,7 +127,6 @@ module.exports = { * Check indent for nodes list * @param {ASTNode[]} nodes list of node objects * @param {Number} indent needed indent - * @param {Boolean} excludeCommas skip comma on start of line */ function checkNodesIndent(nodes, indent) { nodes.forEach(node => { diff --git a/lib/rules/jsx-indent.js b/lib/rules/jsx-indent.js index d0f237ff45..4b133fc364 100644 --- a/lib/rules/jsx-indent.js +++ b/lib/rules/jsx-indent.js @@ -110,7 +110,7 @@ module.exports = { * @param {ASTNode} node Node violating the indent rule * @param {Number} needed Expected indentation character count * @param {Number} gotten Indentation character count in the actual node/code - * @param {Object} loc Error line and column location + * @param {Object} [loc] Error line and column location */ function report(node, needed, gotten, loc) { const msgContext = { @@ -141,8 +141,8 @@ module.exports = { /** * Get node indent * @param {ASTNode} node Node to examine - * @param {Boolean} byLastLine get indent of node's last line - * @param {Boolean} excludeCommas skip comma on start of line + * @param {Boolean} [byLastLine] get indent of node's last line + * @param {Boolean} [excludeCommas] skip comma on start of line * @return {Number} Indent */ function getNodeIndent(node, byLastLine, excludeCommas) { @@ -204,7 +204,7 @@ module.exports = { * Check indent for nodes list * @param {ASTNode} node The node to check * @param {Number} indent needed indent - * @param {Boolean} excludeCommas skip comma on start of line + * @param {Boolean} [excludeCommas] skip comma on start of line */ function checkNodesIndent(node, indent, excludeCommas) { const nodeIndent = getNodeIndent(node, false, excludeCommas); diff --git a/lib/rules/jsx-sort-props.js b/lib/rules/jsx-sort-props.js index a0b83a4d06..75a5d45e78 100644 --- a/lib/rules/jsx-sort-props.js +++ b/lib/rules/jsx-sort-props.js @@ -75,7 +75,7 @@ function contextCompare(a, b, options) { * Create an array of arrays where each subarray is composed of attributes * that are considered sortable. * @param {Array} attributes - * @return {Array} + * @return {Array>} */ function getGroupsOfSortableAttributes(attributes) { const sortableAttributeGroups = []; @@ -156,7 +156,7 @@ const generateFixerFunction = (node, context, reservedList) => { * Checks if the `reservedFirst` option is valid * @param {Object} context The context of the rule * @param {Boolean|Array} reservedFirst The `reservedFirst` option - * @return {?Function} If an error is detected, a function to generate the error message, otherwise, `undefined` + * @return {Function|undefined} If an error is detected, a function to generate the error message, otherwise, `undefined` */ // eslint-disable-next-line consistent-return function validateReservedFirstConfig(context, reservedFirst) { diff --git a/lib/rules/no-danger-with-children.js b/lib/rules/no-danger-with-children.js index d03546537c..af2af06672 100644 --- a/lib/rules/no-danger-with-children.js +++ b/lib/rules/no-danger-with-children.js @@ -28,6 +28,7 @@ module.exports = { * Takes a ObjectExpression and returns the value of the prop if it has it * @param {object} node - ObjectExpression node * @param {string} propName - name of the prop to look for + * @param {string[]} seenProps */ function findObjectProp(node, propName, seenProps) { if (!node.properties) { diff --git a/lib/rules/no-unknown-property.js b/lib/rules/no-unknown-property.js index cc881a8a3b..25508df044 100644 --- a/lib/rules/no-unknown-property.js +++ b/lib/rules/no-unknown-property.js @@ -157,8 +157,8 @@ function isTagName(node) { /** * Extracts the tag name for the JSXAttribute - * @param {Object} node - JSXAttribute being tested. - * @returns {String} tag name + * @param {JSXAttribute} node - JSXAttribute being tested. + * @returns {String|null} tag name */ function getTagName(node) { if (node && node.parent && node.parent.name && node.parent.name) { @@ -193,7 +193,7 @@ function getStandardName(name) { if (SVGDOM_ATTRIBUTE_NAMES[name]) { return SVGDOM_ATTRIBUTE_NAMES[name]; } - let i; + let i = -1; const found = DOM_PROPERTY_NAMES.some((element, index) => { i = index; return element.toLowerCase() === name; diff --git a/lib/rules/no-unused-prop-types.js b/lib/rules/no-unused-prop-types.js index 8aaf9f9d2f..79488f16c0 100644 --- a/lib/rules/no-unused-prop-types.js +++ b/lib/rules/no-unused-prop-types.js @@ -82,7 +82,7 @@ module.exports = { /** * Used to recursively loop through each declared prop type * @param {Object} component The component to process - * @param {Array} props List of props to validate + * @param {ASTNode[]|true} props List of props to validate */ function reportUnusedPropType (component, props) { // Skip props that check instances diff --git a/lib/rules/prefer-stateless-function.js b/lib/rules/prefer-stateless-function.js index 1dd6e63204..0b848db87a 100644 --- a/lib/rules/prefer-stateless-function.js +++ b/lib/rules/prefer-stateless-function.js @@ -137,7 +137,7 @@ module.exports = { * Checks whether the parameters of a constructor and the arguments of `super()` * have the same values or not. * @see ESLint no-useless-constructor rule - * @param {ASTNode} ctorParams - The parameters of a constructor to check. + * @param {ASTNode[]} ctorParams - The parameters of a constructor to check. * @param {ASTNode} superArgs - The arguments of `super()` to check. * @returns {boolean} `true` if those have the same values. */ diff --git a/lib/rules/static-property-placement.js b/lib/rules/static-property-placement.js index 19b3313f9b..995e1f6957 100644 --- a/lib/rules/static-property-placement.js +++ b/lib/rules/static-property-placement.js @@ -102,17 +102,17 @@ module.exports = { /** * Check if we should report this property node - * @param node - * @param expectedRule + * @param {ASTNode} node + * @param {string} expectedRule */ function reportNodeIncorrectlyPositioned(node, expectedRule) { // Detect if this node is an expected property declaration adn return the property name const name = classProperties.find(propertyName => { if (propertiesToCheck[propertyName](node)) { - return propertyName; + return !!propertyName; } - return null; + return false; }); // If name is set but the configured rule does not match expected then report error diff --git a/lib/rules/style-prop-object.js b/lib/rules/style-prop-object.js index 4a29d33d25..4b9f750be5 100644 --- a/lib/rules/style-prop-object.js +++ b/lib/rules/style-prop-object.js @@ -24,7 +24,7 @@ module.exports = { create: function(context) { /** - * @param {object} node An Identifier node + * @param {ASTNode} expression An Identifier node */ function isNonNullaryLiteral(expression) { return expression.type === 'Literal' && expression.value !== null; diff --git a/lib/types.d.ts b/lib/types.d.ts new file mode 100644 index 0000000000..d1ae21f948 --- /dev/null +++ b/lib/types.d.ts @@ -0,0 +1,29 @@ +import eslint from 'eslint'; +import estree from 'estree'; + +declare global { + interface ASTNode extends estree.BaseNode { + [_: string]: any; // TODO: fixme + } + type Scope = eslint.Scope.Scope; + type Token = eslint.AST.Token; + type Fixer = eslint.Rule.RuleFixer; + type JSXAttribute = ASTNode; + type JSXSpreadAttribute = ASTNode; + + interface Context extends eslint.SourceCode { + getFirstTokens(node: estree.Node | ASTNode, options?: eslint.SourceCode.CursorWithCountOptions): eslint.AST.Token[]; + } + + type TypeDeclarationBuilder = (annotation: ASTNode, parentName: string, seen: Set) => object; + + type TypeDeclarationBuilders = { + [k in string]: TypeDeclarationBuilder; + }; + + type UnionTypeDefinitionChildren = unknown[]; + type UnionTypeDefinition = { + type: 'union' | 'shape'; + children: UnionTypeDefinitionChildren | true; + }; +} diff --git a/lib/util/Components.js b/lib/util/Components.js index b9de462d2e..a2dd6f72e7 100644 --- a/lib/util/Components.js +++ b/lib/util/Components.js @@ -258,7 +258,7 @@ function componentRule(rule, context) { /** * Check if variable is destructured from pragma import * - * @param {variable} String The variable name to check + * @param {string} variable The variable name to check * @returns {Boolean} True if createElement is destructured from the pragma */ isDestructuredFromPragmaImport: function(variable) { @@ -351,7 +351,7 @@ function componentRule(rule, context) { * Check if the node is returning JSX * * @param {ASTNode} ASTnode The AST node being checked - * @param {Boolean} strict If true, in a ternary condition the node must return JSX in both cases + * @param {Boolean} [strict] If true, in a ternary condition the node must return JSX in both cases * @returns {Boolean} True if the node is returning JSX, false if not */ isReturningJSX: function(ASTnode, strict) { @@ -413,7 +413,7 @@ function componentRule(rule, context) { * Check if the node is returning JSX or null * * @param {ASTNode} ASTnode The AST node being checked - * @param {Boolean} strict If true, in a ternary condition the node must return JSX in both cases + * @param {Boolean} [strict] If true, in a ternary condition the node must return JSX in both cases * @returns {Boolean} True if the node is returning JSX or null, false if not */ isReturningJSXOrNull(ASTNode, strict) { diff --git a/lib/util/annotations.js b/lib/util/annotations.js index 47f53fe56c..9586cec8c9 100644 --- a/lib/util/annotations.js +++ b/lib/util/annotations.js @@ -8,6 +8,7 @@ /** * Checks if we are declaring a `props` argument with a flow type annotation. * @param {ASTNode} node The AST node being checked. + * @param {Object} context * @returns {Boolean} True if the node is a type annotated props declaration, false if not. */ function isAnnotatedFunctionPropsDeclaration(node, context) { diff --git a/lib/util/ast.js b/lib/util/ast.js index 530c889e7f..746bdb9ade 100644 --- a/lib/util/ast.js +++ b/lib/util/ast.js @@ -6,7 +6,7 @@ /** * Find a return statment in the current node * - * @param {ASTNode} ASTnode The AST node being checked + * @param {ASTNode} node The AST node being checked */ function findReturnStatement(node) { if ( @@ -114,7 +114,7 @@ function isNodeFirstInLine(context, node) { /** * Checks if the node is a function or arrow function expression. - * @param {Object} context The node to check + * @param {ASTNode} node The node to check * @return {Boolean} true if it's a function-like expression */ function isFunctionLikeExpression(node) { @@ -123,7 +123,7 @@ function isFunctionLikeExpression(node) { /** * Checks if the node is a function. - * @param {Object} context The node to check + * @param {ASTNode} node The node to check * @return {Boolean} true if it's a function */ function isFunction(node) { @@ -132,7 +132,7 @@ function isFunction(node) { /** * Checks if the node is an arrow function. - * @param {Object} context The node to check + * @param {ASTNode} node The node to check * @return {Boolean} true if it's an arrow function */ function isArrowFunction(node) { @@ -141,7 +141,7 @@ function isArrowFunction(node) { /** * Checks if the node is a class. - * @param {Object} context The node to check + * @param {ASTNode} node The node to check * @return {Boolean} true if it's a class */ function isClass(node) { diff --git a/lib/util/defaultProps.js b/lib/util/defaultProps.js index 4b39c61c43..b7287e4b90 100644 --- a/lib/util/defaultProps.js +++ b/lib/util/defaultProps.js @@ -70,7 +70,7 @@ module.exports = function defaultPropsInstructions(context, components, utils) { /** * Adds defaultProps to the component passed in. * @param {ASTNode} component The component to add the defaultProps to. - * @param {String[]|String} defaultProps defaultProps to add to the component or the string "unresolved" + * @param {Object[]|'unresolved'} defaultProps defaultProps to add to the component or the string "unresolved" * if this component has defaultProps that can't be resolved. * @returns {void} */ diff --git a/lib/util/linkComponents.js b/lib/util/linkComponents.js index 4abf502396..cb9847d1f0 100644 --- a/lib/util/linkComponents.js +++ b/lib/util/linkComponents.js @@ -3,12 +3,17 @@ */ 'use strict'; +/** TODO: type {(string | { name: string, linkAttribute: string })[]} */ +/** @type {any} */ const DEFAULT_LINK_COMPONENTS = ['a']; const DEFAULT_LINK_ATTRIBUTE = 'href'; function getLinkComponents(context) { const settings = context.settings || {}; - return new Map(DEFAULT_LINK_COMPONENTS.concat(settings.linkComponents || []).map(value => { + const linkComponents = /** @type {typeof DEFAULT_LINK_COMPONENTS} */ ( + DEFAULT_LINK_COMPONENTS.concat(settings.linkComponents || []) + ); + return new Map(linkComponents.map(value => { if (typeof value === 'string') { return [value, DEFAULT_LINK_ATTRIBUTE]; } diff --git a/lib/util/propTypes.js b/lib/util/propTypes.js index 8d47b2563b..8485591822 100644 --- a/lib/util/propTypes.js +++ b/lib/util/propTypes.js @@ -26,7 +26,7 @@ function isSuperTypeParameterPropsDeclaration(node) { /** * Removes quotes from around an identifier. - * @param {string} the identifier to strip + * @param {string} string the identifier to strip */ function stripQuotes(string) { return string.replace(/^\'|\'$/g, ''); @@ -34,6 +34,7 @@ function stripQuotes(string) { /** * Retrieve the name of a key node + * @param {Context} context The AST node with the key. * @param {ASTNode} node The AST node with the key. * @return {string} the name of the key */ @@ -51,6 +52,7 @@ function getKeyValue(context, node) { /** * Iterates through a properties node, like a customized forEach. + * @param {Object} context Array of properties to iterate. * @param {Object[]} properties Array of properties to iterate. * @param {Function} fn Function to call on each property, receives property key and property value. (key, value) => void @@ -134,6 +136,7 @@ module.exports = function propTypesInstructions(context, components, utils) { } /* eslint-disable no-use-before-define */ + /** @type {TypeDeclarationBuilders} */ const typeDeclarationBuilders = { GenericTypeAnnotation: function(annotation, parentName, seen) { if (getInTypeScope(annotation.id.name)) { @@ -170,6 +173,7 @@ module.exports = function propTypesInstructions(context, components, utils) { }, UnionTypeAnnotation: function(annotation, parentName, seen) { + /** @type {UnionTypeDefinition} */ const unionTypeDefinition = { type: 'union', children: [] @@ -185,9 +189,9 @@ module.exports = function propTypesInstructions(context, components, utils) { } } - unionTypeDefinition.children.push(type); + /** @type {UnionTypeDefinitionChildren} */(unionTypeDefinition.children).push(type); } - if (unionTypeDefinition.children.length === 0) { + if (/** @type {UnionTypeDefinitionChildren} */(unionTypeDefinition.children).length === 0) { // no complex type found, simply accept everything return {}; } @@ -236,6 +240,8 @@ module.exports = function propTypesInstructions(context, components, utils) { * Creates the representation of the React props type annotation for the component. * The representation is used to verify nested used properties. * @param {ASTNode} annotation Type annotation for the props class property. + * @param {String} parentName + * @param {Set} [seen] * @return {Object} The representation of the declaration, empty object means * the property is declared without the need for further analysis. */ @@ -325,6 +331,7 @@ module.exports = function propTypesInstructions(context, components, utils) { * Creates the representation of the React propTypes for the component. * The representation is used to verify nested used properties. * @param {ASTNode} value Node of the PropTypes for the desired property + * @param {string} parentName * @return {Object} The representation of the declaration, empty object means * the property is declared without the need for further analysis. */ @@ -402,6 +409,8 @@ module.exports = function propTypesInstructions(context, components, utils) { // Invalid proptype or cannot analyse statically return {}; } + + /** @type {UnionTypeDefinition} */ const unionTypeDefinition = { type: 'union', children: [] @@ -417,9 +426,9 @@ module.exports = function propTypesInstructions(context, components, utils) { } } - unionTypeDefinition.children.push(type); + /** @type {UnionTypeDefinitionChildren} */(unionTypeDefinition.children).push(type); } - if (unionTypeDefinition.length === 0) { + if (/** @type {UnionTypeDefinitionChildren} */(unionTypeDefinition.children).length === 0) { // no complex type found, simply accept everything return {}; } @@ -443,7 +452,7 @@ module.exports = function propTypesInstructions(context, components, utils) { /** * Mark a prop type as declared * @param {ASTNode} node The AST node being checked. - * @param {propTypes} node The AST node containing the proptypes + * @param {ASTNode} propTypes The AST node containing the proptypes */ function markPropTypesAsDeclared(node, propTypes) { let componentNode = node; diff --git a/lib/util/props.js b/lib/util/props.js index 66f6042fff..f8b7171b30 100644 --- a/lib/util/props.js +++ b/lib/util/props.js @@ -65,7 +65,7 @@ function isDefaultPropsDeclaration(node) { /** * Checks if we are declaring a display name - * @param {node} node The AST node being checked. + * @param {ASTNode} node The AST node being checked. * @returns {Boolean} True if we are declaring a display name, false if not. */ function isDisplayNameDeclaration(node) { diff --git a/lib/util/usedPropTypes.js b/lib/util/usedPropTypes.js index aea9f8093e..f57d2e636b 100755 --- a/lib/util/usedPropTypes.js +++ b/lib/util/usedPropTypes.js @@ -90,7 +90,7 @@ module.exports = function usedPropTypesInstructions(context, components, utils) * @return {Boolean} True if the node is a lifecycle method */ function isNodeALifeCycleMethod(node) { - const nodeKeyName = (node.key || {}).name; + const nodeKeyName = (node.key || /** @type {ASTNode} */ ({})).name; if (node.kind === 'constructor') { return true; @@ -177,7 +177,7 @@ module.exports = function usedPropTypesInstructions(context, components, utils) /** * Removes quotes from around an identifier. - * @param {string} the identifier to strip + * @param {string} string the identifier to strip */ function stripQuotes(string) { return string.replace(/^\'|\'$/g, ''); @@ -203,7 +203,7 @@ module.exports = function usedPropTypesInstructions(context, components, utils) /** * Retrieve the name of a property node * @param {ASTNode} node The AST node with the property. - * @return {string} the name of the property or undefined if not found + * @return {string|undefined} the name of the property or undefined if not found */ function getPropertyName(node) { const isDirectProp = DIRECT_PROPS_REGEX.test(sourceCode.getText(node)); @@ -283,6 +283,7 @@ module.exports = function usedPropTypesInstructions(context, components, utils) /** * Mark a prop type as used * @param {ASTNode} node The AST node being marked. + * @param {string[]} [parentNames] */ function markPropTypesAsUsed(node, parentNames) { parentNames = parentNames || []; diff --git a/lib/util/variable.js b/lib/util/variable.js index 30137c8364..73b761c164 100644 --- a/lib/util/variable.js +++ b/lib/util/variable.js @@ -7,7 +7,7 @@ /** * Search a particular variable in a list * @param {Array} variables The variables list. - * @param {Array} name The name of the variable to search. + * @param {string} name The name of the variable to search. * @returns {Boolean} True if the variable was found, false if not. */ function findVariable(variables, name) { @@ -17,7 +17,7 @@ function findVariable(variables, name) { /** * Find and return a particular variable in a list * @param {Array} variables The variables list. - * @param {Array} name The name of the variable to search. + * @param {string} name The name of the variable to search. * @returns {Object} Variable if the variable was found, null if not. */ function getVariable(variables, name) { diff --git a/package.json b/package.json index b88898512c..0c499017e3 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,10 @@ "scripts": { "coveralls": "cat ./reports/coverage/lcov.info | coveralls", "lint": "eslint ./", + "postlint": "npm run type-check", "pretest": "npm run lint", "test": "npm run unit-test", + "type-check": "tsc", "unit-test": "istanbul cover --dir reports/coverage node_modules/mocha/bin/_mocha tests/lib/**/*.js tests/util/**/*.js tests/index.js" }, "files": [ @@ -33,6 +35,9 @@ "resolve": "^1.10.1" }, "devDependencies": { + "@types/eslint": "^4.16.6", + "@types/estree": "0.0.39", + "@types/node": "^12.0.0", "babel-eslint": "^8.2.6", "coveralls": "^3.0.2", "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0", diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000000..a8ecf2b575 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "target": "ES2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + // "lib": ["es2015"], /* Specify library files to be included in the compilation. */ + "allowJs": true, /* Allow javascript files to be compiled. */ + "checkJs": true, /* Report errors in .js files. */ + "noEmit": true, /* Do not emit outputs. */ + "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + + /* Strict Type-Checking Options */ + // "strict": true, /* Enable all strict type-checking options. */ + "noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + "strictFunctionTypes": true, /* Enable strict checking of function types. */ + "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ + "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + "alwaysStrict": false, /* Parse in strict mode and emit "use strict" for each source file. */ + }, + "include": ["lib"], +}