@typescript-eslint/typescript-estree
Advanced tools
Comparing version 1.4.1-alpha.6 to 1.4.1
@@ -6,2 +6,6 @@ # Change Log | ||
## [1.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.0...v1.4.1) (2019-02-23) | ||
**Note:** Version bump only for package @typescript-eslint/typescript-estree | ||
# [1.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.3.0...v1.4.0) (2019-02-19) | ||
@@ -8,0 +12,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* @fileoverview Converts TypeScript AST into ESTree format. | ||
* @author Nicholas C. Zakas | ||
* @author James Henry <https://github.com/JamesHenry> | ||
* @copyright jQuery Foundation and other contributors, https://jquery.org/ | ||
* MIT License | ||
*/ | ||
const convert_1 = require("./convert"); | ||
@@ -20,3 +27,3 @@ const convert_comments_1 = require("./convert-comments"); | ||
useJSXTextNode: extra.useJSXTextNode || false, | ||
shouldProvideParserServices, | ||
shouldProvideParserServices | ||
}); | ||
@@ -23,0 +30,0 @@ const estree = instance.convertProgram(); |
@@ -0,1 +1,7 @@ | ||
/** | ||
* @fileoverview Convert comment using TypeScript token scanner | ||
* @author James Henry <https://github.com/JamesHenry> | ||
* @copyright jQuery Foundation and other contributors, https://jquery.org/ | ||
* MIT License | ||
*/ | ||
import ts from 'typescript'; | ||
@@ -2,0 +8,0 @@ import { TSESTree } from './ts-estree'; |
"use strict"; | ||
/** | ||
* @fileoverview Convert comment using TypeScript token scanner | ||
* @author James Henry <https://github.com/JamesHenry> | ||
* @copyright jQuery Foundation and other contributors, https://jquery.org/ | ||
* MIT License | ||
*/ | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -22,3 +28,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
type: block ? 'Block' : 'Line', | ||
value: text, | ||
value: text | ||
}; | ||
@@ -31,3 +37,3 @@ if (typeof start === 'number') { | ||
start: startLoc, | ||
end: endLoc, | ||
end: endLoc | ||
}; | ||
@@ -51,3 +57,3 @@ } | ||
end: triviaScanner.getTextPos(), | ||
kind: triviaScanner.getToken(), | ||
kind: triviaScanner.getToken() | ||
}; | ||
@@ -54,0 +60,0 @@ const comment = code.substring(range.pos, range.end); |
@@ -0,1 +1,8 @@ | ||
/** | ||
* @fileoverview Converts TypeScript AST into ESTree format. | ||
* @author Nicholas C. Zakas | ||
* @author James Henry <https://github.com/JamesHenry> | ||
* @copyright jQuery Foundation and other contributors, https://jquery.org/ | ||
* MIT License | ||
*/ | ||
import ts from 'typescript'; | ||
@@ -2,0 +9,0 @@ import { TSESTree } from './ts-estree'; |
@@ -0,1 +1,7 @@ | ||
/** | ||
* @fileoverview Utilities for finding and converting ts.Nodes into ESTreeNodes | ||
* @author James Henry <https://github.com/JamesHenry> | ||
* @copyright jQuery Foundation and other contributors, https://jquery.org/ | ||
* MIT License | ||
*/ | ||
import ts from 'typescript'; | ||
@@ -85,3 +91,3 @@ import { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree } from './ts-estree'; | ||
*/ | ||
export declare function canContainDirective(node: ts.SourceFile | ts.Block | ts.ModuleBlock): boolean; | ||
export declare function canContainDirective(node: ts.Node): boolean; | ||
/** | ||
@@ -88,0 +94,0 @@ * Returns range for the given ts.Node |
@@ -6,2 +6,8 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* @fileoverview Utilities for finding and converting ts.Nodes into ESTreeNodes | ||
* @author James Henry <https://github.com/JamesHenry> | ||
* @copyright jQuery Foundation and other contributors, https://jquery.org/ | ||
* MIT License | ||
*/ | ||
const typescript_1 = __importDefault(require("typescript")); | ||
@@ -24,7 +30,7 @@ const lodash_unescape_1 = __importDefault(require("lodash.unescape")); | ||
SyntaxKind.BarEqualsToken, | ||
SyntaxKind.CaretEqualsToken, | ||
SyntaxKind.CaretEqualsToken | ||
]; | ||
const LOGICAL_OPERATORS = [ | ||
SyntaxKind.BarBarToken, | ||
SyntaxKind.AmpersandAmpersandToken, | ||
SyntaxKind.AmpersandAmpersandToken | ||
]; | ||
@@ -91,3 +97,3 @@ const TOKEN_TO_TEXT = { | ||
[SyntaxKind.NewKeyword]: 'new', | ||
[SyntaxKind.ImportKeyword]: 'import', | ||
[SyntaxKind.ImportKeyword]: 'import' | ||
}; | ||
@@ -207,3 +213,3 @@ /** | ||
line: loc.line + 1, | ||
column: loc.character, | ||
column: loc.character | ||
}; | ||
@@ -223,3 +229,3 @@ } | ||
start: getLineAndCharacterFor(start, ast), | ||
end: getLineAndCharacterFor(end, ast), | ||
end: getLineAndCharacterFor(end, ast) | ||
}; | ||
@@ -234,17 +240,22 @@ } | ||
function canContainDirective(node) { | ||
if (node.kind === typescript_1.default.SyntaxKind.Block) { | ||
switch (node.parent.kind) { | ||
case typescript_1.default.SyntaxKind.Constructor: | ||
case typescript_1.default.SyntaxKind.GetAccessor: | ||
case typescript_1.default.SyntaxKind.SetAccessor: | ||
case typescript_1.default.SyntaxKind.ArrowFunction: | ||
case typescript_1.default.SyntaxKind.FunctionExpression: | ||
case typescript_1.default.SyntaxKind.FunctionDeclaration: | ||
case typescript_1.default.SyntaxKind.MethodDeclaration: | ||
return true; | ||
default: | ||
return false; | ||
} | ||
switch (node.kind) { | ||
case typescript_1.default.SyntaxKind.SourceFile: | ||
case typescript_1.default.SyntaxKind.ModuleBlock: | ||
return true; | ||
case typescript_1.default.SyntaxKind.Block: | ||
switch (node.parent.kind) { | ||
case typescript_1.default.SyntaxKind.Constructor: | ||
case typescript_1.default.SyntaxKind.GetAccessor: | ||
case typescript_1.default.SyntaxKind.SetAccessor: | ||
case typescript_1.default.SyntaxKind.ArrowFunction: | ||
case typescript_1.default.SyntaxKind.FunctionExpression: | ||
case typescript_1.default.SyntaxKind.FunctionDeclaration: | ||
case typescript_1.default.SyntaxKind.MethodDeclaration: | ||
return true; | ||
default: | ||
return false; | ||
} | ||
default: | ||
return false; | ||
} | ||
return true; | ||
} | ||
@@ -488,3 +499,3 @@ exports.canContainDirective = canContainDirective; | ||
range: [start, end], | ||
loc: getLocFor(start, end, ast), | ||
loc: getLocFor(start, end, ast) | ||
}; | ||
@@ -494,3 +505,3 @@ if (newToken.type === 'RegularExpression') { | ||
pattern: value.slice(1, value.lastIndexOf('/')), | ||
flags: value.slice(value.lastIndexOf('/') + 1), | ||
flags: value.slice(value.lastIndexOf('/') + 1) | ||
}; | ||
@@ -572,3 +583,3 @@ } | ||
column: loc.character, | ||
message, | ||
message | ||
}; | ||
@@ -575,0 +586,0 @@ } |
@@ -10,3 +10,3 @@ import { TSESTree } from './ts-estree'; | ||
} : {}); | ||
export interface ParseAndGenerateServicesResult<T extends ParserOptions> { | ||
interface ParseAndGenerateServicesResult<T extends ParserOptions> { | ||
ast: AST<T>; | ||
@@ -13,0 +13,0 @@ services: ParserServices; |
@@ -6,2 +6,9 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* @fileoverview Parser that converts TypeScript into ESTree format. | ||
* @author Nicholas C. Zakas | ||
* @author James Henry <https://github.com/JamesHenry> | ||
* @copyright jQuery Foundation and other contributors, https://jquery.org/ | ||
* MIT License | ||
*/ | ||
const tsconfig_parser_1 = require("./tsconfig-parser"); | ||
@@ -53,3 +60,3 @@ const semver_1 = __importDefault(require("semver")); | ||
tsconfigRootDir: process.cwd(), | ||
extraFileExtensions: [], | ||
extraFileExtensions: [] | ||
}; | ||
@@ -116,3 +123,3 @@ } | ||
return null; | ||
}, | ||
} | ||
}; | ||
@@ -122,3 +129,3 @@ const program = typescript_1.default.createProgram([FILENAME], { | ||
target: typescript_1.default.ScriptTarget.Latest, | ||
jsx: extra.jsx ? typescript_1.default.JsxEmit.Preserve : undefined, | ||
jsx: extra.jsx ? typescript_1.default.JsxEmit.Preserve : undefined | ||
}, compilerHost); | ||
@@ -216,3 +223,3 @@ const ast = program.getSourceFile(FILENAME); | ||
'Please only submit bug reports when using the officially supported version.', | ||
border, | ||
border | ||
]; | ||
@@ -328,4 +335,4 @@ extra.log(versionWarning.join('\n\n')); | ||
? astMaps.tsNodeToESTreeNodeMap | ||
: undefined, | ||
}, | ||
: undefined | ||
} | ||
}; | ||
@@ -332,0 +339,0 @@ } |
@@ -37,5 +37,3 @@ "use strict"; | ||
*/ | ||
/* istanbul ignore next */ | ||
console.warn(`Warning From TSC: "${e.message}`); | ||
/* istanbul ignore next */ | ||
return undefined; | ||
@@ -42,0 +40,0 @@ } |
@@ -0,1 +1,8 @@ | ||
/** | ||
* @fileoverview The AST node types produced by the parser. | ||
* @author Nicholas C. Zakas | ||
* @author James Henry <https://github.com/JamesHenry> | ||
* @copyright jQuery Foundation and other contributors, https://jquery.org/ | ||
* MIT License | ||
*/ | ||
export declare enum AST_NODE_TYPES { | ||
@@ -2,0 +9,0 @@ ArrayExpression = "ArrayExpression", |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* @fileoverview The AST node types produced by the parser. | ||
* @author Nicholas C. Zakas | ||
* @author James Henry <https://github.com/JamesHenry> | ||
* @copyright jQuery Foundation and other contributors, https://jquery.org/ | ||
* MIT License | ||
*/ | ||
var AST_NODE_TYPES; | ||
@@ -4,0 +11,0 @@ (function (AST_NODE_TYPES) { |
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -16,3 +16,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
allowNonTsExtensions: true, | ||
allowJs: true, | ||
allowJs: true | ||
}; | ||
@@ -33,3 +33,3 @@ /** | ||
code: '', | ||
filePath: '', | ||
filePath: '' | ||
}; | ||
@@ -92,4 +92,3 @@ /** | ||
.getConfigFileParsingDiagnostics() | ||
.filter(diag => diag.category === typescript_1.default.DiagnosticCategory.Error && | ||
diag.code !== 18003); | ||
.filter(diag => diag.category === typescript_1.default.DiagnosticCategory.Error && diag.code !== 18003); | ||
if (configFileDiagnostics.length > 0) { | ||
@@ -106,3 +105,3 @@ diagnosticReporter(configFileDiagnostics[0]); | ||
watchCallbackTrackingMap.delete(normalizedFileName); | ||
}, | ||
} | ||
}; | ||
@@ -109,0 +108,0 @@ }; |
{ | ||
"name": "@typescript-eslint/typescript-estree", | ||
"version": "1.4.1-alpha.6+9a88363", | ||
"version": "1.4.1", | ||
"description": "A parser that converts TypeScript source code into an ESTree compatible form", | ||
@@ -47,5 +47,5 @@ "main": "dist/parser.js", | ||
"@babel/types": "^7.3.2", | ||
"@typescript-eslint/shared-fixtures": "1.4.1-alpha.6+9a88363" | ||
"@typescript-eslint/shared-fixtures": "1.4.1" | ||
}, | ||
"gitHead": "9a883635a4b0cbf759d1ae791398933d6fb0d614" | ||
"gitHead": "d362c4a2051ff4128388fc515ba2f07f0ca1a3aa" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
385605
5238
1
0