diff --git a/.eslintrc b/.eslintrc index 56f9981..d322cb7 100644 --- a/.eslintrc +++ b/.eslintrc @@ -125,13 +125,13 @@ "wrap-iife": 2, "no-multi-str": 2, - "quote-props": [1, "as-needed"], - "no-multi-spaces": 1, - "key-spacing": [1, { "beforeColon": false, "afterColon": true }], - "comma-spacing": 1, - "space-unary-ops": [1, { "words": true, "nonwords": false }], + "quote-props": [2, "as-needed"], + "no-multi-spaces": 2, + "key-spacing": [2, { "beforeColon": false, "afterColon": true }], + "comma-spacing": 2, + "space-unary-ops": [2, { "words": true, "nonwords": false }], "indent": [2, 4], - "space-before-function-paren": [1, {"anonymous": "always", "named": "never"}], + "space-before-function-paren": [2, {"anonymous": "always", "named": "never"}], "react/display-name": 2, "react/jsx-quotes": 1, diff --git a/src/api.js b/src/api.js index fdee36d..751383e 100644 --- a/src/api.js +++ b/src/api.js @@ -33,7 +33,7 @@ function convertFile(source, target, options, context) { } var js; if (options.modules === 'jsrt') { - js = convertJSRTToJS(html, options) + js = convertJSRTToJS(html, options); } else { js = convertTemplateToReact(html, options); } diff --git a/src/cli.js b/src/cli.js index 7b4d6fa..6cf4ad3 100755 --- a/src/cli.js +++ b/src/cli.js @@ -56,7 +56,7 @@ function handleSingleFile(currentOptions, filename) { try { var sourceExt = path.extname(filename); var outputFilename; - if (sourceExt == '.rt') { + if (sourceExt === '.rt') { if (currentOptions.modules !== 'typescript') { outputFilename = filename + '.js'; } else { @@ -64,7 +64,7 @@ function handleSingleFile(currentOptions, filename) { } } else if (sourceExt === '.jsrt'){ outputFilename = filename.replace(/\.jsrt$/, '.js'); - currentOptions = _.assign({},currentOptions, {'modules' : 'jsrt'}); + currentOptions = _.assign({}, currentOptions, {modules: 'jsrt'}); } else { context.error('invalid file, only handle rt/jsrt files', filename); return; diff --git a/src/reactTemplates.js b/src/reactTemplates.js index 0d29d8a..8120dfe 100644 --- a/src/reactTemplates.js +++ b/src/reactTemplates.js @@ -464,7 +464,7 @@ function convertJSRTToJS(text, options) { options.modules = 'jsrt'; var templateMatcherJSRT = /