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:
parent
24db05797a
commit
558bb73474
10
.eslintrc
10
.eslintrc
@ -160,8 +160,14 @@
|
|||||||
|
|
||||||
"lodash3/prop-shorthand": 2,
|
"lodash3/prop-shorthand": 2,
|
||||||
"lodash3/matches-prop-shorthand": 2,
|
"lodash3/matches-prop-shorthand": 2,
|
||||||
"lodash3/prefer-chain": 1,
|
"lodash3/prefer-chain": 2,
|
||||||
"lodash3/preferred-alias": 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": {
|
"env": {
|
||||||
"browser": false,
|
"browser": false,
|
||||||
|
20
package.json
20
package.json
@ -24,31 +24,31 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/wix/react-templates",
|
"homepage": "https://github.com/wix/react-templates",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": "^1.1.0",
|
"chalk": "^1.1.1",
|
||||||
"cheerio": "^0.19.0",
|
"cheerio": "^0.19.0",
|
||||||
"escodegen": "^1.6.1",
|
"escodegen": "^1.6.1",
|
||||||
"esprima-harmony": "^7001.1.0-dev-harmony-fb",
|
"esprima-harmony": "^7001.1.0-dev-harmony-fb",
|
||||||
"lodash": "^3.10.0",
|
"lodash": "^3.10.1",
|
||||||
"optionator": "^0.6.0",
|
"optionator": "^0.6.0",
|
||||||
"text-table": "^0.2.0"
|
"text-table": "^0.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"brace": "^0.5.1",
|
"brace": "^0.5.1",
|
||||||
"brfs": "^1.4.0",
|
"brfs": "^1.4.1",
|
||||||
"coveralls": "^2.11.3",
|
"coveralls": "^2.11.4",
|
||||||
"eslint-plugin-lodash3": "0.0.0",
|
"eslint-plugin-lodash3": "^0.1.3",
|
||||||
"eslint-plugin-react": "^3.1.0",
|
"eslint-plugin-react": "^3.2.3",
|
||||||
"grunt": "^0.4.5",
|
"grunt": "^0.4.5",
|
||||||
"grunt-browserify": "^3.8.0",
|
"grunt-browserify": "^3.8.0",
|
||||||
"grunt-contrib-requirejs": "^0.4.4",
|
"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-contrib-watch": "^0.6.1",
|
||||||
"grunt-eslint": "^17.0.0",
|
"grunt-eslint": "^17.1.0",
|
||||||
"grunt-node-tap": "^0.1.61",
|
"grunt-node-tap": "^0.1.61",
|
||||||
"istanbul": "^0.3.17",
|
"istanbul": "^0.3.18",
|
||||||
"react": "^0.12.2",
|
"react": "^0.12.2",
|
||||||
"react-native": "^0.9.0",
|
"react-native": "^0.9.0",
|
||||||
"tape": "^4.0.1"
|
"tape": "^4.2.0"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"templates",
|
"templates",
|
||||||
|
@ -105,6 +105,7 @@ var reactSupportedAttributes = ['accept', 'acceptCharset', 'accessKey', 'action'
|
|||||||
'style', 'tabIndex', 'target', 'title', 'type', 'useMap', 'value', 'width', 'wmode'];
|
'style', 'tabIndex', 'target', 'title', 'type', 'useMap', 'value', 'width', 'wmode'];
|
||||||
var classNameProp = 'className';
|
var classNameProp = 'className';
|
||||||
var attributesMapping = {'class': classNameProp, 'rt-class': classNameProp, 'for': 'htmlFor'}; //eslint-disable-line quote-props
|
var attributesMapping = {'class': classNameProp, 'rt-class': classNameProp, 'for': 'htmlFor'}; //eslint-disable-line quote-props
|
||||||
|
|
||||||
_.forEach(reactSupportedAttributes, function (attributeReactName) {
|
_.forEach(reactSupportedAttributes, function (attributeReactName) {
|
||||||
if (attributeReactName !== attributeReactName.toLowerCase()) {
|
if (attributeReactName !== attributeReactName.toLowerCase()) {
|
||||||
attributesMapping[attributeReactName.toLowerCase()] = attributeReactName;
|
attributesMapping[attributeReactName.toLowerCase()] = attributeReactName;
|
||||||
@ -573,7 +574,7 @@ function convertRT(html, reportContext, options) {
|
|||||||
var requirePaths = _(defines).keys().map(function (reqName) {
|
var requirePaths = _(defines).keys().map(function (reqName) {
|
||||||
return '"' + reqName + '"';
|
return '"' + reqName + '"';
|
||||||
}).value().join(',');
|
}).value().join(',');
|
||||||
var requireVars = _(defines).values().value().join(',');
|
var requireVars = _.values(defines).join(',');
|
||||||
var vars;
|
var vars;
|
||||||
if (options.modules === 'typescript') {
|
if (options.modules === 'typescript') {
|
||||||
vars = _(defines).map(function (reqVar, reqPath) {
|
vars = _(defines).map(function (reqVar, reqPath) {
|
||||||
@ -604,7 +605,7 @@ function convertRT(html, reportContext, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function convertJSRTToJS(text, reportContext, options) {
|
function convertJSRTToJS(text, reportContext, options) {
|
||||||
options = getOptions(options)
|
options = getOptions(options);
|
||||||
options.modules = 'jsrt';
|
options.modules = 'jsrt';
|
||||||
var templateMatcherJSRT = /<template>([^]*?)<\/template>/gm;
|
var templateMatcherJSRT = /<template>([^]*?)<\/template>/gm;
|
||||||
var code = text.replace(templateMatcherJSRT, function (template, html) {
|
var code = text.replace(templateMatcherJSRT, function (template, html) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user