From a8b1a1512d946617d526bcc4a99a9d20f73dd4cc Mon Sep 17 00:00:00 2001 From: Astrian Zheng Date: Fri, 16 May 2025 19:48:50 +1000 Subject: [PATCH] chore: linting the files --- biome.json | 2 +- package.json | 64 +++++++------- rollup.config.js | 38 ++++----- src/main.ts | 92 ++++++++++---------- tsconfig.json | 218 +++++++++++++++++++++++------------------------ 5 files changed, 208 insertions(+), 206 deletions(-) diff --git a/biome.json b/biome.json index 089d265..c7f4c63 100644 --- a/biome.json +++ b/biome.json @@ -28,4 +28,4 @@ "semicolons": "asNeeded" } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index 414ce86..0d1b38a 100644 --- a/package.json +++ b/package.json @@ -1,34 +1,34 @@ { - "name": "laterano", - "version": "0.0.1", - "main": "dist/main.min.js", - "types": "dist/types.d.ts", - "module": "dist/main.min.js", - "scripts": { - "build": "tsc && rollup -c && npm run cleanup-intermediate", - "prepare": "npm run build", - "cleanup-intermediate": "rimraf dist/main.js dist/types" - }, - "repository": { - "type": "git", - "url": "git@git.nas.astrian.moe:Astrian/Laterano.git" - }, - "author": "", - "license": "MIT", - "description": "", - "devDependencies": { - "@biomejs/biome": "1.9.4", - "@rollup/plugin-node-resolve": "^16.0.1", - "@rollup/plugin-terser": "^0.4.4", - "@rollup/plugin-typescript": "^12.1.2", - "dts-bundle-generator": "^9.5.1", - "i": "^0.3.7", - "npm": "^11.4.0", - "rimraf": "^6.0.1", - "rollup": "^4.40.2", - "rollup-plugin-dts": "^6.2.1", - "tslib": "^2.8.1", - "typescript": "^5.8.3" - }, - "type": "module" + "name": "laterano", + "version": "0.0.1", + "main": "dist/main.min.js", + "types": "dist/types.d.ts", + "module": "dist/main.min.js", + "scripts": { + "build": "tsc && rollup -c && npm run cleanup-intermediate", + "prepare": "npm run build", + "cleanup-intermediate": "rimraf dist/main.js dist/types" + }, + "repository": { + "type": "git", + "url": "git@git.nas.astrian.moe:Astrian/Laterano.git" + }, + "author": "", + "license": "MIT", + "description": "", + "devDependencies": { + "@biomejs/biome": "1.9.4", + "@rollup/plugin-node-resolve": "^16.0.1", + "@rollup/plugin-terser": "^0.4.4", + "@rollup/plugin-typescript": "^12.1.2", + "dts-bundle-generator": "^9.5.1", + "i": "^0.3.7", + "npm": "^11.4.0", + "rimraf": "^6.0.1", + "rollup": "^4.40.2", + "rollup-plugin-dts": "^6.2.1", + "tslib": "^2.8.1", + "typescript": "^5.8.3" + }, + "type": "module" } diff --git a/rollup.config.js b/rollup.config.js index b4dfc12..9479f56 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -4,23 +4,23 @@ import terser from '@rollup/plugin-terser' import dts from 'rollup-plugin-dts' export default [ - { - input: 'dist/main.js', - output: [ - { - file: 'dist/main.min.js', - format: 'esm', - plugins: [terser()], - }, - ], - plugins: [resolve(), typescript()], - }, - { - input: 'dist/types/main.d.ts', - output: { - file: 'dist/types.d.ts', - format: 'es', - }, - plugins: [dts()], - }, + { + input: 'dist/main.js', + output: [ + { + file: 'dist/main.min.js', + format: 'esm', + plugins: [terser()], + }, + ], + plugins: [resolve(), typescript()], + }, + { + input: 'dist/types/main.d.ts', + output: { + file: 'dist/types.d.ts', + format: 'es', + }, + plugins: [dts()], + }, ] diff --git a/src/main.ts b/src/main.ts index 464c853..9b3bd25 100644 --- a/src/main.ts +++ b/src/main.ts @@ -66,7 +66,11 @@ export default (options: ComponentOptions) => { this._states = new Proxy( { ...(states || {}) }, { - set: (target: Record, keyPath: string, value: unknown) => { + set: ( + target: Record, + keyPath: string, + value: unknown, + ) => { const valueRoute = keyPath.split('.') let currentTarget = target for (const i in valueRoute) { @@ -74,8 +78,7 @@ export default (options: ComponentOptions) => { if (Number.parseInt(i) === valueRoute.length - 1) { currentTarget[key] = value } else { - if (!currentTarget[key]) - currentTarget[key] = {} + if (!currentTarget[key]) currentTarget[key] = {} currentTarget = currentTarget[key] as Record } } @@ -113,8 +116,7 @@ export default (options: ComponentOptions) => { if (Number.parseInt(i) === valueRoute.length - 1) return currentTarget[key] - if (!currentTarget[key]) - currentTarget[key] = {} + if (!currentTarget[key]) currentTarget[key] = {} currentTarget = currentTarget[key] as Record } return undefined @@ -192,19 +194,19 @@ export default (options: ComponentOptions) => { if (value !== undefined) binding.element.setAttribute(binding.attrName, String(value)) } - } } private _scheduleUpdate(elements: Set) { requestAnimationFrame(() => { - for (const element of elements) - this._updateElement(element) + for (const element of elements) this._updateElement(element) }) } private _updateElement(element: HTMLElement) { - const renderFunction = (element as { _renderFunction?: () => string | Node })._renderFunction + const renderFunction = ( + element as { _renderFunction?: () => string | Node } + )._renderFunction if (renderFunction) { // Set rendering context this._currentRenderingElement = element @@ -213,8 +215,7 @@ export default (options: ComponentOptions) => { const result = renderFunction() // Update DOM - if (typeof result === 'string') - element.innerHTML = result + if (typeof result === 'string') element.innerHTML = result else if (result instanceof Node) { element.innerHTML = '' element.appendChild(result) @@ -349,11 +350,19 @@ export default (options: ComponentOptions) => { eventName, handlerValue, ) - } else if (typeof (this as Record)[handlerValue] === 'function') { + } else if ( + typeof (this as Record)[handlerValue] === + 'function' + ) { // Handle method reference: @click="handleClick" currentElementNode.addEventListener( eventName, - ((this as unknown as Record void>)[handlerValue]).bind(this), + ( + this as unknown as Record< + string, + (...args: unknown[]) => void + > + )[handlerValue].bind(this), ) } else { // Handle simple expression: @click="count++" or @input="name = $event.target.value" @@ -427,8 +436,7 @@ export default (options: ComponentOptions) => { this._statesListeners[expr] = (newValue: unknown) => { if (element instanceof HTMLInputElement) element.value = newValue as string - else - element.setAttribute('data-laterano-connect', String(newValue)) + else element.setAttribute('data-laterano-connect', String(newValue)) } } @@ -510,15 +518,14 @@ export default (options: ComponentOptions) => { const keyAttr = template.getAttribute('%key') if (!keyAttr) console.warn( - '%key attribute not found in the template, which is not a recommended practice.' + '%key attribute not found in the template, which is not a recommended practice.', ) // Store a map of existing items by key for reuse const existingElementsByKey = new Map() // renderedItems.forEach((item) => { for (const item of renderedItems) - if (item.key !== undefined) - existingElementsByKey.set(item.key, item) + if (item.key !== undefined) existingElementsByKey.set(item.key, item) // Clear rendered items renderedItems.length = 0 @@ -531,12 +538,12 @@ export default (options: ComponentOptions) => { // Determine the key for this item const key = keyAttr ? this._evaluateExpressionWithItemContext( - keyAttr ?? '', - item, - index, - itemVar, - indexVar ? indexVar : undefined, - ) + keyAttr ?? '', + item, + index, + itemVar, + indexVar ? indexVar : undefined, + ) : index // Check if we can reuse an existing element @@ -621,7 +628,8 @@ export default (options: ComponentOptions) => { itemContext: Record, ) { // 1. Store the item context of the element so that subsequent updates can find it - ; (element as { _itemContext?: Record })._itemContext = itemContext + ;(element as { _itemContext?: Record })._itemContext = + itemContext // 2. Process bindings in text nodes const processTextNodes = (node: Node) => { @@ -647,8 +655,7 @@ export default (options: ComponentOptions) => { // Process the text nodes of the element itself // Array.from(element.childNodes).forEach((node) => { for (const node of Array.from(element.childNodes)) - if (node.nodeType === Node.TEXT_NODE) - processTextNodes(node) + if (node.nodeType === Node.TEXT_NODE) processTextNodes(node) // 3. Process attribute bindings (:attr) // Array.from(element.attributes).forEach((attr) => { @@ -661,8 +668,7 @@ export default (options: ComponentOptions) => { itemContext, ) - if (value !== undefined) - element.setAttribute(attrName, String(value)) + if (value !== undefined) element.setAttribute(attrName, String(value)) // Remove the original binding attribute (execute only for cloned templates once) element.removeAttribute(attr.name) @@ -724,8 +730,7 @@ export default (options: ComponentOptions) => { shouldDisplay = Boolean(result) // Apply the condition (in the list item context, we use display style to simplify) - if (!shouldDisplay) - (element as HTMLElement).style.display = 'none' + if (!shouldDisplay) (element as HTMLElement).style.display = 'none' } } @@ -753,8 +758,7 @@ export default (options: ComponentOptions) => { } // If this element is a list element, skip child element processing (they will be processed by the list processor) - if (hasForDirective) - return + if (hasForDirective) return // 7. Recursively process all child elements // Array.from(element.children).forEach((child) => { @@ -853,9 +857,8 @@ export default (options: ComponentOptions) => { let value = itemContext[itemVar] for (const part of parts) { - if (value === undefined || value === null) - return undefined - value = (value as { [key: string]: unknown})[part] + if (value === undefined || value === null) return undefined + value = (value as { [key: string]: unknown })[part] } return value @@ -954,8 +957,7 @@ export default (options: ComponentOptions) => { throw new Error(`Invalid arrow function syntax: ${handlerValue}`) } const paramsStr = (() => { - if (splitted[0].includes('(')) - return splitted[0].trim() + if (splitted[0].includes('(')) return splitted[0].trim() return `(${splitted[0].trim()})` })() const bodyStr = splitted[1].trim() @@ -1028,12 +1030,16 @@ export default (options: ComponentOptions) => { // Add all methods of the component // Object.getOwnPropertyNames(Object.getPrototypeOf(this)).forEach( // (name) => { - for (const name of Object.getOwnPropertyNames(Object.getPrototypeOf(this))) + for (const name of Object.getOwnPropertyNames( + Object.getPrototypeOf(this), + )) if ( typeof (this as Record)[name] === 'function' && name !== 'constructor' ) - context[name] = (this as unknown as Record void>)[name].bind(this) + context[name] = ( + this as unknown as Record void> + )[name].bind(this) return context } @@ -1151,8 +1157,7 @@ export default (options: ComponentOptions) => { let result = this._states for (const part of parts) { - if (result === undefined || result === null) - return undefined + if (result === undefined || result === null) return undefined result = (result as { [key: string]: Record })[part] } @@ -1188,8 +1193,7 @@ export default (options: ComponentOptions) => { const parts = keyPath.split('.') let result = this._states for (const part of parts) { - if (result === undefined || result === null) - return undefined + if (result === undefined || result === null) return undefined result = (result as { [key: string]: Record })[part] } return result diff --git a/tsconfig.json b/tsconfig.json index c52e443..eb72527 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,120 +1,118 @@ { - "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - /* Language and Environment */ - "target": "ES6", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - "lib": ["DOM", "ES2024"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "libReplacement": true, /* Enable lib replacement. */ - // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + /* Language and Environment */ + "target": "ES6" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, + "lib": [ + "DOM", + "ES2024" + ] /* Specify a set of bundled library declaration files that describe the target runtime environment. */, + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "libReplacement": true, /* Enable lib replacement. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - /* Modules */ - "module": "ES2022", /* Specify what module code is generated. */ - // "rootDir": "./", /* Specify the root folder within your source files. */ - // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": ["./src/types"], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ - // "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */ - // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ - // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ - // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ - // "noUncheckedSideEffectImports": true, /* Check side effect imports. */ - // "resolveJsonModule": true, /* Enable importing .json files. */ - // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + /* Modules */ + "module": "ES2022" /* Specify what module code is generated. */, + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": ["./src/types"], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "noUncheckedSideEffectImports": true, /* Check side effect imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - /* JavaScript Support */ - // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - /* Emit */ - "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - "outDir": "./dist", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - "declarationDir": "./dist/types", /* Specify the output directory for generated declaration files. */ + /* Emit */ + "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */, + "declarationMap": true /* Create sourcemaps for d.ts files. */, + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + "outDir": "./dist" /* Specify an output folder for all emitted files. */, + // "removeComments": true, /* Disable emitting comments. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + "declarationDir": "./dist/types" /* Specify the output directory for generated declaration files. */, - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ - // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */ - // "erasableSyntaxOnly": true, /* Do not allow runtime constructs that are not part of ECMAScript. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */ + // "erasableSyntaxOnly": true, /* Do not allow runtime constructs that are not part of ECMAScript. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, - /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ - // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + /* Type Checking */ + "strict": true /* Enable all strict type-checking options. */, + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ - }, - "include": [ - "./src/**/*" - ], - "exclude": [ - "node_modules", - "dist" - ], + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + }, + "include": ["./src/**/*"], + "exclude": ["node_modules", "dist"] }