Browse Source

fix doublequotes fixer

CrazyDoctor 2 years ago
parent
commit
ea105ee1eb
1 changed files with 1 additions and 1 deletions
  1. 1 1
      index.js

+ 1 - 1
index.js

@@ -141,7 +141,7 @@ module.exports = {
 								node: node,
 								message: 'Avoid using double quotes (use single quotes instead)',
 								fix: function(fixer) {
-									return fixer.replaceTextRange([node.start+1, node.end-1], "'" + node.value + "'");
+									return fixer.replaceTextRange([node.start, node.end], "'" + node.value.replace(/'/g, '\\\''); + "'");
 								}
 							});
 						}