add wix eslint plugin

This commit is contained in:
ido 2015-10-20 18:35:17 +03:00
parent 3d35790cd3
commit ff6b99d925
3 changed files with 22 additions and 8 deletions

View File

@ -1,5 +1,5 @@
{
"plugins": ["lodash3"],
"plugins": ["lodash3", "wix-editor"],
"rules": {
"no-array-constructor": 2,
"no-catch-shadow": 2,
@ -162,7 +162,19 @@
"lodash3/prefer-map": 2,
"lodash3/prefer-wrapper-method": 2,
"lodash3/prefer-invoke": 2,
"lodash3/prefer-thru": 2
"lodash3/prefer-thru": 2,
"lodash3/prefer-lodash-method": 0,
"lodash3/prefer-lodash-typecheck": 1,
"lodash3/no-commit": 1,
"lodash3/prefer-get": [2, 3],
"wix-editor/augmented-assignment": 1,
"wix-editor/no-not-not": 1,
"wix-editor/no-unneeded-match": 1,
"wix-editor/prefer-filter": 1,
"wix-editor/prefer-ternary": 1,
"wix-editor/return-boolean": 1,
"wix-editor/simplify-boolean-expression": 1
},
"env": {
"browser": false,

View File

@ -7,6 +7,7 @@
"rt": "./bin/rt.js"
},
"scripts": {
"all": "npm run lint && npm run test",
"lint": "eslint .",
"test": "node test/src/test.js",
"test-cov": "istanbul cover test/src/test.js -- --require test/support/env --reporter dot --check-leaks test/ test/acceptance/",
@ -39,14 +40,15 @@
"brace": "^0.5.1",
"brfs": "^1.4.1",
"coveralls": "^2.11.4",
"eslint-plugin-lodash3": "^0.1.9",
"eslint-plugin-react": "^3.5.1",
"eslint-plugin-lodash3": "^0.1.12",
"eslint-plugin-react": "^3.6.3",
"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.9.2",
"grunt-contrib-watch": "^0.6.1",
"grunt-eslint": "^17.2.0",
"grunt-eslint": "^17.3.1",
"grunt-node-tap": "^0.1.61",
"istanbul": "^0.3.22",
"react": "^0.12.2",

View File

@ -109,13 +109,13 @@ function convertText(node, context, txt) {
for (end = start + 1; end < txt.length && curlyCounter > 0; end++) {
curlyCounter += curlyMap[txt.charAt(end)] || 0;
}
if (curlyCounter !== 0) {
throw RTCodeError.buildFormat(context, node, "Failed to parse text '%s'", txt);
} else {
if (curlyCounter === 0) {
var needsParens = start !== 0 || end !== txt.length - 1;
res += (first ? '' : concatChar) + (needsParens ? '(' : '') + txt.substr(start + 1, end - start - 2) + (needsParens ? ')' : '');
first = false;
txt = txt.substr(end);
} else {
throw RTCodeError.buildFormat(context, node, "Failed to parse text '%s'", txt);
}
}
if (txt) {