build: enable TSLint on the packages folder
This commit is contained in:

committed by
Alex Rickabaugh

parent
e64b54b67b
commit
9479a106bb
@ -63,7 +63,7 @@ function transformSourceFile(
|
||||
const result = ts.visitEachChild(node, visitNode, context);
|
||||
|
||||
if (declarations.length) {
|
||||
inserts.push({priorTo: result, declarations})
|
||||
inserts.push({priorTo: result, declarations});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -113,7 +113,7 @@ export function getExpressionLoweringTransformFactory(requestsMap: RequestsMap):
|
||||
return (context: ts.TransformationContext) => (sourceFile: ts.SourceFile): ts.SourceFile => {
|
||||
const requests = requestsMap.getRequests(sourceFile);
|
||||
if (requests && requests.size) {
|
||||
return transformSourceFile(sourceFile, requests, context)
|
||||
return transformSourceFile(sourceFile, requests, context);
|
||||
}
|
||||
return sourceFile;
|
||||
};
|
||||
@ -155,12 +155,11 @@ export class LowerMetadataCache implements RequestsMap {
|
||||
let identNumber = 0;
|
||||
const freshIdent = () => '\u0275' + identNumber++;
|
||||
const requests = new Map<number, LoweringRequest>();
|
||||
const replaceNode =
|
||||
(node: ts.Node) => {
|
||||
const name = freshIdent();
|
||||
requests.set(node.pos, {name, kind: node.kind, location: node.pos, end: node.end});
|
||||
return {__symbolic: 'reference', name};
|
||||
}
|
||||
const replaceNode = (node: ts.Node) => {
|
||||
const name = freshIdent();
|
||||
requests.set(node.pos, {name, kind: node.kind, location: node.pos, end: node.end});
|
||||
return {__symbolic: 'reference', name};
|
||||
};
|
||||
|
||||
const substituteExpression = (value: MetadataValue, node: ts.Node): MetadataValue => {
|
||||
if (node.kind === ts.SyntaxKind.ArrowFunction ||
|
||||
|
@ -9,8 +9,7 @@
|
||||
import * as path from 'path';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
import {ModuleFilenameResolver} from './api';
|
||||
import {CompilerOptions} from './api';
|
||||
import {CompilerOptions, ModuleFilenameResolver} from './api';
|
||||
|
||||
const EXT = /(\.ts|\.d\.ts|\.js|\.jsx|\.tsx)$/;
|
||||
const DTS = /\.d\.ts$/;
|
||||
|
@ -32,7 +32,7 @@ export class TypeScriptNodeEmitter {
|
||||
}
|
||||
statements[0] = ts.setSyntheticLeadingComments(
|
||||
statements[0],
|
||||
[{kind: ts.SyntaxKind.MultiLineCommentTrivia, text: preamble, pos: -1, end: -1}])
|
||||
[{kind: ts.SyntaxKind.MultiLineCommentTrivia, text: preamble, pos: -1, end: -1}]);
|
||||
}
|
||||
return [newSourceFile, converter.getNodeMap()];
|
||||
}
|
||||
@ -279,7 +279,7 @@ class _NodeEmitterVisitor implements StatementVisitor, ExpressionVisitor {
|
||||
return this.record(
|
||||
expr, ts.createCall(
|
||||
expr.fn.visitExpression(this, null), /* typeArguments */ undefined,
|
||||
expr.args.map(arg => arg.visitExpression(this, null))))
|
||||
expr.args.map(arg => arg.visitExpression(this, null))));
|
||||
}
|
||||
|
||||
visitInstantiateExpr(expr: InstantiateExpr): RecordedNode<ts.NewExpression> {
|
||||
|
@ -15,8 +15,7 @@ import * as ts from 'typescript';
|
||||
import {CompilerHost as AotCompilerHost, CompilerHostContext} from '../compiler_host';
|
||||
import {TypeChecker} from '../diagnostics/check_types';
|
||||
|
||||
import {CompilerHost, CompilerOptions, DiagnosticCategory} from './api';
|
||||
import {Diagnostic, EmitFlags, Program} from './api';
|
||||
import {CompilerHost, CompilerOptions, Diagnostic, DiagnosticCategory, EmitFlags, Program} from './api';
|
||||
import {LowerMetadataCache, getExpressionLoweringTransformFactory} from './lower_expressions';
|
||||
import {getAngularEmitterTransformFactory} from './node_emitter_transform';
|
||||
|
||||
@ -144,7 +143,7 @@ class AngularCompilerProgram implements Program {
|
||||
}
|
||||
|
||||
private get structuralDiagnostics(): Diagnostic[] {
|
||||
return this.analyzedModules && this._structuralDiagnostics
|
||||
return this.analyzedModules && this._structuralDiagnostics;
|
||||
}
|
||||
|
||||
private get stubs(): GeneratedFile[] {
|
||||
@ -171,7 +170,7 @@ class AngularCompilerProgram implements Program {
|
||||
}
|
||||
|
||||
private get generatedFiles(): GeneratedFile[] {
|
||||
return this._generatedFiles || (this._generatedFiles = this.generateFiles())
|
||||
return this._generatedFiles || (this._generatedFiles = this.generateFiles());
|
||||
}
|
||||
|
||||
private get typeChecker(): TypeChecker {
|
||||
@ -343,7 +342,7 @@ function createProgramWithStubsHost(
|
||||
generatedFiles: GeneratedFile[], originalProgram: ts.Program,
|
||||
originalHost: ts.CompilerHost): ts.CompilerHost {
|
||||
interface FileData {
|
||||
g: GeneratedFile
|
||||
g: GeneratedFile;
|
||||
s?: ts.SourceFile;
|
||||
}
|
||||
return new class implements ts.CompilerHost {
|
||||
|
Reference in New Issue
Block a user