diff --git a/.eslintrc b/.eslintrc index b559b87af..557c5f931 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,28 +1,5 @@ { "extends": "eslint:recommended", - "ecmaFeatures": { - "arrowFunctions": true, - "binaryLiterals": true, - "blockBindings": true, - "classes": true, - "defaultParams": true, - "destructuring": true, - "forOf": true, - "generators": true, - "globalReturn": true, - "modules": true, - "objectLiteralComputedProperties": true, - "objectLiteralDuplicateProperties": true, - "objectLiteralShorthandMethods": true, - "objectLiteralShorthandProperties": true, - "octalLiterals": true, - "regexUFlag": true, - "regexYFlag": true, - "spread": true, - "superInFunctions": false, - "templateStrings": true, - "unicodeCodePointEscapes": true - }, "env": { "browser": true, "es6": true, @@ -35,6 +12,29 @@ "parser": "babel-eslint", "parserOptions": { "ecmaVersion": 6, + "ecmaFeatures": { + "arrowFunctions": true, + "binaryLiterals": true, + "blockBindings": true, + "classes": true, + "defaultParams": true, + "destructuring": true, + "forOf": true, + "generators": true, + "globalReturn": true, + "modules": true, + "objectLiteralComputedProperties": true, + "objectLiteralDuplicateProperties": true, + "objectLiteralShorthandMethods": true, + "objectLiteralShorthandProperties": true, + "octalLiterals": true, + "regexUFlag": true, + "regexYFlag": true, + "spread": true, + "superInFunctions": false, + "templateStrings": true, + "unicodeCodePointEscapes": true + }, "impliedStrict": true, "sourceType": "module" }, diff --git a/Gulpfile.babel.js b/Gulpfile.babel.js index da6f12363..8f31aa5d7 100755 --- a/Gulpfile.babel.js +++ b/Gulpfile.babel.js @@ -181,16 +181,14 @@ const load = task => { */ gulp.task("assets:images:build:ico", [ args.clean ? "assets:images:clean" : false -].filter(Boolean), - load("assets/images/build/ico")) +].filter(Boolean), load("assets/images/build/ico")) /* * Copy and minify vector graphics */ gulp.task("assets:images:build:svg", [ args.clean ? "assets:images:clean" : false -].filter(Boolean), - load("assets/images/build/svg")) +].filter(Boolean), load("assets/images/build/svg")) /* * Copy images @@ -221,8 +219,7 @@ gulp.task("assets:javascripts:build:application", [ args.clean ? "assets:javascripts:clean" : false, args.lint ? "assets:javascripts:lint" : false, args.revision ? "assets:stylesheets:build" : false -].filter(Boolean), - load("assets/javascripts/build/application")) +].filter(Boolean), load("assets/javascripts/build/application")) /* * Build custom modernizr @@ -235,16 +232,14 @@ gulp.task("assets:javascripts:build:modernizr", [ args.clean ? "assets:javascripts:clean" : false, args.lint ? "assets:javascripts:lint" : false, args.revision ? "assets:javascripts:build:application" : false -].filter(Boolean), - load("assets/javascripts/build/modernizr")) +].filter(Boolean), load("assets/javascripts/build/modernizr")) /* * Build search language support files */ gulp.task("assets:javascripts:build:languages", [ args.clean ? "assets:javascripts:clean" : false -].filter(Boolean), - load("assets/javascripts/build/languages")) +].filter(Boolean), load("assets/javascripts/build/languages")) /* * Build JavaScript @@ -283,8 +278,7 @@ gulp.task("assets:javascripts:lint", gulp.task("assets:stylesheets:build", [ args.clean ? "assets:stylesheets:clean" : false, args.lint ? "assets:stylesheets:lint" : false -].filter(Boolean), - load("assets/stylesheets/build")) +].filter(Boolean), load("assets/stylesheets/build")) /* * Clean stylesheets generated by build @@ -333,8 +327,7 @@ gulp.task("views:build", [ args.revision ? "assets:images:build" : false, args.revision ? "assets:stylesheets:build" : false, args.revision ? "assets:javascripts:build" : false -].filter(Boolean), - load("views/build")) +].filter(Boolean), load("views/build")) /* * Clean views diff --git a/lib/tasks/assets/javascripts/build/languages.js b/lib/tasks/assets/javascripts/build/languages.js index 203915488..4118516d5 100644 --- a/lib/tasks/assets/javascripts/build/languages.js +++ b/lib/tasks/assets/javascripts/build/languages.js @@ -21,7 +21,6 @@ */ import gulpif from "gulp-if" -import path from "path" import uglify from "gulp-uglify" /* ---------------------------------------------------------------------------- diff --git a/package.json b/package.json index 9e9224ecb..d8e09092c 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "devDependencies": { "autoprefixer": "^7.1.1", "babel-core": "^6.25.0", - "babel-eslint": "^7.1.1", + "babel-eslint": "^7.2.3", "babel-loader": "^7.0.0", "babel-plugin-add-module-exports": "^0.2.1", "babel-plugin-transform-react-jsx": "^6.24.1", @@ -53,7 +53,7 @@ "custom-event-polyfill": "^0.3.0", "del": "^3.0.0", "escape-string-regexp": "^1.0.5", - "eslint": "^3.16.0", + "eslint": "^4.0.0", "expose-loader": "^0.7.3", "fastclick": "^1.0.6", "flow-bin": "^0.48.0", diff --git a/src/assets/javascripts/application.js b/src/assets/javascripts/application.js index 6772dbbab..30254cf21 100644 --- a/src/assets/javascripts/application.js +++ b/src/assets/javascripts/application.js @@ -74,7 +74,7 @@ function initialize(config) { // eslint-disable-line func-style /* Create button with message container */ const button = ( ) @@ -136,8 +136,8 @@ function initialize(config) { // eslint-disable-line func-style new Material.Event.Listener(window, [ "scroll", "resize", "orientationchange" ], new Material.Header.Shadow( - "[data-md-component=container]", - "[data-md-component=header]"))) + "[data-md-component=container]", + "[data-md-component=header]"))) /* Component: tabs visibility toggle */ if (document.querySelector("[data-md-component=tabs]")) @@ -150,8 +150,8 @@ function initialize(config) { // eslint-disable-line func-style new Material.Event.Listener(window, [ "scroll", "resize", "orientationchange" ], new Material.Sidebar.Position( - "[data-md-component=navigation]", - "[data-md-component=header]"))) + "[data-md-component=navigation]", + "[data-md-component=header]"))) /* Component: sidebar with table of contents (missing on 404 page) */ if (document.querySelector("[data-md-component=toc]")) @@ -159,8 +159,8 @@ function initialize(config) { // eslint-disable-line func-style new Material.Event.Listener(window, [ "scroll", "resize", "orientationchange" ], new Material.Sidebar.Position( - "[data-md-component=toc]", - "[data-md-component=header]"))) + "[data-md-component=toc]", + "[data-md-component=header]"))) /* Component: link blurring for table of contents */ new Material.Event.MatchMedia("(min-width: 960px)", @@ -180,7 +180,7 @@ function initialize(config) { // eslint-disable-line func-style new Material.Event.MatchMedia("(max-width: 1219px)", new Material.Event.Listener( "[data-md-component=navigation] [data-md-toggle]", "change", - new Material.Nav.Scrolling("[data-md-component=navigation] nav"))) + new Material.Nav.Scrolling("[data-md-component=navigation] nav"))) /* Component: search body lock for mobile */ new Material.Event.MatchMedia("(max-width: 959px)", @@ -191,16 +191,16 @@ function initialize(config) { // eslint-disable-line func-style new Material.Event.Listener("[data-md-component=query]", [ "focus", "keyup", "change" ], new Material.Search.Result("[data-md-component=result]", () => { - return fetch(`${config.url.base}/mkdocs/search_index.json`, { - credentials: "same-origin" - }).then(response => response.json()) - .then(data => { - return data.docs.map(doc => { - doc.location = config.url.base + doc.location - return doc + return fetch(`${config.url.base}/mkdocs/search_index.json`, { + credentials: "same-origin" + }).then(response => response.json()) + .then(data => { + return data.docs.map(doc => { + doc.location = config.url.base + doc.location + return doc + }) }) - }) - })).listen() + })).listen() /* Listener: close drawer when anchor links are clicked */ new Material.Event.MatchMedia("(max-width: 959px)", diff --git a/src/assets/javascripts/components/Material/Search/Result.jsx b/src/assets/javascripts/components/Material/Search/Result.jsx index a85404d41..7c3efdc34 100644 --- a/src/assets/javascripts/components/Material/Search/Result.jsx +++ b/src/assets/javascripts/components/Material/Search/Result.jsx @@ -220,7 +220,7 @@ export default class Result { this.list_.appendChild(