mirror of
https://github.com/bobwen-dev/react-templates
synced 2025-04-12 00:56:39 +02:00
fixed #72
This commit is contained in:
parent
8169e057ea
commit
0d35afe4cf
@ -6,6 +6,7 @@
|
||||
"no-restricted-syntax": [2, "WithStatement"],
|
||||
"no-negated-condition": 1,
|
||||
"lodash3/prop-shorthand": 2,
|
||||
"lodash3/matches-shorthand": 2,
|
||||
"lodash3/matches-prop-shorthand": 2,
|
||||
"lodash3/prefer-chain": 2,
|
||||
"lodash3/preferred-alias": 2,
|
||||
@ -21,9 +22,12 @@
|
||||
"lodash3/prefer-invoke": 2,
|
||||
"lodash3/prefer-thru": 2,
|
||||
"lodash3/prefer-lodash-method": 0,
|
||||
"lodash3/prefer-lodash-typecheck": 1,
|
||||
"lodash3/no-commit": 1,
|
||||
"lodash3/prefer-lodash-typecheck": 2,
|
||||
"lodash3/no-commit": 2,
|
||||
"lodash3/prefer-get": [2, 3],
|
||||
"lodash3/collection-return": 2,
|
||||
"lodash3/prefer-matches": 2,
|
||||
"lodash3/prefer-times": 2,
|
||||
|
||||
"wix-editor/augmented-assignment": 1,
|
||||
"wix-editor/no-not-not": 1,
|
||||
|
@ -98,7 +98,6 @@ module.exports = function (grunt) {
|
||||
return eval(require('fs').readFileSync(file).toString()); // eslint-disable-line no-eval
|
||||
}
|
||||
|
||||
grunt.task.loadTasks('./internalTasks');
|
||||
grunt.loadNpmTasks('grunt-browserify');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-contrib-requirejs');
|
||||
@ -107,6 +106,7 @@ module.exports = function (grunt) {
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
|
||||
grunt.registerTask('default', ['eslint:all']);
|
||||
grunt.registerTask('lint', ['eslint:all']);
|
||||
grunt.registerTask('test', ['node_tap']);
|
||||
|
||||
grunt.registerTask('rt', function () {
|
||||
|
12
package.json
12
package.json
@ -31,24 +31,25 @@
|
||||
"cheerio": "^0.19.0",
|
||||
"css": "^2.2.1",
|
||||
"escodegen": "^1.7.0",
|
||||
"esprima-harmony": "^7001.1.0-dev-harmony-fb",
|
||||
"esprima-fb": "^15001.1001.0-dev-harmony-fb",
|
||||
"lodash": "^3.10.1",
|
||||
"optionator": "^0.6.0",
|
||||
"text-table": "^0.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^4.1.5",
|
||||
"brace": "^0.5.1",
|
||||
"brfs": "^1.4.1",
|
||||
"coveralls": "^2.11.4",
|
||||
"eslint": "^1.9.0",
|
||||
"eslint": "^1.10.1",
|
||||
"eslint-config-wix-editor": "0.0.1",
|
||||
"eslint-plugin-lodash3": "^0.1.13",
|
||||
"eslint-plugin-react": "^3.6.3",
|
||||
"eslint-plugin-lodash3": "^0.2.0",
|
||||
"eslint-plugin-react": "^3.10.0",
|
||||
"eslint-plugin-wix-editor": "^1.0.1",
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-browserify": "^4.0.0",
|
||||
"grunt-contrib-requirejs": "^0.4.4",
|
||||
"grunt-contrib-uglify": "^0.10.0",
|
||||
"grunt-contrib-uglify": "^0.11.0",
|
||||
"grunt-contrib-watch": "^0.6.1",
|
||||
"grunt-eslint": "^17.3.1",
|
||||
"grunt-node-tap": "^0.1.61",
|
||||
@ -56,7 +57,6 @@
|
||||
"react": "^0.14.2",
|
||||
"react-dom": "^0.14.2",
|
||||
"react-native": "^0.11.4",
|
||||
"react-templates": "^0.1.22",
|
||||
"tape": "^4.2.1"
|
||||
},
|
||||
"keywords": [
|
||||
|
@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
var cheerio = require('cheerio');
|
||||
var _ = require('lodash');
|
||||
var esprima = require('esprima-harmony');
|
||||
var esprima = require('esprima-fb');
|
||||
var escodegen = require('escodegen');
|
||||
var reactDOMSupport = require('./reactDOMSupport');
|
||||
var reactNativeSupport = require('./reactNativeSupport');
|
||||
@ -505,7 +505,6 @@ function convertRT(html, reportContext, options) {
|
||||
var requirePaths = _(defines)
|
||||
.keys()
|
||||
.map(function (reqName) { return '"' + reqName + '"'; })
|
||||
.value()
|
||||
.join(',');
|
||||
var requireVars = _.values(defines).join(',');
|
||||
var buildImport;
|
||||
@ -538,7 +537,7 @@ function convertRT(html, reportContext, options) {
|
||||
|
||||
function parseJS(code) {
|
||||
try {
|
||||
var tree = esprima.parse(code, {range: true, tokens: true, comment: true});
|
||||
var tree = esprima.parse(code, {range: true, tokens: true, comment: true, sourceType: 'module'});
|
||||
tree = escodegen.attachComments(tree, tree.comments, tree.tokens);
|
||||
return escodegen.generate(tree, {comment: true});
|
||||
} catch (e) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
var _ = require('lodash');
|
||||
var esprima = require('esprima-harmony');
|
||||
var esprima = require('esprima-fb');
|
||||
var rtError = require('./RTCodeError');
|
||||
var RTCodeError = rtError.RTCodeError;
|
||||
|
||||
@ -73,4 +73,4 @@ module.exports = {
|
||||
isStringOnlyCode: isStringOnlyCode,
|
||||
concatChildren: concatChildren,
|
||||
validate: validate
|
||||
};
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user