Socket
Socket
Sign inDemoInstall

ts-node

Package Overview
Dependencies
Maintainers
2
Versions
128
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-node - npm Package Compare versions

Comparing version 9.0.0 to 9.1.0

dist-raw//node-cjs-loader-utils.js

2

dist/bin-script-deprecated.js

@@ -6,3 +6,3 @@ #!/usr/bin/env node

console.warn('ts-script has been deprecated and will be removed in the next major release.', 'Please use ts-node-script instead');
bin_1.main(['--script-mode', ...process.argv.slice(2)]);
bin_1.main(undefined, { '--script-mode': true });
//# sourceMappingURL=bin-script-deprecated.js.map

@@ -5,3 +5,3 @@ #!/usr/bin/env node

const bin_1 = require("./bin");
bin_1.main(['--script-mode', ...process.argv.slice(2)]);
bin_1.main(undefined, { '--script-mode': true });
//# sourceMappingURL=bin-script.js.map

@@ -5,3 +5,3 @@ #!/usr/bin/env node

const bin_1 = require("./bin");
bin_1.main(['--transpile-only', ...process.argv.slice(2)]);
bin_1.main(undefined, { '--transpile-only': true });
//# sourceMappingURL=bin-transpile.js.map

@@ -6,32 +6,12 @@ #!/usr/bin/env node

