1
0
mirror of https://github.com/bobwen-dev/react-templates synced 2025-04-12 00:56:39 +02:00

lodash eslint rules

dependencies up to date
This commit is contained in:
ido 2015-08-25 17:15:02 +03:00
parent 24db05797a
commit 558bb73474
3 changed files with 22 additions and 15 deletions

View File

@ -160,8 +160,14 @@
"lodash3/prop-shorthand": 2,
"lodash3/matches-prop-shorthand": 2,
"lodash3/prefer-chain": 1,
"lodash3/preferred-alias": 2
"lodash3/prefer-chain": 2,
"lodash3/preferred-alias": 2,
"lodash3/no-single-chain": 2,
"lodash3/prefer-reject": 2,
"lodash3/prefer-filter": 2,
"lodash3/no-unnecessary-bind": 2,
"lodash3/unwrap": 2,
"lodash3/prefer-compact": 2
},
"env": {
"browser": false,

View File

@ -24,31 +24,31 @@
},
"homepage": "https://github.com/wix/react-templates",
"dependencies": {
"chalk": "^1.1.0",
"chalk": "^1.1.1",
"cheerio": "^0.19.0",
"escodegen": "^1.6.1",
"esprima-harmony": "^7001.1.0-dev-harmony-fb",
"lodash": "^3.10.0",
"lodash": "^3.10.1",
"optionator": "^0.6.0",
"text-table": "^0.2.0"
},
"devDependencies": {
"brace": "^0.5.1",
"brfs": "^1.4.0",
"coveralls": "^2.11.3",
"eslint-plugin-lodash3": "0.0.0",
"eslint-plugin-react": "^3.1.0",
"brfs": "^1.4.1",
"coveralls": "^2.11.4",
"eslint-plugin-lodash3": "^0.1.3",
"eslint-plugin-react": "^3.2.3",
"grunt": "^0.4.5",
"grunt-browserify": "^3.8.0",
"grunt-contrib-requirejs": "^0.4.4",
"grunt-contrib-uglify": "^0.9.1",
"grunt-contrib-uglify": "^0.9.2",
"grunt-contrib-watch": "^0.6.1",
"grunt-eslint": "^17.0.0",
"grunt-eslint": "^17.1.0",
"grunt-node-tap": "^0.1.61",
"istanbul": "^0.3.17",
"istanbul": "^0.3.18",
"react": "^0.12.2",
"react-native": "^0.9.0",
"tape": "^4.0.1"
"tape": "^4.2.0"
},
"keywords": [
"templates",

View File

@ -60,7 +60,7 @@ var templateNode = 'rt-template';
function getOptions(options) {
options = options || {};
var defaultOptions = {
modules: options.native ? 'commonjs': 'amd',
modules: options.native ? 'commonjs' : 'amd',
version: false,
force: false,
format: 'stylish',
@ -105,6 +105,7 @@ var reactSupportedAttributes = ['accept', 'acceptCharset', 'accessKey', 'action'
'style', 'tabIndex', 'target', 'title', 'type', 'useMap', 'value', 'width', 'wmode'];
var classNameProp = 'className';
var attributesMapping = {'class': classNameProp, 'rt-class': classNameProp, 'for': 'htmlFor'}; //eslint-disable-line quote-props
_.forEach(reactSupportedAttributes, function (attributeReactName) {
if (attributeReactName !== attributeReactName.toLowerCase()) {
attributesMapping[attributeReactName.toLowerCase()] = attributeReactName;
@ -573,7 +574,7 @@ function convertRT(html, reportContext, options) {
var requirePaths = _(defines).keys().map(function (reqName) {
return '"' + reqName + '"';
}).value().join(',');
var requireVars = _(defines).values().value().join(',');
var requireVars = _.values(defines).join(',');
var vars;
if (options.modules === 'typescript') {
vars = _(defines).map(function (reqVar, reqPath) {
@ -604,7 +605,7 @@ function convertRT(html, reportContext, options) {
}
function convertJSRTToJS(text, reportContext, options) {
options = getOptions(options)
options = getOptions(options);
options.modules = 'jsrt';
var templateMatcherJSRT = /<template>([^]*?)<\/template>/gm;
var code = text.replace(templateMatcherJSRT, function (template, html) {