Browse Source

Fix & check linting in our examples too

Kevin van Zonneveld 9 years ago
parent
commit
7f673f450d

+ 2 - 2
package.json

@@ -12,8 +12,8 @@
     "build": "npm run build:lib && npm run build:umd && npm run build:umd:min && npm run build:css",
     "clean": "rm -rf lib && rm -rf dist",
     "docs": "cd website && node build-documentation.js",
-    "lint": "eslint src/**/*.js",
-    "fix": "eslint src/**/*.js --fix",
+    "lint": "eslint src/**/*.js website/src/examples/*/*.es6",
+    "fix": "eslint src/**/*.js website/src/examples/*/*.es6 --fix",
     "server": "browser-sync start --config .browsersync.js",
     "start": "npm run build && npm run web",
     "test:phantom": "zuul test/spec/upload.js --phantom",

+ 5 - 5
website/src/examples/dragdrop/app.es6

@@ -1,10 +1,10 @@
-import Uppy from 'uppy/core';
-import { DragDrop, Tus10 } from 'uppy/plugins';
+import Uppy from 'uppy/core'
+import { DragDrop, Tus10 } from 'uppy/plugins'
 
-const uppy = new Uppy({wait: false});
+const uppy = new Uppy({wait: false})
 const files = uppy
   .use(DragDrop, {selector: '#upload-target'})
   .use(Tus10, {endpoint: 'http://master.tus.io:8080/files/'})
-  .run();
+  .run()
 
-console.log('Uppy ' + uppy.type + ' loaded');
+console.log('Uppy ' + uppy.type + ' loaded')

+ 5 - 5
website/src/examples/dropbox/app.es6

@@ -1,9 +1,9 @@
-import Uppy from 'uppy/core';
-import { Dropbox } from 'uppy/plugins';
+import Uppy from 'uppy/core'
+import { Dropbox } from 'uppy/plugins'
 
-const uppy = new Uppy({wait: false});
+const uppy = new Uppy({wait: false})
 const files = uppy
   .use(Dropbox, {selector: '#target'})
-  .run();
+  .run()
 
-console.log(uppy.type);
+console.log(uppy.type)

+ 6 - 6
website/src/examples/i18n/app.es6

@@ -1,11 +1,11 @@
-import Uppy from 'uppy/core';
-import { DragDrop, Tus10 } from 'uppy/plugins';
+import Uppy from 'uppy/core'
+import { DragDrop, Tus10 } from 'uppy/plugins'
 
-const ru = require('../../../../src/locale/ru.js');
+const ru = require('../../../../src/locale/ru.js')
 
-const uppy = new Uppy({wait: false, locale: ru});
+const uppy = new Uppy({wait: false, locale: ru})
 const files = uppy
   .use(Tus10, {endpoint: 'http://master.tus.io:8080/files/'})
-  .run();
+  .run()
 
-console.log('--> Uppy Bundled version with Tus10 & Russian language pack has loaded');
+console.log('--> Uppy Bundled version with Tus10 & Russian language pack has loaded')

+ 5 - 5
website/src/examples/multipart/app.es6

@@ -1,7 +1,7 @@
-import Uppy from 'uppy/core';
-import { Formtag, Multipart } from 'uppy/plugins';
+import Uppy from 'uppy/core'
+import { Formtag, Multipart } from 'uppy/plugins'
 
-const uppy = new Uppy({wait: false});
+const uppy = new Uppy({wait: false})
 const files = uppy
   .use(Formtag, {
     selector: '#myform1 [type="file"],#myform2 [type="file"]',
@@ -12,6 +12,6 @@ const files = uppy
     bundle   : true,
     fieldName: 'files[]'
   })
-  .run();
+  .run()
 
-console.log('Uppy ' + uppy.type + ' loaded');
+console.log('Uppy ' + uppy.type + ' loaded')