const path_1 = require("path");
const repl_1 = require("repl");
const util_1 = require("util");
const Module = require("module");
const arg = require("arg");
const diff_1 = require("diff");
const vm_1 = require("vm");
const fs_1 = require("fs");
const os_1 = require("os");
const repl_1 = require("./repl");
const index_1 = require("./index");
/**
* Eval filename for REPL/debug.
*/
const EVAL_FILENAME = `[eval].ts`;
/**
* Eval state management.
*/
class EvalState {
constructor(path) {
this.path = path;
this.input = '';
this.output = '';
this.version = 0;
this.lines = 0;
}
}
/**
* Main `bin` functionality.
*/
function main(argv) {
const args = arg({
function main(argv = process.argv.slice(2), entrypointArgs = {}) {
const args = Object.assign(Object.assign({}, entrypointArgs), arg({
// Node.js-like options.

@@ -81,3 +61,3 @@ '--eval': String,

stopAtPositional: true
});
}));
// Only setting defaults for CLI-specific flags

@@ -129,3 +109,5 @@ // Anything passed to `register()` can be `undefined`; `create()` will apply

const scriptPath = args._.length ? path_1.resolve(cwd, args._[0]) : undefined;
const state = new EvalState(scriptPath || path_1.join(cwd, EVAL_FILENAME));
const state = new repl_1.EvalState(scriptPath || path_1.join(cwd, repl_1.EVAL_FILENAME));
const replService = repl_1.createRepl({ state });
const { evalAwarePartialHost } = replService;
// Register the TypeScript compiler instance.

@@ -150,26 +132,7 @@ const service = index_1.register({

require: argsRequire,
readFile: code !== undefined
? (path) => {
if (path === state.path)
return state.input;
try {
return fs_1.readFileSync(path, 'utf8');
}
catch (err) { /* Ignore. */ }
}
: undefined,
fileExists: code !== undefined
? (path) => {
if (path === state.path)
return true;
try {
const stats = fs_1.statSync(path);
return stats.isFile() || stats.isFIFO();
}
catch (err) {
return false;
}
}
: undefined
readFile: code !== undefined ? evalAwarePartialHost.readFile : undefined,
fileExists: code !== undefined ? evalAwarePartialHost.fileExists : undefined
});
// Bind REPL service to ts-node compiler service (chicken-and-egg problem)
replService.setService(service);
// Output project information.

@@ -191,3 +154,3 @@ if (version >= 2) {

if (code !== undefined && !interactive) {
evalAndExit(service, state, module, code, print);
evalAndExit(replService, module, code, print);
}

@@ -202,3 +165,3 @@ else {

if (interactive || process.stdin.isTTY) {
startRepl(service, state, code);
replService.start(code);
}

@@ -208,3 +171,3 @@ else {

process.stdin.on('data', (chunk) => buffer += chunk);
process.stdin.on('end', () => evalAndExit(service, state, module, buffer, print));
process.stdin.on('end', () => evalAndExit(replService, module, buffer, print));
}

@@ -256,3 +219,3 @@ }

*/
function evalAndExit(service, state, module, code, isPrinted) {
function evalAndExit(replService, module, code, isPrinted) {
let result;

@@ -265,3 +228,3 @@ global.__filename = module.filename;

try {
result = _eval(service, state, code);
result = replService.evalCode(code);
}

@@ -279,175 +242,2 @@ catch (error) {

}
/**
* Evaluate the code snippet.
*/
function _eval(service, state, input) {
const lines = state.lines;
const isCompletion = !/\n$/.test(input);
const undo = appendEval(state, input);
let output;
try {
output = service.compile(state.input, state.path, -lines);
}
catch (err) {
undo();
throw err;
}
// Use `diff` to check for new JavaScript to execute.
const changes = diff_1.diffLines(state.output, output);
if (isCompletion) {
undo();
}
else {
state.output = output;
}
return changes.reduce((result, change) => {
return change.added ? exec(change.value, state.path) : result;
}, undefined);
}
/**
* Execute some code.
*/
function exec(code, filename) {
const script = new vm_1.Script(code, { filename: filename });
return script.runInThisContext();
}
/**
* Start a CLI REPL.
*/
function startRepl(service, state, code) {
// Eval incoming code before the REPL starts.
if (code) {
try {
_eval(service, state, `${code}\n`);
}
catch (err) {
console.error(err);
process.exit(1);
}
}
const repl = repl_1.start({
prompt: '> ',
input: process.stdin,
output: process.stdout,
// Mimicking node's REPL implementation: https://github.com/nodejs/node/blob/168b22ba073ee1cbf8d0bcb4ded7ff3099335d04/lib/internal/repl.js#L28-L30
terminal: process.stdout.isTTY && !parseInt(process.env.NODE_NO_READLINE, 10),
eval: replEval,
useGlobal: true
});
/**
* Eval code from the REPL.
*/
function replEval(code, _context, _filename, callback) {
let err = null;
let result;
// TODO: Figure out how to handle completion here.
if (code === '.scope') {
callback(err);
return;
}
try {
result = _eval(service, state, code);
}
catch (error) {
if (error instanceof index_1.TSError) {
// Support recoverable compilations using >= node 6.
if (repl_1.Recoverable && isRecoverable(error)) {
err = new repl_1.Recoverable(error);
}
else {
console.error(error);
}
}
else {
err = error;
}
}
return callback(err, result);
}
// Bookmark the point where we should reset the REPL state.
const resetEval = appendEval(state, '');
function reset() {
resetEval();
// Hard fix for TypeScript forcing `Object.defineProperty(exports, ...)`.
exec('exports = module.exports', state.path);
}
reset();
repl.on('reset', reset);
repl.defineCommand('type', {
help: 'Check the type of a TypeScript identifier',
action: function (identifier) {
if (!identifier) {
repl.displayPrompt();
return;
}
const undo = appendEval(state, identifier);
const { name, comment } = service.getTypeInfo(state.input, state.path, state.input.length);
undo();
if (name)
repl.outputStream.write(`${name}\n`);
if (comment)
repl.outputStream.write(`${comment}\n`);
repl.displayPrompt();
}
});
// Set up REPL history when available natively via node.js >= 11.
if (repl.setupHistory) {
const historyPath = process.env.TS_NODE_HISTORY || path_1.join(os_1.homedir(), '.ts_node_repl_history');
repl.setupHistory(historyPath, err => {
if (!err)
return;
console.error(err);
process.exit(1);
});
}
}
/**
* Append to the eval instance and return an undo function.
*/
function appendEval(state, input) {
const undoInput = state.input;
const undoVersion = state.version;
const undoOutput = state.output;
const undoLines = state.lines;
// Handle ASI issues with TypeScript re-evaluation.
if (undoInput.charAt(undoInput.length - 1) === '\n' && /^\s*[\/\[(`-]/.test(input) && !/;\s*$/.test(undoInput)) {
state.input = `${state.input.slice(0, -1)};\n`;
}
state.input += input;
state.lines += lineCount(input);
state.version++;
return function () {
state.input = undoInput;
state.output = undoOutput;
state.version = undoVersion;
state.lines = undoLines;
};
}
/**
* Count the number of lines.
*/
function lineCount(value) {
let count = 0;
for (const char of value) {
if (char === '\n') {
count++;
}
}
return count;
}
const RECOVERY_CODES = new Set([
1003,
1005,
1109,
1126,
1160,
1161,
2355 // "A function whose declared type is neither 'void' nor 'any' must return a value."
]);
/**
* Check if a function can recover gracefully.
*/
function isRecoverable(error) {
return error.diagnosticCodes.every(code => RECOVERY_CODES.has(code));
}
/** Safe `hasOwnProperty` */

@@ -458,4 +248,4 @@ function hasOwnProperty(object, property) {

if (require.main === module) {
main(process.argv.slice(2));
main();
}
//# sourceMappingURL=bin.js.map
"use strict";
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.create = exports.register = exports.getExtensions = exports.TSError = exports.normalizeSlashes = exports.parse = exports.split = exports.DEFAULTS = exports.VERSION = exports.debug = exports.INSPECT_CUSTOM = exports.REGISTER_INSTANCE = void 0;
exports.create = exports.register = exports.getExtensions = exports.TSError = exports.normalizeSlashes = exports.parse = exports.split = exports.DEFAULTS = exports.VERSION = exports.debug = exports.INSPECT_CUSTOM = exports.REGISTER_INSTANCE = exports.createRepl = void 0;
const path_1 = require("path");

@@ -10,3 +11,7 @@ const sourceMapSupport = require("source-map-support");

const url_1 = require("url");
const Module = require("module");
const module_1 = require("module");
// tslint:disable-next-line
const createRequire = (_a = module_1.createRequire !== null && module_1.createRequire !== void 0 ? module_1.createRequire : module_1.createRequireFromPath) !== null && _a !== void 0 ? _a : require('create-require');
var repl_1 = require("./repl");
Object.defineProperty(exports, "createRepl", { enumerable: true, get: function () { return repl_1.createRepl; } });
/**

@@ -105,3 +110,3 @@ * Does this version of node obey the package.json "type" field

/**
* Default TypeScript compiler options required by `ts-node`.
* TypeScript compiler option values required by `ts-node` which cannot be overridden.
*/

@@ -193,3 +198,3 @@ const TS_NODE_COMPILER_OPTIONS = {

registerExtensions(service.options.preferTsExts, extensions, service, originalJsHandler);
Module._preloadModules(service.options.require);
module_1.Module._preloadModules(service.options.require);
return service;

@@ -230,3 +235,4 @@ }

const fileExists = options.fileExists || ts.sys.fileExists;
const transpileOnly = options.transpileOnly === true || options.typeCheck === false;
// typeCheck can override transpileOnly, useful for CLI flag to override config file
const transpileOnly = options.transpileOnly === true && options.typeCheck !== true;
const transformers = options.transformers || undefined;

@@ -680,6 +686,6 @@ const ignoreDiagnostics = [

*/
function registerExtensions(preferTsExts, extensions, register, originalJsHandler) {
function registerExtensions(preferTsExts, extensions, service, originalJsHandler) {
// Register new extensions.
for (const ext of extensions) {
registerExtension(ext, register, originalJsHandler);
registerExtension(ext, service, originalJsHandler);
}

@@ -696,8 +702,8 @@ if (preferTsExts) {

*/
function registerExtension(ext, register, originalHandler) {
function registerExtension(ext, service, originalHandler) {
const old = require.extensions[ext] || originalHandler; // tslint:disable-line
require.extensions[ext] = function (m, filename) {
if (register.ignored(filename))
if (service.ignored(filename))
return old(m, filename);
if (register.options.experimentalEsmLoader) {
if (service.options.experimentalEsmLoader) {
assertScriptCanLoadAsCJS(filename);

@@ -708,3 +714,3 @@ }

exports.debug('module._compile', fileName);
return _compile.call(this, register.compile(code, fileName), fileName);
return _compile.call(this, service.compile(code, fileName), fileName);
};

@@ -834,10 +840,2 @@ return old(m, filename);

}
let nodeCreateRequire;
function createRequire(filename) {
if (!nodeCreateRequire) {
// tslint:disable-next-line
nodeCreateRequire = Module.createRequire || Module.createRequireFromPath || require('../dist-raw/node-createrequire').createRequireFromPath;
}
return nodeCreateRequire(filename);
}
//# sourceMappingURL=index.js.map
{
"name": "ts-node",
"version": "9.0.0",
"version": "9.1.0",
"description": "TypeScript execution environment and REPL for node.js, with source map support",

@@ -53,4 +53,3 @@ "main": "dist/index.js",

"test-cov": "nyc mocha -- \"dist/**/*.spec.js\" -R spec --bail",
"test": "npm run build && npm run lint && npm run test-cov",
"coverage-fix-paths": "node ./scripts/rewrite-coverage-paths.js",
"test": "npm run build && npm run lint && npm run test-cov --",
"coverage-report": "nyc report --reporter=lcov",

@@ -97,2 +96,3 @@ "prepare": "npm run build-nopack"

"chai": "^4.0.1",
"get-stream": "^6.0.0",
"lodash": "^4.17.15",

@@ -108,3 +108,3 @@ "mocha": "^6.2.2",

"tslint-config-standard": "^9.0.0",
"typescript": "4.0.2",
"typescript": "4.1.2",
"typescript-json-schema": "^0.42.0",

@@ -118,2 +118,3 @@ "util.promisify": "^1.0.1"

"arg": "^4.1.0",
"create-require": "^1.1.0",
"diff": "^4.0.1",

@@ -120,0 +121,0 @@ "make-error": "^1.1.1",

@@ -201,3 +201,3 @@ # ![TypeScript Node](logo.svg?sanitize=true)

* `transformers` `_ts.CustomTransformers | ((p: _ts.Program) => _ts.CustomTransformers)`: An object with transformers or a function that accepts a program and returns an transformers object to pass to TypeScript. Function isn't available with `transpileOnly` flag
* `transformers` `_ts.CustomTransformers | ((p: _ts.Program) => _ts.CustomTransformers)`: An object with transformers or a factory function that accepts a program and returns a transformers object to pass to TypeScript. Factory function cannot be used with `transpileOnly` flag
* `readFile`: Custom TypeScript-compatible file reading function

@@ -294,3 +294,3 @@ * `fileExists`: Custom TypeScript-compatible file existence function

There's also [`ts-node-dev`](https://github.com/whitecolor/ts-node-dev), a modified version of [`node-dev`](https://github.com/fgnass/node-dev) using `ts-node` for compilation and won't restart the process on file change.
There's also [`ts-node-dev`](https://github.com/whitecolor/ts-node-dev), a modified version of [`node-dev`](https://github.com/fgnass/node-dev) using `ts-node` for compilation that will restart the process on file change.

@@ -297,0 +297,0 @@ ## License

@@ -5,2 +5,7 @@ {

"definitions": {
"//": {
"explainer": "https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#overview",
"reference": "https://www.typescriptlang.org/tsconfig",
"reference metadata": "https://github.com/microsoft/TypeScript-Website/blob/v2/packages/tsconfig-reference/scripts/tsconfigRules.ts"
},
"filesDefinition": {

@@ -11,2 +16,3 @@ "properties": {

"type": "array",
"uniqueItems": true,
"items": {

@@ -23,2 +29,3 @@ "type": "string"

"type": "array",
"uniqueItems": true,
"items": {

@@ -35,2 +42,3 @@ "type": "string"

"type": "array",
"uniqueItems": true,
"items": {

@@ -65,12 +73,14 @@ "type": "string"

"charset": {
"description": "The character set of the input files.",
"description": "The character set of the input files. This setting is deprecated.",
"type": "string"
},
"composite": {
"description": "Enables building for project references.",
"type": "boolean"
"description": "Enables building for project references. Requires TypeScript version 3.0 or later.",
"type": "boolean",
"default": true
},
"declaration": {
"description": "Generates corresponding d.ts files.",
"type": "boolean"
"type": "boolean",
"default": false
},

@@ -85,34 +95,45 @@ "declarationDir": {

"diagnostics": {
"description": "Show diagnostic information.",
"description": "Show diagnostic information. This setting is deprecated. See `extendedDiagnostics.`",
"type": "boolean"
},
"disableReferencedProjectLoad": {
"description": "Recommend IDE's to load referenced composite projects dynamically instead of loading them all immediately. Requires TypeScript version 4.0 or later.",
"type": "boolean"
},
"emitBOM": {
"description": "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.",
"type": "boolean"
"type": "boolean",
"default": false
},
"emitDeclarationOnly": {
"description": "Only emit '.d.ts' declaration files.",
"type": "boolean"
"description": "Only emit '.d.ts' declaration files. Requires TypeScript version 2.8 or later.",
"type": "boolean",
"default": false
},
"incremental": {
"description": "Enable incremental compilation.",
"description": "Enable incremental compilation. Requires TypeScript version 3.4 or later.",
"type": "boolean"
},
"tsBuildInfoFile": {
"description": "Specify file to store incremental compilation information.",
"description": "Specify file to store incremental compilation information. Requires TypeScript version 3.4 or later.",
"default": ".tsbuildinfo",
"type": "string"
},
"inlineSourceMap": {
"description": "Emit a single file with source maps instead of having a separate file.",
"type": "boolean"
"description": "Emit a single file with source maps instead of having a separate file. Requires TypeScript version 1.5 or later.",
"type": "boolean",
"default": false
},
"inlineSources": {
"description": "Emit the source alongside the sourcemaps within a single file; requires --inlineSourceMap to be set.",
"type": "boolean"
"description": "Emit the source alongside the sourcemaps within a single file; requires --inlineSourceMap to be set. Requires TypeScript version 1.5 or later.",
"type": "boolean",
"default": false
},
"jsx": {
"description": "Specify JSX code generation: 'preserve', 'react', or 'react-native'.",
"description": "Specify JSX code generation: 'preserve', 'react', 'react-jsx', 'react-jsxdev' or'react-native'. Requires TypeScript version 2.2 or later.",
"enum": [
"preserve",
"react",
"react-jsx",
"react-jsxdev",
"react-native"

@@ -122,11 +143,28 @@ ]

"reactNamespace": {
"description": "Specifies the object invoked for createElement and __spread when targeting 'react' JSX emit.",
"type": "string"
"description": "Specify the object invoked for createElement and __spread when targeting 'react' JSX emit.",
"type": "string",
"default": "React"
},
"jsxFactory": {
"description": "Specify the JSX factory function to use when targeting react JSX emit, e.g. 'React.createElement' or 'h'. Requires TypeScript version 2.1 or later.",
"type": "string",
"default": "React.createElement"
},
"jsxFragmentFactory": {
"description": "Specify the JSX Fragment reference to use for fragements when targeting react JSX emit, e.g. 'React.Fragment' or 'Fragment'. Requires TypeScript version 4.0 or later.",
"type": "string",
"default": "React.Fragment"
},
"jsxImportSource": {
"description": "Declare the module specifier to be used for importing the `jsx` and `jsxs` factory functions when using jsx as \"react-jsx\" or \"react-jsxdev\". Requires TypeScript version 4.1 or later.",
"type": "string",
"default": "react"
},
"listFiles": {
"description": "Print names of files part of the compilation.",
"type": "boolean"
"type": "boolean",
"default": false
},
"mapRoot": {
"description": "Specifies the location where debugger should locate map files instead of generated locations",
"description": "Specify the location where debugger should locate map files instead of generated locations",
"type": "string"

@@ -156,4 +194,20 @@ },

},
"moduleResolution": {
"description": "Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6) .",
"type": "string",
"anyOf": [
{
"enum": [
"Classic",
"Node"
]
},
{
"pattern": "^(([Nn]ode)|([Cc]lassic))$"
}
],
"default": "classic"
},
"newLine": {
"description": "Specifies the end of line sequence to be used when emitting files: 'crlf' (Windows) or 'lf' (Unix).",
"description": "Specifies the end of line sequence to be used when emitting files: 'crlf' (Windows) or 'lf' (Unix). Requires TypeScript version 1.5 or later.",
"type": "string",

@@ -174,18 +228,21 @@ "anyOf": [

"description": "Do not emit output.",
"type": "boolean"
"type": "boolean",
"default": false
},
"noEmitHelpers": {
"description": "Do not generate custom helper functions like __extends in compiled output.",
"type": "boolean"
"description": "Do not generate custom helper functions like __extends in compiled output. Requires TypeScript version 1.5 or later.",
"type": "boolean",
"default": false
},
"noEmitOnError": {
"description": "Do not emit outputs if any type checking errors were reported.",
"type": "boolean"
"description": "Do not emit outputs if any type checking errors were reported. Requires TypeScript version 1.4 or later.",
"type": "boolean",
"default": false
},
"noImplicitAny": {
"description": "Warn on expressions and declarations with an implied 'any' type.",
"description": "Warn on expressions and declarations with an implied 'any' type. Enabling this setting is recommended.",
"type": "boolean"
},
"noImplicitThis": {
"description": "Raise error on 'this' expressions with an implied any type.",
"description": "Raise error on 'this' expressions with an implied any type. Enabling this setting is recommended. Requires TypeScript version 2.0 or later.",
"type": "boolean"

@@ -195,26 +252,34 @@ },

"description": "Report errors on unused locals. Requires TypeScript version 2.0 or later.",
"type": "boolean"
"type": "boolean",
"default": false
},
"noUnusedParameters": {
"description": "Report errors on unused parameters. Requires TypeScript version 2.0 or later.",
"type": "boolean"
"type": "boolean",
"default": false
},
"noLib": {
"description": "Do not include the default library file (lib.d.ts).",
"type": "boolean"
"type": "boolean",
"default": false
},
"noResolve": {
"description": "Do not add triple-slash references or module import targets to the list of compiled files.",
"type": "boolean"
"type": "boolean",
"default": false
},
"noStrictGenericChecks": {
"description": "Disable strict checking of generic signatures in function types.",
"type": "boolean"
"description": "Disable strict checking of generic signatures in function types. Requires TypeScript version 2.4 or later.",
"type": "boolean",
"default": false
},
"skipDefaultLibCheck": {
"type": "boolean"
"description": "Use `skipLibCheck` instead. Skip type checking of default library declaration files.",
"type": "boolean",
"default": false
},
"skipLibCheck": {
"description": "Skip type checking of declaration files. Requires TypeScript version 2.0 or later.",
"type": "boolean"
"description": "Skip type checking of declaration files. Enabling this setting is recommended. Requires TypeScript version 2.0 or later.",
"type": "boolean",
"default": false
},

@@ -231,7 +296,9 @@ "outFile": {

"description": "Do not erase const enum declarations in generated code.",
"type": "boolean"
"type": "boolean",
"default": false
},
"preserveSymlinks": {
"description": "Do not resolve symlinks to their real path; treat a symlinked file like a real one.",
"type": "boolean"
"type": "boolean",
"default": false
},

@@ -244,7 +311,9 @@ "preserveWatchOutput": {

"description": "Stylize errors and messages using color and context (experimental).",
"type": "boolean"
"type": "boolean",
"default": true
},
"removeComments": {
"description": "Do not emit comments to output.",
"type": "boolean"
"type": "boolean",
"default": false
},

@@ -257,7 +326,9 @@ "rootDir": {

"description": "Unconditionally emit imports for unresolved files.",
"type": "boolean"
"type": "boolean",
"default": false
},
"sourceMap": {
"description": "Generates corresponding '.map' file.",
"type": "boolean"
"type": "boolean",
"default": false
},

@@ -269,8 +340,10 @@ "sourceRoot": {

"suppressExcessPropertyErrors": {
"description": "Suppress excess property checks for object literals.",
"type": "boolean"
"description": "Suppress excess property checks for object literals. It is recommended to use @ts-ignore comments instead of enabling this setting.",
"type": "boolean",
"default": false
},
"suppressImplicitAnyIndexErrors": {
"description": "Suppress noImplicitAny errors for indexing objects lacking index signatures.",
"type": "boolean"
"description": "Suppress noImplicitAny errors for indexing objects lacking index signatures. It is recommended to use @ts-ignore comments instead of enabling this setting.",
"type": "boolean",
"default": false
},

@@ -309,2 +382,30 @@ "stripInternal": {

},
"fallbackPolling": {
"description": "Specify the polling strategy to use when the system runs out of or doesn't support native file watchers. Requires TypeScript version 3.8 or later.",
"enum": [
"fixedPollingInterval",
"priorityPollingInterval",
"dynamicPriorityPolling"
]
},
"watchDirectory": {
"description": "Specify the strategy for watching directories under systems that lack recursive file-watching functionality. Requires TypeScript version 3.8 or later.",
"enum": [
"useFsEvents",
"fixedPollingInterval",
"dynamicPriorityPolling"
],
"default": "useFsEvents"
},
"watchFile": {
"description": "Specify the strategy for watching individual files. Requires TypeScript version 3.8 or later.",
"enum": [
"fixedPollingInterval",
"priorityPollingInterval",
"dynamicPriorityPolling",
"useFsEvents",
"useFsEventsOnParentDirectory"
],
"default": "useFsEvents"
},
"experimentalDecorators": {

@@ -318,38 +419,42 @@ "description": "Enables experimental support for ES7 decorators.",

},
"moduleResolution": {
"description": "Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6) .",
"type": "string",
"anyOf": [
{
"enum": [
"Classic",
"Node"
]
},
{
"pattern": "^(([Nn]ode)|([Cc]lassic))$"
}
],
"default": "classic"
"allowUnusedLabels": {
"description": "Do not report errors on unused labels. Requires TypeScript version 1.8 or later.",
"type": "boolean"
},
"allowUnusedLabels": {
"noImplicitReturns": {
"description": "Report error when not all code paths in function return a value. Requires TypeScript version 1.8 or later.",
"type": "boolean",
"description": "Do not report errors on unused labels."
"default": false
},
"noImplicitReturns": {
"description": "Report error when not all code paths in function return a value.",
"noUncheckedIndexedAccess": {
"description": "Add `undefined` to an un-declared field in a type. Requires TypeScript version 4.1 or later.",
"type": "boolean"
},
"noFallthroughCasesInSwitch": {
"description": "Report errors for fallthrough cases in switch statement.",
"type": "boolean"
"description": "Report errors for fallthrough cases in switch statement. Requires TypeScript version 1.8 or later.",
"type": "boolean",
"default": false
},
"allowUnreachableCode": {
"description": "Do not report errors on unreachable code.",
"description": "Do not report errors on unreachable code. Requires TypeScript version 1.8 or later.",
"type": "boolean"
},
"forceConsistentCasingInFileNames": {
"description": "Disallow inconsistently-cased references to the same file.",
"type": "boolean"
"description": "Disallow inconsistently-cased references to the same file. Enabling this setting is recommended.",
"type": "boolean",
"default": false
},
"generateCpuProfile": {
"description": "Emit a v8 CPI profile during the compiler run, which may provide insight into slow builds. Requires TypeScript version 3.7 or later.",
"type": "string",
"default": "profile.cpuprofile"
},
"importNotUsedAsValues": {
"description": "This flag controls how imports work. When set to `remove`, imports that only reference types are dropped. When set to `preserve`, imports are never dropped. When set to `error`, imports that can be replaced with `import type` will result in a compiler error. Requires TypeScript version 3.8 or later.",
"enum": [
"remove",
"preserve",
"error"
]
},
"baseUrl": {

@@ -364,2 +469,3 @@ "description": "Base directory to resolve non-relative module names.",

"type": "array",
"uniqueItems": true,
"items": {

@@ -385,4 +491,5 @@ "type": "string",

"rootDirs": {
"description": "Specify list of root directories to be used when resolving modules.",
"description": "Specify list of root directories to be used when resolving modules. Requires TypeScript version 2.0 or later.",
"type": "array",
"uniqueItems": true,
"items": {

@@ -395,2 +502,3 @@ "type": "string"

"type": "array",
"uniqueItems": true,
"items": {

@@ -403,2 +511,3 @@ "type": "string"

"type": "array",
"uniqueItems": true,
"items": {

@@ -409,15 +518,18 @@ "type": "string"

"traceResolution": {
"description": "Enable tracing of the name resolution process.",
"type": "boolean"
"description": "Enable tracing of the name resolution process. Requires TypeScript version 2.0 or later.",
"type": "boolean",
"default": false
},
"allowJs": {
"description": "Allow javascript files to be compiled.",
"type": "boolean"
"description": "Allow javascript files to be compiled. Requires TypeScript version 1.8 or later.",
"type": "boolean",
"default": false
},
"noErrorTruncation": {
"description": "Do not truncate error messages.",
"type": "boolean"
"description": "Do not truncate error messages. This setting is deprecated.",
"type": "boolean",
"default": false
},
"allowSyntheticDefaultImports": {
"description": "Allow default imports from modules with no default export. This does not affect code emit, just typechecking.",
"description": "Allow default imports from modules with no default export. This does not affect code emit, just typechecking. Requires TypeScript version 1.8 or later.",
"type": "boolean"

@@ -427,7 +539,9 @@ },

"description": "Do not emit 'use strict' directives in module output.",
"type": "boolean"
"type": "boolean",
"default": false
},
"listEmittedFiles": {
"description": "Enable to list all emitted files. Requires TypeScript version 2.0 or later.",
"type": "boolean"
"type": "boolean",
"default": false
},

@@ -442,2 +556,3 @@ "disableSizeLimit": {

"type": "array",
"uniqueItems": true,
"items": {

@@ -536,4 +651,5 @@ "type": "string",

"strictNullChecks": {
"description": "Enable strict null checks. Requires TypeScript version 2.0 or later.",
"type": "boolean"
"description": "Enable strict null checks. Enabling this setting is recommended. Requires TypeScript version 2.0 or later.",
"type": "boolean",
"default": false
},

@@ -547,6 +663,7 @@ "maxNodeModuleJsDepth": {

"description": "Import emit helpers (e.g. '__extends', '__rest', etc..) from tslib. Requires TypeScript version 2.1 or later.",
"type": "boolean"
"type": "boolean",
"default": false
},
"importsNotUsedAsValues": {
"description": "Specify emit/checking behavior for imports that are only used for types",
"description": "Specify emit/checking behavior for imports that are only used for types. Requires TypeScript version 3.8 or later.",
"type": "string",

@@ -560,12 +677,2 @@ "default": "remove",

},
"jsxFactory": {
"description": "Specify the JSX factory function to use when targeting react JSX emit, e.g. 'React.createElement' or 'h'. Requires TypeScript version 2.1 or later.",
"type": "string",
"default": "React.createElement"
},
"jsxFragmentFactory": {
"description": "Specify the JSX Fragment reference to use for fragements when targeting react JSX emit, e.g. 'React.Fragment' or 'Fragment'. Requires TypeScript version 4.0 or later.",
"type": "string",
"default": "React.Fragment"
},
"alwaysStrict": {

@@ -576,51 +683,63 @@ "description": "Parse in strict mode and emit 'use strict' for each source file. Requires TypeScript version 2.1 or later.",

"strict": {
"description": "Enable all strict type checking options. Requires TypeScript version 2.3 or later.",
"type": "boolean"
"description": "Enable all strict type checking options. Enabling this setting is recommended. Requires TypeScript version 2.3 or later.",
"type": "boolean",
"default": false
},
"strictBindCallApply": {
"description": "Enable stricter checking of of the `bind`, `call`, and `apply` methods on functions.",
"type": "boolean"
"description": "Enable stricter checking of of the `bind`, `call`, and `apply` methods on functions. Enabling this setting is recommended. Requires TypeScript version 3.2 or later.",
"type": "boolean",
"default": false
},
"downlevelIteration": {
"description": "Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. Requires TypeScript version 2.3 or later.",
"type": "boolean"
"type": "boolean",
"default": false
},
"checkJs": {
"description": "Report errors in .js files. Requires TypeScript version 2.3 or later.",
"type": "boolean"
"type": "boolean",
"default": false
},
"strictFunctionTypes": {
"description": "Disable bivariant parameter checking for function types. Requires TypeScript version 2.6 or later.",
"type": "boolean"
"description": "Disable bivariant parameter checking for function types. Enabling this setting is recommended. Requires TypeScript version 2.6 or later.",
"type": "boolean",
"default": false
},
"strictPropertyInitialization": {
"description": "Ensure non-undefined class properties are initialized in the constructor. Requires TypeScript version 2.7 or later.",
"type": "boolean"
"description": "Ensure non-undefined class properties are initialized in the constructor. Enabling this setting is recommended. Requires TypeScript version 2.7 or later.",
"type": "boolean",
"default": false
},
"esModuleInterop": {
"description": "Emit '__importStar' and '__importDefault' helpers for runtime babel ecosystem compatibility and enable '--allowSyntheticDefaultImports' for typesystem compatibility. Requires TypeScript version 2.7 or later.",
"type": "boolean"
"description": "Emit '__importStar' and '__importDefault' helpers for runtime babel ecosystem compatibility and enable '--allowSyntheticDefaultImports' for typesystem compatibility. Enabling this setting is recommended. Requires TypeScript version 2.7 or later.",
"type": "boolean",
"default": false
},
"allowUmdGlobalAccess": {
"description": "Allow accessing UMD globals from modules.",
"type": "boolean"
"description": "Allow accessing UMD globals from modules. Requires TypeScript version 3.5 or later.",
"type": "boolean",
"default": false
},
"keyofStringsOnly": {
"description": "Resolve 'keyof' to string valued property names only (no numbers or symbols). Requires TypeScript version 2.9 or later.",
"type": "boolean"
"description": "Resolve 'keyof' to string valued property names only (no numbers or symbols). This setting is deprecated. Requires TypeScript version 2.9 or later.",
"type": "boolean",
"default": false
},
"useDefineForClassFields": {
"description": "Emit ECMAScript standard class fields. Requires TypeScript version 3.7 or later.",
"type": "boolean"
"type": "boolean",
"default": false
},
"declarationMap": {
"description": "Generates a sourcemap for each corresponding '.d.ts' file. Requires TypeScript version 2.9 or later.",
"type": "boolean"
"type": "boolean",
"default": false
},
"resolveJsonModule": {
"description": "Include modules imported with '.json' extension. Requires TypeScript version 2.9 or later.",
"type": "boolean"
"type": "boolean",
"default": false
},
"assumeChangesOnlyAffectDirectDependencies": {
"description": "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it.",
"description": "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it. Requires TypeScript version 3.8 or later.",
"type": "boolean"

@@ -630,3 +749,4 @@ },

"description": "Show verbose diagnostic information.",
"type": "boolean"
"type": "boolean",
"default": false
},

@@ -638,7 +758,7 @@ "listFilesOnly": {

"disableSourceOfProjectReferenceRedirect": {
"description": "Disable use of source files instead of declaration files from referenced projects.",
"description": "Disable use of source files instead of declaration files from referenced projects. Requires TypeScript version 3.7 or later.",
"type": "boolean"
},
"disableSolutionSearching": {
"description": "Disable solution searching for this project.",
"description": "Disable solution searching for this project. Requires TypeScript version 3.8 or later.",
"type": "boolean"

@@ -664,2 +784,3 @@ }

"type": "array",
"uniqueItems": true,
"items": {

@@ -672,2 +793,3 @@ "type": "string"

"type": "array",
"uniqueItems": true,
"items": {

@@ -685,2 +807,3 @@ "type": "string"

"type": "array",
"uniqueItems": true,
"description": "Referenced projects. Requires TypeScript version 3.0 or later.",

@@ -687,0 +810,0 @@ "items": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc