tslint-plugin-emotion
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "tslint-plugin-emotion", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"main": "tslint-emotion.json", | ||
@@ -5,0 +5,0 @@ "repository": "git@github.com:Werter12/tslint-plugin-emotion.git", |
@@ -62,4 +62,5 @@ "use strict"; | ||
var literalExpressionFixed = false; | ||
var cssAttribute = { | ||
var cssAttributes = { | ||
has: false, | ||
nodes: [], | ||
}; | ||
@@ -69,5 +70,6 @@ var cb = function (node) { | ||
if (node.name.escapedText === "css") { | ||
if (!cssAttribute.has) { | ||
cssAttribute.has = true; | ||
if (!cssAttributes.has) { | ||
cssAttributes.has = true; | ||
} | ||
cssAttributes.nodes.push(node.name); | ||
var initializer = node.initializer; | ||
@@ -84,3 +86,3 @@ if (initializer && tsutils_1.isJsxExpression(initializer) && initializer.expression | ||
ts.forEachChild(sourceFile, cb); | ||
if (!cssAttribute.has) { | ||
if (!cssAttributes.has) { | ||
return; | ||
@@ -120,3 +122,8 @@ } | ||
} | ||
return this.addFailure(0, 1, Rule.FAILURE_STRING, Lint.Replacement.appendText(0, "" + pragmaCommentString + importString + "\n")); | ||
if (cssAttributes.nodes.length) { | ||
cssAttributes.nodes.forEach(function (cssAttribute) { | ||
_this.addFailureAtNode(cssAttribute, Rule.FAILURE_STRING, Lint.Replacement.appendText(0, "" + pragmaCommentString + importString + "\n")); | ||
}); | ||
return; | ||
} | ||
} | ||
@@ -123,0 +130,0 @@ }; |
@@ -38,3 +38,3 @@ "use strict"; | ||
type: "functionality", | ||
hasFix: false, | ||
hasFix: true, | ||
typescriptOnly: true, | ||
@@ -41,0 +41,0 @@ }; |
@@ -5,3 +5,3 @@ { | ||
"import-from-emotion": true, | ||
"no-vanilla": true, | ||
"no-vanilla": false, | ||
"syntax-preference": false, | ||
@@ -8,0 +8,0 @@ "jsx-import": true |
23434
438