mirror of
https://github.com/bobwen-dev/react-templates
synced 2025-04-12 00:56:39 +02:00
eslint fixes
This commit is contained in:
parent
08f6a601f2
commit
a90e88582c
12
.eslintrc
12
.eslintrc
@ -125,13 +125,13 @@
|
|||||||
"wrap-iife": 2,
|
"wrap-iife": 2,
|
||||||
"no-multi-str": 2,
|
"no-multi-str": 2,
|
||||||
|
|
||||||
"quote-props": [1, "as-needed"],
|
"quote-props": [2, "as-needed"],
|
||||||
"no-multi-spaces": 1,
|
"no-multi-spaces": 2,
|
||||||
"key-spacing": [1, { "beforeColon": false, "afterColon": true }],
|
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
|
||||||
"comma-spacing": 1,
|
"comma-spacing": 2,
|
||||||
"space-unary-ops": [1, { "words": true, "nonwords": false }],
|
"space-unary-ops": [2, { "words": true, "nonwords": false }],
|
||||||
"indent": [2, 4],
|
"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/display-name": 2,
|
||||||
"react/jsx-quotes": 1,
|
"react/jsx-quotes": 1,
|
||||||
|
@ -33,7 +33,7 @@ function convertFile(source, target, options, context) {
|
|||||||
}
|
}
|
||||||
var js;
|
var js;
|
||||||
if (options.modules === 'jsrt') {
|
if (options.modules === 'jsrt') {
|
||||||
js = convertJSRTToJS(html, options)
|
js = convertJSRTToJS(html, options);
|
||||||
} else {
|
} else {
|
||||||
js = convertTemplateToReact(html, options);
|
js = convertTemplateToReact(html, options);
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ function handleSingleFile(currentOptions, filename) {
|
|||||||
try {
|
try {
|
||||||
var sourceExt = path.extname(filename);
|
var sourceExt = path.extname(filename);
|
||||||
var outputFilename;
|
var outputFilename;
|
||||||
if (sourceExt == '.rt') {
|
if (sourceExt === '.rt') {
|
||||||
if (currentOptions.modules !== 'typescript') {
|
if (currentOptions.modules !== 'typescript') {
|
||||||
outputFilename = filename + '.js';
|
outputFilename = filename + '.js';
|
||||||
} else {
|
} else {
|
||||||
@ -64,7 +64,7 @@ function handleSingleFile(currentOptions, filename) {
|
|||||||
}
|
}
|
||||||
} else if (sourceExt === '.jsrt'){
|
} else if (sourceExt === '.jsrt'){
|
||||||
outputFilename = filename.replace(/\.jsrt$/, '.js');
|
outputFilename = filename.replace(/\.jsrt$/, '.js');
|
||||||
currentOptions = _.assign({},currentOptions, {'modules' : 'jsrt'});
|
currentOptions = _.assign({}, currentOptions, {modules: 'jsrt'});
|
||||||
} else {
|
} else {
|
||||||
context.error('invalid file, only handle rt/jsrt files', filename);
|
context.error('invalid file, only handle rt/jsrt files', filename);
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user