upgrade eslint and plugins

This commit is contained in:
ido 2016-03-02 18:53:49 +02:00
parent 12040961f8
commit 58b8093090
9 changed files with 62 additions and 53 deletions

View File

@ -16,7 +16,7 @@ web/**
playground/sample/**
test/data/**
dist-test/data/**
dist-test
dist
internalTasks/release.js

View File

@ -1,7 +1,13 @@
{
"extends": "wix-editor/node",
"plugins": ["lodash3", "wix-editor"],
"plugins": ["lodash", "wix-editor"],
"settings": {
"lodash": {
"version": 3
}
},
"rules": {
"semi": [2, "always"],
"no-var": 0,
"object-shorthand": 0,
"prefer-arrow-callback": 0,
@ -11,30 +17,30 @@
"no-restricted-syntax": [2, "WithStatement", "ContinueStatement", "ForStatement"],
"no-negated-condition": 1,
"lodash3/prop-shorthand": 2,
"lodash3/matches-shorthand": [2, "always", 3],
"lodash3/matches-prop-shorthand": 2,
"lodash3/prefer-chain": 2,
"lodash3/preferred-alias": 2,
"lodash3/no-single-chain": 2,
"lodash3/prefer-reject": [2, 3],
"lodash3/prefer-filter": [2, 3],
"lodash3/no-unnecessary-bind": 2,
"lodash3/unwrap": 2,
"lodash3/prefer-compact": 2,
"lodash3/no-double-unwrap": 2,
"lodash3/prefer-map": 2,
"lodash3/prefer-wrapper-method": 2,
"lodash3/prefer-invoke": 2,
"lodash3/prefer-thru": 2,
"lodash3/prefer-lodash-chain": 2,
"lodash3/prefer-lodash-method": 0,
"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,
"lodash/prop-shorthand": 2,
"lodash/matches-shorthand": [2, "always"],
"lodash/matches-prop-shorthand": [2, "always"],
"lodash/prefer-chain": 2,
"lodash/preferred-alias": 2,
"lodash/no-single-chain": 2,
"lodash/prefer-reject": [2, 3],
"lodash/prefer-filter": 0,
"lodash/callback-binding": 2,
"lodash/unwrap": 2,
"lodash/prefer-lodash-chain": 2,
"lodash/prefer-compact": 2,
"lodash/no-double-unwrap": 2,
"lodash/prefer-map": 0,
"lodash/prefer-wrapper-method": 2,
"lodash/prefer-thru": 2,
"lodash/prefer-get": [2, 3],
"lodash/collection-return": 2,
"lodash/prefer-times": 2,
"lodash/chain-style": [2, "as-needed"],
"lodash/path-style": 0,
"lodash/no-extra-args": 2,
"lodash/identity-shorthand": [2, "always"],
"wix-editor/augmented-assignment": 1,
"wix-editor/no-not-not": 1,

View File

@ -1,8 +1,8 @@
language: node_js
node_js:
- 0.10
- 0.12
- 4
- 5
sudo: false

View File

@ -40,25 +40,25 @@
"text-table": "^0.2.0"
},
"devDependencies": {
"babel-cli": "^6.3.17",
"babel-core": "^6.3.26",
"babel-loader": "^6.2.0",
"babel-preset-es2015": "^6.3.13",
"babel-cli": "^6.6.0",
"babel-core": "^6.6.0",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.6.0",
"brace": "0.7.0",
"brfs": "^1.4.1",
"coveralls": "2.11.6",
"eslint": "1.10.3",
"eslint-config-wix-editor": "^0.1.1",
"eslint-plugin-lodash3": "^0.5.1",
"coveralls": "^2.11.8",
"eslint": "^2.2.0",
"eslint-config-wix-editor": "^0.2.3",
"eslint-plugin-lodash": "^1.2.2",
"eslint-plugin-react": "^3.13.1",
"eslint-plugin-wix-editor": "^1.0.1",
"eslint-plugin-wix-editor": "^1.1.1",
"grunt": "^0.4.5",
"grunt-babel": "^6.0.0",
"grunt-browserify": "^4.0.0",
"grunt-contrib-requirejs": "^0.4.4",
"grunt-contrib-uglify": "^0.11.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-eslint": "^17.3.1",
"grunt-eslint": "^18.0.0",
"grunt-tape": "0.0.2",
"istanbul": "0.4.1",
"json-loader": "^0.5.4",
@ -66,7 +66,7 @@
"react-dom": "^0.14.2",
"react-native": "^0.17.0",
"tape": "^4.4.0",
"webpack": "^1.12.9"
"webpack": "^1.12.14"
},
"keywords": [
"templates",

View File

@ -37,7 +37,8 @@ define(['react', 'lodash', 'jquery', './libs/codemirror-4.8/lib/codemirror'], fu
}
function makeMarker(labels, severity, multiple, tooltips) {
var marker = document.createElement('div'), inner = marker;
var marker = document.createElement('div');
var inner = marker;
marker.className = 'CodeMirror-lint-marker-' + severity;
if (multiple) {
inner = marker.appendChild(document.createElement('div'));

View File

@ -113,12 +113,12 @@ function lineText(line) {
module.exports = function (results) {
results = _.groupBy(results, 'file');
var output = '\n',
total = 0,
errors = 0,
warnings = 0,
infos = 0,
summaryColor = 'cyan';
var output = '\n';
var total = 0;
var errors = 0;
var warnings = 0;
var infos = 0;
var summaryColor = 'cyan';
_.forEach(results, function (result, k) {
var messages = result;
@ -179,4 +179,4 @@ module.exports = function (results) {
}
return total > 0 ? output : '';
};
};

View File

@ -20,7 +20,7 @@ function createRelativeReadFileSync(baseFile) {
var basePath = path.dirname(baseFile);
return function(filename) {
return fs.readFileSync(path.resolve(basePath, filename));
}
};
}
module.exports = {

View File

@ -30,7 +30,7 @@ const propsMergeFunction = `function mergeProps(inline,external) {
}
return res;
}
`
`;
var classSetTemplate = _.template('_.keys(_.pick(<%= classSet %>, _.identity)).join(" ")');
@ -271,6 +271,7 @@ function genBind(func, args) {
}
function handleStyleProp(val, node, context) {
/*eslint lodash/prefer-lodash-chain:0*/
const styleStr = _(val)
.split(';')
.map(_.trim)
@ -279,7 +280,7 @@ function handleStyleProp(val, node, context) {
const pair = i.split(':');
//const val = pair[1];
const val = pair.slice(1).join(':').trim();
return _.camelCase(pair[0].trim()) + ' : ' + convertText(node, context, val.trim())
return _.camelCase(pair[0].trim()) + ' : ' + convertText(node, context, val.trim());
//return stringUtils.convertToCamelCase(pair[0].trim()) + ' : ' + convertText(node, context, val.trim())
})
.join(',');
@ -306,6 +307,7 @@ function convertTagNameToConstructor(tagName, context) {
/**
* @param {string} html
* @param options
* @param reportContext
* @return {Context}
*/
function defaultContext(html, options, reportContext) {
@ -408,7 +410,7 @@ function convertHtmlToReact(node, context) {
data.children = utils.concatChildren(children);
if (node.name === virtualNode) { //eslint-disable-line wix-editor/prefer-ternary
data.body = "[" + _.compact(children).join(',') + "]"
data.body = "[" + _.compact(children).join(',') + "]";
}
else {
data.body = _.template(getTagTemplateString(!hasNonSimpleChildren(node), reactSupport.shouldUseCreateElement(context)))(data);
@ -566,9 +568,9 @@ function convertRT(html, reportContext, options) {
if (options.modules === 'typescript') {
buildImport = (v, p) => `import ${v} = require('${p}');`;
} else if (options.modules === 'es6') { // eslint-disable-line
buildImport = (v, p) => `import ${v} from '${p}';`
buildImport = (v, p) => `import ${v} from '${p}';`;
} else {
buildImport = (v, p) => `var ${v} = require('${p}');`
buildImport = (v, p) => `var ${v} = require('${p}');`;
}
const header = options.flow ? '/* @flow */\n' : '';
const vars = header + _(context.defines).map(buildImport).join('\n');

View File

@ -215,7 +215,7 @@ test('html tests', function (t) {
var filename = path.join(dataPath, testFile);
var options = {
readFileSync: fsUtil.createRelativeReadFileSync(filename)
}
};
var code = '';
try {
var html = fs.readFileSync(filename).toString();