8000 Fixed linter warnings · sweshgit/TypeScript@c9f5253 · GitHub
[go: up one dir, main page]

Skip to content

Commit c9f5253

Browse files
committed
Fixed linter warnings
1 parent 608822d commit c9f5253

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

src/compiler/emitter.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,6 @@ namespace ts {
288288
}
289289

290290
export function emitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile: SourceFile): EmitResult {
291-
return printFiles(resolver, host, targetSourceFile);
292-
}
293-
294-
// targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature
295-
export function legacyEmitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile: SourceFile): EmitResult {
296291
// emit output for the __extends helper function
297292
const extendsHelper = `
298293
var __extends = (this && this.__extends) || function (d, b) {

src/compiler/factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ namespace ts {
743743
export function createJsxCreateElement(reactNamespace: string, tagName: Expression, props: Expression, children: Expression[]): LeftHandSideExpression {
744744
const argumentsList = [tagName];
745745
if (props) {
746-
argumentsList.push(props)
746+
argumentsList.push(props);
747747
}
748748

749749
if (children && children.length > 0) {

src/compiler/transformers/jsx.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace ts {
4040
function transformJsxChildToExpression(node: JsxChild): Expression {
4141
switch (node.kind) {
4242
case SyntaxKind.JsxText:
43-
return visitNonEmptyJsxText(<JsxText>node);
43+
return visitJsxText(<JsxText>node);
4444

4545
case SyntaxKind.JsxExpression:
4646
return visitJsxExpression(<JsxExpression>node);
@@ -69,7 +69,7 @@ namespace ts {
6969
let objectProperties: Expression;
7070
if (node.attributes.length === 0) {
7171
// When there are no attributes, React wants "null"
72-
objectProperties = createLiteral(null);
72+
objectProperties = createNull();
7373
}
7474
else {
7575
// Either emit one big object literal (no spread attribs), or
@@ -124,7 +124,7 @@ namespace ts {
124124
return createPropertyAssignment(name, expression);
125125
}
126126

127-
function visitNonEmptyJsxText(node: JsxText) {
127+
function visitJsxText(node: JsxText) {
128128
const text = getTextToEmit(node);
129129
if (text !== undefined) {
130130
return createLiteral(text);
@@ -155,7 +155,7 @@ namespace ts {
155155
const c = text.charCodeAt(i);
156156
if (isLineBreak(c)) {
157157
if (firstNonWhitespace !== -1 && (lastNonWhitespace - firstNonWhitespace + 1 > 0)) {
158-
let part = text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1);
158+
const part = text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1);
159159
result = (result ? result + "\" + ' ' + \"" : "") + part;
160160
}
161161
firstNonWhitespace = -1;
@@ -218,11 +218,6 @@ namespace ts {
218218
}
219219
}
220220

221-
function visitJsxText(node: JsxText) {
222-
const text = trimReactWhitespaceAndApplyEntities(node);
223-
return createLiteral(text || "");
224-
}
225-
226221
function visitJsxExpression(node: JsxExpression) {
227222
return visitNode(node.expression, visitor, isExpression);
228223
}

0 commit comments

Comments
 (0)
0