Skip to content

Commit 72a9c88

Browse files
author
Anthony Du Pont
committed
✨ Add ESLint Loader
1 parent cce1dce commit 72a9c88

File tree

13 files changed

+833
-383
lines changed

13 files changed

+833
-383
lines changed

.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.npmignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# JUNK FILES
1+
# JUNK FILES & FOLDERS
22
.cache
33
.DS_Store
4+
.nyc_output/
45

56
# FRONT FOLDERS
67
node_modules/
8+
coverage/

bark.yml

Whitespace-only changes.

dist/highway.js

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,34 @@ return /******/ (function(modules) { // webpackBootstrap
4646
/******/ // define getter function for harmony exports
4747
/******/ __webpack_require__.d = function(exports, name, getter) {
4848
/******/ if(!__webpack_require__.o(exports, name)) {
49-
/******/ Object.defineProperty(exports, name, {
50-
/******/ configurable: false,
51-
/******/ enumerable: true,
52-
/******/ get: getter
53-
/******/ });
49+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
5450
/******/ }
5551
/******/ };
5652
/******/
5753
/******/ // define __esModule on exports
5854
/******/ __webpack_require__.r = function(exports) {
55+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
56+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
57+
/******/ }
5958
/******/ Object.defineProperty(exports, '__esModule', { value: true });
6059
/******/ };
6160
/******/
61+
/******/ // create a fake namespace object
62+
/******/ // mode & 1: value is a module id, require it
63+
/******/ // mode & 2: merge all properties of value into the ns
64+
/******/ // mode & 4: return value when already ns object
65+
/******/ // mode & 8|1: behave like require
66+
/******/ __webpack_require__.t = function(value, mode) {
67+
/******/ if(mode & 1) value = __webpack_require__(value);
68+
/******/ if(mode & 8) return value;
69+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
70+
/******/ var ns = Object.create(null);
71+
/******/ __webpack_require__.r(ns);
72+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
73+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
74+
/******/ return ns;
75+
/******/ };
76+
/******/
6277
/******/ // getDefaultExport function for compatibility with non-harmony modules
6378
/******/ __webpack_require__.n = function(module) {
6479
/******/ var getter = module && module.__esModule ?
@@ -229,7 +244,7 @@ class Renderer {
229244

230245
/**
231246
* Add the view in DOM and play an `in` transition if one is defined.
232-
*
247+
*
233248
* @return {object} Promise
234249
*/
235250
show() {
@@ -243,11 +258,11 @@ class Renderer {
243258
this.onEnter && this.onEnter();
244259

245260
// The transition is set in your custom renderer with a getter called
246-
// `transition` that should return the transition object you want to
261+
// `transition` that should return the transition object you want to
247262
// apply to you view. We call the `in` step of this one right now!
248263
this.Transition && await this.Transition.show();
249264

250-
// The `onEnterCompleted` method if set in your custom renderer is called
265+
// The `onEnterCompleted` method if set in your custom renderer is called
251266
// everytime a transition is over if set. Otherwise it's called right after
252267
// the `onEnter` method.
253268
this.onEnterCompleted && this.onEnterCompleted();
@@ -259,7 +274,7 @@ class Renderer {
259274

260275
/**
261276
* Play an `out` transition if one is defined and remove the view from DOM.
262-
*
277+
*
263278
* @return {object} Promise
264279
*/
265280
hide() {
@@ -275,7 +290,7 @@ class Renderer {
275290
// Remove view from DOM.
276291
this.remove();
277292

278-
// The `onLeaveCompleted` method if set in your custom renderer is called
293+
// The `onLeaveCompleted` method if set in your custom renderer is called
279294
// everytime a view is completely removed from the DOM.
280295
this.onLeaveCompleted && this.onLeaveCompleted();
281296

@@ -366,7 +381,7 @@ class helpers_Helpers {
366381

367382
/**
368383
* Get page's DOM from page HTML
369-
*
384+
*
370385
* @arg {string} page — Page HTML
371386
* @return {string} Page DOM
372387
* @static
@@ -377,7 +392,7 @@ class helpers_Helpers {
377392

378393
/**
379394
* Get view element from page DOM
380-
*
395+
*
381396
* @arg {string} page — Page DOM
382397
* @return {object} View element or `null`
383398
* @static
@@ -388,7 +403,7 @@ class helpers_Helpers {
388403

389404
/**
390405
* Get view's slug from view element
391-
*
406+
*
392407
* @arg {string} view — [router-view] DOM
393408
* @return {string} Page slug or `null`
394409
* @static
@@ -482,7 +497,7 @@ class core_Core extends tiny_emitter_default.a {
482497
// Events
483498
this._click = this.click.bind(this);
484499

485-
// Listen the `popstate` on the window to run the router each time an
500+
// Listen the `popstate` on the window to run the router each time an
486501
// history entry changes. Basically everytime the backward/forward arrows
487502
// are triggered by the user.
488503
window.addEventListener('popstate', this.popState.bind(this));
@@ -493,7 +508,7 @@ class core_Core extends tiny_emitter_default.a {
493508

494509
/**
495510
* Get all required properties for a context.
496-
*
511+
*
497512
* @arg {string|object} context – DOM context
498513
* @return {object} Properties
499514
*/
@@ -553,7 +568,7 @@ class core_Core extends tiny_emitter_default.a {
553568

554569
/**
555570
* Click method called on `click` event.
556-
*
571+
*
557572
* @arg {object} event - `click` event
558573
*/
559574
click(event) {
@@ -618,7 +633,7 @@ class core_Core extends tiny_emitter_default.a {
618633

619634
/**
620635
* Do some tests before HTTP requests to optimize pipeline.
621-
*
636+
*
622637
* @arg {object} state - State to save
623638
*/
624639
async beforeFetch(state) {
@@ -664,7 +679,7 @@ class core_Core extends tiny_emitter_default.a {
664679

665680
/**
666681
* Fetch the page from URL
667-
*
682+
*
668683
* @return {string} Fetch response
669684
*/
670685
async fetch() {
@@ -743,7 +758,7 @@ class Transition {
743758

744759
/**
745760
* Add the view in DOM and play an `in` transition if one is defined.
746-
*
761+
*
747762
* @return {object} Promise
748763
*/
749764
show() {
@@ -757,7 +772,7 @@ class Transition {
757772

758773
/**
759774
* Play an `out` transition if one is defined and remove the view from DOM.
760-
*
775+
*
761776
* @return {object} Promise
762777
*/
763778
hide() {

dist/highway.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/highway.min.js.gz

139 Bytes
Binary file not shown.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
"chai": "^4.1.2",
4444
"chai-as-promised": "^7.1.1",
4545
"compression-webpack-plugin": "^1.1.11",
46+
"eslint": "^4.19.1",
47+
"eslint-loader": "^2.0.0",
4648
"isomorphic-fetch": "^2.2.1",
4749
"jsdom": "^11.7.0",
4850
"jsdom-global": "^3.0.2",

src/core.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default class Core extends Emitter {
4343
// Events
4444
this._click = this.click.bind(this);
4545

46-
// Listen the `popstate` on the window to run the router each time an
46+
// Listen the `popstate` on the window to run the router each time an
4747
// history entry changes. Basically everytime the backward/forward arrows
4848
// are triggered by the user.
4949
window.addEventListener('popstate', this.popState.bind(this));
@@ -54,7 +54,7 @@ export default class Core extends Emitter {
5454

5555
/**
5656
* Get all required properties for a context.
57-
*
57+
*
5858
* @arg {string|object} context – DOM context
5959
* @return {object} Properties
6060
*/
@@ -114,7 +114,7 @@ export default class Core extends Emitter {
114114

115115
/**
116116
* Click method called on `click` event.
117-
*
117+
*
118118
* @arg {object} event - `click` event
119119
*/
120120
click(event) {
@@ -179,7 +179,7 @@ export default class Core extends Emitter {
179179

180180
/**
181181
* Do some tests before HTTP requests to optimize pipeline.
182-
*
182+
*
183183
* @arg {object} state - State to save
184184
*/
185185
async beforeFetch(state) {
@@ -225,7 +225,7 @@ export default class Core extends Emitter {
225225

226226
/**
227227
* Fetch the page from URL
228-
*
228+
*
229229
* @return {string} Fetch response
230230
*/
231231
async fetch() {

src/helpers.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default class Helpers {
7878

7979
/**
8080
* Get page's DOM from page HTML
81-
*
81+
*
8282
* @arg {string} page — Page HTML
8383
* @return {string} Page DOM
8484
* @static
@@ -89,7 +89,7 @@ export default class Helpers {
8989

9090
/**
9191
* Get view element from page DOM
92-
*
92+
*
9393
* @arg {string} page — Page DOM
9494
* @return {object} View element or `null`
9595
* @static
@@ -100,7 +100,7 @@ export default class Helpers {
100100

101101
/**
102102
* Get view's slug from view element
103-
*
103+
*
104104
* @arg {string} view — [router-view] DOM
105105
* @return {string} Page slug or `null`
106106
* @static

0 commit comments

Comments
 (0)