P5-3564 - Add eslint and run with --fix

This commit is contained in:
Anders Gustafsson
2019-02-22 14:25:19 +01:00
parent 8c1fc65d72
commit c89c1ce609
47 changed files with 4355 additions and 3393 deletions
+34
View File
@@ -0,0 +1,34 @@
{
"env": {
"browser": true,
"commonjs": true
},
"extends": ["eslint:recommended"],
"rules": {
"no-console": 0,
"strict": [
"error",
"safe"
],
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"comma-dangle": [
"error",
"only-multiline"
]
}
}
+5
View File
@@ -1,3 +1,8 @@
Photowall Image Editor Photowall Image Editor
====================== ======================
Image editor for the Photowall web project Image editor for the Photowall web project
# Linting
Linting can be run manually with
`npm run lint`
+2 -2
View File
@@ -585,7 +585,7 @@ var Canvas = fabric.util.createClass(fabric.Canvas, {
$.ajax({ $.ajax({
url: this.get3dUrl(), url: this.get3dUrl(),
crossDomain: true, crossDomain: true,
type: "HEAD", type: 'HEAD',
cache: true, cache: true,
}).done(function() { }).done(function() {
fabric.Image.fromURL(encodeURI(this.get3dUrl()), function (img) { fabric.Image.fromURL(encodeURI(this.get3dUrl()), function (img) {
@@ -2324,7 +2324,7 @@ module.exports = assertKeyValuePair;
function calcCrop(obj, width, height, units) { function calcCrop(obj, width, height, units) {
var cropRatio = width / height; var cropRatio = width / height;
var objRatio = obj.width / obj.height; var objRatio = obj.width / obj.height;
var inchToCm = units === "inch" ? 2.54 : 1; var inchToCm = units === 'inch' ? 2.54 : 1;
var returnValue = { var returnValue = {
image: obj, image: obj,
+7
View File
@@ -0,0 +1,7 @@
{
"globals": {
"$": false,
"ImageEditor": false,
"QUnit": false
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
var gulp = require('gulp'); var gulp = require('gulp');
var browserify = require('browserify') var browserify = require('browserify');
var buffer = require('vinyl-buffer'); var buffer = require('vinyl-buffer');
var rename = require('gulp-rename'); var rename = require('gulp-rename');
var source = require('vinyl-source-stream'); var source = require('vinyl-source-stream');
+910 -11
View File
File diff suppressed because it is too large Load Diff
+8 -4
View File
@@ -8,13 +8,17 @@
}, },
"devDependencies": { "devDependencies": {
"browserify": "^13.1.1", "browserify": "^13.1.1",
"eslint": "^5.14.1",
"gulp": "^3.9.0", "gulp": "^3.9.0",
"gulp-jshint": "^2.0.4",
"gulp-qunit": "^1.5.0",
"gulp-rename": "^1.2.2",
"jshint": "^2.9.5", "jshint": "^2.9.5",
"qunit": "^1.0.0", "qunit": "^1.0.0",
"gulp-jshint": "^2.0.4",
"gulp-rename": "^1.2.2",
"vinyl-buffer": "^1.0.0", "vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0", "vinyl-source-stream": "^1.1.0"
"gulp-qunit": "^1.5.0" },
"scripts": {
"lint": "eslint gulpfile.js 'examples/**/*.js' 'test/unit/**/*.js' 'src/**/*.js'"
} }
} }
+7
View File
@@ -0,0 +1,7 @@
{
"rules": {
"no-console":[
"error"
]
}
}
+1 -1
View File
@@ -220,7 +220,7 @@ var Canvas = fabric.util.createClass(fabric.Canvas, {
$.ajax({ $.ajax({
url: this.get3dUrl(), url: this.get3dUrl(),
crossDomain: true, crossDomain: true,
type: "HEAD", type: 'HEAD',
cache: true, cache: true,
}).done(function() { }).done(function() {
fabric.Image.fromURL(encodeURI(this.get3dUrl()), function (img) { fabric.Image.fromURL(encodeURI(this.get3dUrl()), function (img) {
+1 -1
View File
@@ -15,7 +15,7 @@
function calcCrop(obj, width, height, units) { function calcCrop(obj, width, height, units) {
var cropRatio = width / height; var cropRatio = width / height;
var objRatio = obj.width / obj.height; var objRatio = obj.width / obj.height;
var inchToCm = units === "inch" ? 2.54 : 1; var inchToCm = units === 'inch' ? 2.54 : 1;
var returnValue = { var returnValue = {
image: obj, image: obj,
+6
View File
@@ -0,0 +1,6 @@
{
"globals": {
"QUnit": false,
"ImageEditor": false
}
}