diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..a5ec49122 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,9 @@ +**/node_modules/** +node_modules +**/vendor/** +vendor +**/test/** +**/dist/** + +// being refactored / removed +packages/uikit-workshop/src/scripts/components/styleguide.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..826a1702e --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,86 @@ +module.exports = { + root: true, + env: { + node: true, + builtin: true, + es6: true, + browser: true, + }, + parser: 'babel-eslint', + parserOptions: { + ecmaVersion: 2018, + sourceType: 'module', + allowImportExportEverywhere: true, + ecmaFeatures: { + jsx: true, + experimentalDecorators: true, + }, + }, + globals: {}, + plugins: ['prettier'], + extends: ['eslint-config-prettier'].map(require.resolve), + rules: { + 'prettier/prettier': 'error', + 'block-scoped-var': 0, + camelcase: 0, + 'consistent-return': 2, + curly: [2, 'all'], + 'dot-notation': [1, { allowKeywords: true }], + eqeqeq: [2, 'allow-null'], + 'global-strict': [0, 'never'], + 'guard-for-in': 2, + 'key-spacing': 0, + 'new-cap': 0, + 'no-alert': 2, + 'no-bitwise': 2, + 'no-caller': 2, + 'no-cond-assign': [2, 'except-parens'], + 'no-debugger': 2, + 'no-dupe-args': 2, + 'no-dupe-keys': 2, + 'no-empty': 2, + 'no-eval': 2, + 'no-extend-native': 2, + 'no-extra-bind': 2, + 'no-extra-parens': 0, + 'no-func-assign': 2, + 'no-implied-eval': 2, + 'no-invalid-regexp': 2, + 'no-irregular-whitespace': 1, + 'no-iterator': 2, + 'no-loop-func': 2, + 'no-mixed-requires': 0, + 'no-multi-str': 2, + 'no-native-reassign': 2, + 'no-new': 2, + 'no-param-reassign': 1, + 'no-proto': 2, + 'no-redeclare': 0, + 'no-script-url': 2, + 'no-self-assign': 2, + 'no-self-compare': 2, + 'no-sequences': 2, + 'no-shadow': 2, + 'no-undef': 2, + 'no-underscore-dangle': 0, + 'no-unreachable': 1, + 'no-unused-vars': 1, + 'no-use-before-define': 1, + 'no-useless-call': 2, + 'no-useless-concat': 2, + 'no-var': 2, + 'no-with': 2, + quotes: [0, 'single'], + radix: 2, + strict: 0, + 'valid-typeof': 2, + 'vars-on-top': 0, + 'prefer-const': [ + 'error', + { + destructuring: 'any', + ignoreReadBeforeAssign: false, + }, + ], + }, +}; diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 97eec591f..000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "root": true, - "env": { - "node": true, - "builtin": true, - "es6": true - }, - "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module" - }, - "globals": {}, - "extends": ["prettier"], - "plugins": ["prettier"], - "rules": { - "prettier/prettier": "error", - "block-scoped-var": 0, - "camelcase": 0, - "consistent-return": 2, - "curly": [2, "all"], - "dot-notation": [1, { "allowKeywords": true }], - "eqeqeq": [2, "allow-null"], - "global-strict": [0, "never"], - "guard-for-in": 2, - "key-spacing": 0, - "new-cap": 0, - "no-alert": 2, - "no-bitwise": 2, - "no-caller": 2, - "no-cond-assign": [2, "except-parens"], - "no-debugger": 2, - "no-dupe-args": 2, - "no-dupe-keys": 2, - "no-empty": 2, - "no-eval": 2, - "no-extend-native": 2, - "no-extra-bind": 2, - "no-extra-parens": 0, - "no-func-assign": 2, - "no-implied-eval": 2, - "no-invalid-regexp": 2, - "no-irregular-whitespace": 1, - "no-iterator": 2, - "no-loop-func": 2, - "no-mixed-requires": 0, - "no-multi-str": 2, - "no-native-reassign": 2, - "no-new": 2, - "no-param-reassign": 1, - "no-proto": 2, - "no-redeclare": 0, - "no-script-url": 2, - "no-self-assign": 2, - "no-self-compare": 2, - "no-sequences": 2, - "no-shadow": 2, - "no-undef": 2, - "no-underscore-dangle": 0, - "no-unreachable": 1, - "no-unused-vars": 1, - "no-use-before-define": 1, - "no-useless-call": 2, - "no-useless-concat": 2, - "no-var": 2, - "no-with": 2, - "quotes": [0, "single"], - "radix": 2, - "strict": 0, - "valid-typeof": 2, - "vars-on-top": 0, - "prefer-const": [ - "error", - { - "destructuring": "any", - "ignoreReadBeforeAssign": false - } - ] - } -} diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 000000000..6960ccf61 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,27 @@ +module.exports = { + presets: [ + [ + '@babel/preset-env', + { + targets: { + node: 'current', + }, + }, + ], + ], + plugins: [ + /** + * 1. Helps with our Web Component Preact renderer + */ + '@babel/plugin-syntax-jsx' /* [1] */, + [ + '@babel/plugin-transform-react-jsx' /* [1] */, + { + pragma: 'h', + pragmaFrag: '"span"', + throwIfNamespace: false, + useBuiltIns: false, + }, + ], + ], +}; diff --git a/lerna.json b/lerna.json index 776f2c56b..364215cbe 100644 --- a/lerna.json +++ b/lerna.json @@ -14,7 +14,8 @@ "eslin*", "husky", "prettier", - "pretty-quick" + "pretty-quick", + "babel-eslint" ] }, "publish": { diff --git a/package.json b/package.json index d95e7889c..fd9ea8fe6 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,26 @@ { "dependencies": { + "@babel/plugin-proposal-decorators": "^7.4.4", + "@babel/plugin-syntax-jsx": "^7.2.0", + "babel-eslint": "^10.0.2", + "eslint": "^6.1.0", + "eslint-config-airbnb-base": "^14.0.0", + "eslint-config-prettier": "^6.0.0", + "eslint-plugin-import": "^2.18.2", + "eslint-plugin-prettier": "^3.1.0", "lerna": "3.11.0", "prettier": "^1.14.3", - "pretty-quick": "^1.8.0" + "pretty-quick": "^1.11.1" }, "private": true, "scripts": { + "postinstall": "npm run bootstrap", "bootstrap": "lerna bootstrap", - "setup": "npm install && npm run bootstrap && npm run build:uikit", + "setup": "npm install && npm run build:uikit", "build:uikit": "cd packages/uikit-workshop && npm run build", "precommit": "pretty-quick --staged", - "prettier": "prettier --config .prettierrc --write ./**/*.js --ignore-path .prettierignore", + "lint:fix": "npm run lint -- --fix", + "lint": "eslint --max-warnings 0 './packages/{core,cli,uikit-workshop}/**/*.js ' --ignore-path .eslintignore", "test": "lerna run test", "clean": "git clean -dfx" }, diff --git a/packages/cli/bin/cli-actions/disable.js b/packages/cli/bin/cli-actions/disable.js index ebf90ef60..6c53cb5a2 100644 --- a/packages/cli/bin/cli-actions/disable.js +++ b/packages/cli/bin/cli-actions/disable.js @@ -12,7 +12,10 @@ const writeJsonAsync = require('../utils').writeJsonAsync; */ const enable = options => wrapAsync(function*() { - const { parent: { config: configPath }, plugins } = options; + const { + parent: { config: configPath }, + plugins, + } = options; const config = yield resolveConfig(configPath); const spinner = ora(`⊙ patternlab → Disable …`).start(); diff --git a/packages/cli/bin/cli-actions/enable.js b/packages/cli/bin/cli-actions/enable.js index d7095f25f..0edb57401 100644 --- a/packages/cli/bin/cli-actions/enable.js +++ b/packages/cli/bin/cli-actions/enable.js @@ -12,7 +12,10 @@ const writeJsonAsync = require('../utils').writeJsonAsync; */ const enable = options => wrapAsync(function*() { - const { parent: { config: configPath }, plugins } = options; + const { + parent: { config: configPath }, + plugins, + } = options; const config = yield resolveConfig(configPath); const spinner = ora(`⊙ patternlab → Enable …`).start(); diff --git a/packages/cli/bin/install-edition.js b/packages/cli/bin/install-edition.js index 5e63efd28..1b8f9d8d8 100644 --- a/packages/cli/bin/install-edition.js +++ b/packages/cli/bin/install-edition.js @@ -1,3 +1,4 @@ +/* eslint-disable no-param-reassign */ 'use strict'; const path = require('path'); @@ -35,7 +36,9 @@ const installEdition = (edition, config, projectDir) => { pkg.dependencies || {}, yield getJSONKey(edition, 'dependencies') ); // 3 - switch (edition) { // 4 + switch ( + edition // 4 + ) { // 4.1 case '@pattern-lab/edition-node-gulp': { yield copyAsync( diff --git a/packages/cli/bin/patternlab.js b/packages/cli/bin/patternlab.js index 0e7eeed22..a76468994 100755 --- a/packages/cli/bin/patternlab.js +++ b/packages/cli/bin/patternlab.js @@ -1,4 +1,5 @@ #!/usr/bin/env node +/* eslint-disable no-unused-vars */ 'use strict'; const cli = require('commander'); const path = require('path'); diff --git a/packages/cli/bin/utils.js b/packages/cli/bin/utils.js index aae408bbb..95f0502ee 100644 --- a/packages/cli/bin/utils.js +++ b/packages/cli/bin/utils.js @@ -96,10 +96,8 @@ const wrapAsync = fn => */ const asyncGlob = (pattern, opts) => new Promise((resolve, reject) => - glob( - pattern, - opts, - (err, matches) => (err !== null ? reject(err) : resolve(matches)) + glob(pattern, opts, (err, matches) => + err !== null ? reject(err) : resolve(matches) ) ); diff --git a/packages/core/.eslintrc.js b/packages/core/.eslintrc.js new file mode 100644 index 000000000..5a2cc7f1e --- /dev/null +++ b/packages/core/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ['../../.eslintrc.js'], +}; diff --git a/packages/core/package.json b/packages/core/package.json index 02652d3d6..fa71d5417 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -21,13 +21,19 @@ "update-notifier": "2.2.0" }, "devDependencies": { - "eslint": "4.18.2", - "eslint-config-prettier": "2.9.0", - "eslint-plugin-prettier": "2.6.0", + "@babel/core": "^7.5.5", + "@babel/plugin-proposal-decorators": "^7.4.4", + "@babel/plugin-syntax-jsx": "^7.2.0", + "babel-eslint": "^10.0.2", + "eslint": "^6.1.0", + "eslint-config-airbnb-base": "^14.0.0", + "eslint-config-prettier": "^6.0.0", + "eslint-plugin-import": "^2.18.2", + "eslint-plugin-prettier": "^3.1.0", + "prettier": "^1.14.3", "husky": "0.14.3", "jsdoc-to-markdown": "3.0.0", - "prettier": "1.11.1", - "pretty-quick": "1.2.2", + "pretty-quick": "^1.11.1", "rewire": "2.5.2", "standard-version": "4.3.0", "tap": "11.1.1" @@ -59,7 +65,7 @@ "license": "MIT", "scripts": { "docs": "node ./scripts/docs.js", - "lint": "eslint src/**/*.js", + "lint": "eslint -c ../../.eslintrc.js 'src/**/*.js'", "pretest": "npm run lint", "release": "standard-version", "test": "tap test/*_tests.js --reporter spec --coverage" diff --git a/packages/uikit-workshop/src/scripts/components/base-component.js b/packages/uikit-workshop/src/scripts/components/base-component.js index 1e1594993..5a5b3bbab 100644 --- a/packages/uikit-workshop/src/scripts/components/base-component.js +++ b/packages/uikit-workshop/src/scripts/components/base-component.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import { withComponent, shadow } from 'skatejs'; import withPreact from '@skatejs/renderer-preact'; import { store } from '../store.js'; diff --git a/packages/uikit-workshop/src/scripts/components/modal-styleguide.js b/packages/uikit-workshop/src/scripts/components/modal-styleguide.js index 7c31a3eba..ad9f030ca 100644 --- a/packages/uikit-workshop/src/scripts/components/modal-styleguide.js +++ b/packages/uikit-workshop/src/scripts/components/modal-styleguide.js @@ -1,3 +1,4 @@ +/* eslint-disable no-param-reassign, no-unused-vars */ /** * "Modal" (aka Panel UI) for the Styleguide Layer - for both annotations and code/info */ diff --git a/packages/uikit-workshop/src/scripts/components/modal-viewer.js b/packages/uikit-workshop/src/scripts/components/modal-viewer.js index c2bf7cabb..25bf70a3d 100644 --- a/packages/uikit-workshop/src/scripts/components/modal-viewer.js +++ b/packages/uikit-workshop/src/scripts/components/modal-viewer.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ /** * "Modal" (aka Panel UI) for the Viewer Layer - for both annotations and code/info */ diff --git a/packages/uikit-workshop/src/scripts/components/panels-util.js b/packages/uikit-workshop/src/scripts/components/panels-util.js index 8a9c6d0ac..0e7d2e73d 100644 --- a/packages/uikit-workshop/src/scripts/components/panels-util.js +++ b/packages/uikit-workshop/src/scripts/components/panels-util.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ /** * Panels Util - for both styleguide and viewer */ diff --git a/packages/uikit-workshop/src/scripts/components/panels-viewer.js b/packages/uikit-workshop/src/scripts/components/panels-viewer.js index 3471cd7ae..fc75afdab 100644 --- a/packages/uikit-workshop/src/scripts/components/panels-viewer.js +++ b/packages/uikit-workshop/src/scripts/components/panels-viewer.js @@ -1,6 +1,7 @@ /** * Panel Builder - supports building the panels to be included in the modal or styleguide */ +/* eslint-disable no-param-reassign, no-unused-vars */ import $ from 'jquery'; import Hogan from 'hogan.js'; @@ -307,6 +308,7 @@ export const panelsViewer = { * 5) Add mouseup event to the body so that when drag is released, the modal * stops resizing and modal cover doesn't display anymore. */ +// eslint-disable-next-line no-unused-vars $('.pl-js-modal-resizer').mousedown(function(event) { /* 1 */ diff --git a/packages/uikit-workshop/src/scripts/components/pl-controls/pl-controls.js b/packages/uikit-workshop/src/scripts/components/pl-controls/pl-controls.js index eda96d7e0..c449d335d 100644 --- a/packages/uikit-workshop/src/scripts/components/pl-controls/pl-controls.js +++ b/packages/uikit-workshop/src/scripts/components/pl-controls/pl-controls.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars, no-param-reassign */ import { define, props } from 'skatejs'; import { h } from 'preact'; const classNames = require('classnames'); diff --git a/packages/uikit-workshop/src/scripts/components/pl-drawer/pl-drawer.js b/packages/uikit-workshop/src/scripts/components/pl-drawer/pl-drawer.js index 1c35b77cb..5f7ba9363 100644 --- a/packages/uikit-workshop/src/scripts/components/pl-drawer/pl-drawer.js +++ b/packages/uikit-workshop/src/scripts/components/pl-drawer/pl-drawer.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars, no-param-reassign */ import { define, props } from 'skatejs'; import { h } from 'preact'; import { store } from '../../store.js'; // redux store @@ -13,7 +14,7 @@ import { BaseComponent } from '../base-component.js'; import AnimateHeight from 'react-animate-height'; @define -export class Drawer extends BaseComponent { +class Drawer extends BaseComponent { static is = 'pl-drawer'; constructor(self) { @@ -92,7 +93,9 @@ export class Drawer extends BaseComponent { const height = drawerOpened && !isViewallPage - ? drawerHeight > 20 ? drawerHeight : 300 + ? drawerHeight > 20 + ? drawerHeight + : 300 : 0; return ( @@ -151,3 +154,5 @@ export class Drawer extends BaseComponent { this.isViewallPage = state.app.isViewallPage; } } + +export { Drawer }; diff --git a/packages/uikit-workshop/src/scripts/components/pl-header/pl-header.js b/packages/uikit-workshop/src/scripts/components/pl-header/pl-header.js index 1d56add10..383c55798 100644 --- a/packages/uikit-workshop/src/scripts/components/pl-header/pl-header.js +++ b/packages/uikit-workshop/src/scripts/components/pl-header/pl-header.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars, no-param-reassign */ import { define, props } from 'skatejs'; import { h } from 'preact'; const classNames = require('classnames'); diff --git a/packages/uikit-workshop/src/scripts/components/pl-layout/pl-layout.js b/packages/uikit-workshop/src/scripts/components/pl-layout/pl-layout.js index 856e9a3ce..e5c80c698 100644 --- a/packages/uikit-workshop/src/scripts/components/pl-layout/pl-layout.js +++ b/packages/uikit-workshop/src/scripts/components/pl-layout/pl-layout.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars, no-param-reassign */ import { define, props } from 'skatejs'; import { h } from 'preact'; const classNames = require('classnames'); diff --git a/packages/uikit-workshop/src/scripts/components/pl-nav/pl-nav.js b/packages/uikit-workshop/src/scripts/components/pl-nav/pl-nav.js index 941739a1d..3ebdac07d 100644 --- a/packages/uikit-workshop/src/scripts/components/pl-nav/pl-nav.js +++ b/packages/uikit-workshop/src/scripts/components/pl-nav/pl-nav.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars, no-shadow */ import { define, props } from 'skatejs'; import { h } from 'preact'; const classNames = require('classnames'); diff --git a/packages/uikit-workshop/src/scripts/components/pl-search/pl-search.js b/packages/uikit-workshop/src/scripts/components/pl-search/pl-search.js index c27480a44..5e9ecb70a 100644 --- a/packages/uikit-workshop/src/scripts/components/pl-search/pl-search.js +++ b/packages/uikit-workshop/src/scripts/components/pl-search/pl-search.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars, no-param-reassign */ import { define, props } from 'skatejs'; import { h } from 'preact'; import Fuse from 'fuse.js'; @@ -76,7 +77,7 @@ class Search extends BaseComponent { }; onInput = e => { - let value = e.target.value; + const value = e.target.value; this.setState({ value: value, diff --git a/packages/uikit-workshop/src/scripts/components/pl-toggle-info/pl-toggle-info.js b/packages/uikit-workshop/src/scripts/components/pl-toggle-info/pl-toggle-info.js index 748314da5..50840a970 100644 --- a/packages/uikit-workshop/src/scripts/components/pl-toggle-info/pl-toggle-info.js +++ b/packages/uikit-workshop/src/scripts/components/pl-toggle-info/pl-toggle-info.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars, no-param-reassign */ import { define, props } from 'skatejs'; import { h } from 'preact'; diff --git a/packages/uikit-workshop/src/scripts/components/pl-toggle-layout/pl-toggle-layout.js b/packages/uikit-workshop/src/scripts/components/pl-toggle-layout/pl-toggle-layout.js index 24ab5402a..55e58b963 100644 --- a/packages/uikit-workshop/src/scripts/components/pl-toggle-layout/pl-toggle-layout.js +++ b/packages/uikit-workshop/src/scripts/components/pl-toggle-layout/pl-toggle-layout.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars, no-param-reassign */ import { define, props } from 'skatejs'; import { h } from 'preact'; diff --git a/packages/uikit-workshop/src/scripts/components/pl-toggle-theme/pl-toggle-theme.js b/packages/uikit-workshop/src/scripts/components/pl-toggle-theme/pl-toggle-theme.js index a2cc7c80c..320d56de0 100644 --- a/packages/uikit-workshop/src/scripts/components/pl-toggle-theme/pl-toggle-theme.js +++ b/packages/uikit-workshop/src/scripts/components/pl-toggle-theme/pl-toggle-theme.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars, no-param-reassign */ import { define, props } from 'skatejs'; import { h } from 'preact'; diff --git a/packages/uikit-workshop/src/scripts/components/pl-tools-menu/pl-tools-menu.js b/packages/uikit-workshop/src/scripts/components/pl-tools-menu/pl-tools-menu.js index 8fe293c4a..60e0b5f37 100644 --- a/packages/uikit-workshop/src/scripts/components/pl-tools-menu/pl-tools-menu.js +++ b/packages/uikit-workshop/src/scripts/components/pl-tools-menu/pl-tools-menu.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import { define, props } from 'skatejs'; import { BaseComponent } from '../base-component.js'; import { urlHandler, patternName } from '../../utils'; diff --git a/packages/uikit-workshop/src/scripts/components/pl-viewport-size-list/pl-viewport-size-list.js b/packages/uikit-workshop/src/scripts/components/pl-viewport-size-list/pl-viewport-size-list.js index 1b5f8ab78..8a196c2e3 100644 --- a/packages/uikit-workshop/src/scripts/components/pl-viewport-size-list/pl-viewport-size-list.js +++ b/packages/uikit-workshop/src/scripts/components/pl-viewport-size-list/pl-viewport-size-list.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import { h } from 'preact'; export const ViewportSizeList = ishControlsHide => { diff --git a/packages/uikit-workshop/src/scripts/components/pl-viewport-size/pl-viewport-size.js b/packages/uikit-workshop/src/scripts/components/pl-viewport-size/pl-viewport-size.js index 8a405cead..080bd1c68 100644 --- a/packages/uikit-workshop/src/scripts/components/pl-viewport-size/pl-viewport-size.js +++ b/packages/uikit-workshop/src/scripts/components/pl-viewport-size/pl-viewport-size.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import { h } from 'preact'; export const ViewportSize = ishControlsHide => { diff --git a/packages/uikit-workshop/src/scripts/components/pl-viewport/pl-viewport.js b/packages/uikit-workshop/src/scripts/components/pl-viewport/pl-viewport.js index 5de9f575a..00ec1801a 100644 --- a/packages/uikit-workshop/src/scripts/components/pl-viewport/pl-viewport.js +++ b/packages/uikit-workshop/src/scripts/components/pl-viewport/pl-viewport.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars, no-param-reassign */ import { define, props } from 'skatejs'; import { h } from 'preact'; const classNames = require('classnames'); diff --git a/packages/uikit-workshop/src/scripts/patternlab-viewer.js b/packages/uikit-workshop/src/scripts/patternlab-viewer.js index 68e924c53..77c9fb4eb 100755 --- a/packages/uikit-workshop/src/scripts/patternlab-viewer.js +++ b/packages/uikit-workshop/src/scripts/patternlab-viewer.js @@ -1,6 +1,6 @@ import { loadPolyfills } from './utils/polyfills'; -loadPolyfills.then(res => { +loadPolyfills.then(() => { import( /* webpackMode: 'lazy', webpackChunkName: 'pl-layout' */ './components/pl-layout/pl-layout' ); diff --git a/packages/uikit-workshop/src/scripts/store.js b/packages/uikit-workshop/src/scripts/store.js index 767c11bfd..07de940b4 100644 --- a/packages/uikit-workshop/src/scripts/store.js +++ b/packages/uikit-workshop/src/scripts/store.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import { createStore, applyMiddleware, @@ -16,7 +17,10 @@ const compose = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || origCompose; export const store = createStore( (state, action) => state, loadState(), // If there is local storage data, load it. - compose(lazyReducerEnhancer(combineReducers), applyMiddleware(thunk)) + compose( + lazyReducerEnhancer(combineReducers), + applyMiddleware(thunk) + ) ); store.addReducers({ diff --git a/packages/uikit-workshop/src/scripts/utils/extend.js b/packages/uikit-workshop/src/scripts/utils/extend.js index 0c657e37d..f97d9a5a2 100644 --- a/packages/uikit-workshop/src/scripts/utils/extend.js +++ b/packages/uikit-workshop/src/scripts/utils/extend.js @@ -1,3 +1,4 @@ +/* eslint-disable guard-for-in */ export function extend(obj, props) { for (const i in props) { obj[i] = props[i]; diff --git a/packages/uikit-workshop/src/scripts/utils/url-handler.js b/packages/uikit-workshop/src/scripts/utils/url-handler.js index 7d47dd056..8f2bb40b1 100644 --- a/packages/uikit-workshop/src/scripts/utils/url-handler.js +++ b/packages/uikit-workshop/src/scripts/utils/url-handler.js @@ -34,7 +34,7 @@ export const urlHandler = { } if (withRenderedSuffix === undefined) { - withRenderedSuffix = true; + withRenderedSuffix = true; // eslint-disable-line no-param-reassign } if (name === 'all') { @@ -130,7 +130,7 @@ export const urlHandler = { */ getRequestVars() { // the following is taken from https://developer.mozilla.org/en-US/docs/Web/API/window.location - const oGetVars = new function(sSearch) { + const oGetVars = new (function(sSearch) { if (sSearch.length > 1) { for ( let aItKey, nKeyId = 0, aCouples = sSearch.substr(1).split('&'); @@ -142,7 +142,7 @@ export const urlHandler = { aItKey.length > 1 ? unescape(aItKey[1]) : ''; } } - }(window.location.search); + })(window.location.search); return oGetVars; }, diff --git a/packages/uikit-workshop/webpack.config.js b/packages/uikit-workshop/webpack.config.js index 87187dc16..d526d89ed 100644 --- a/packages/uikit-workshop/webpack.config.js +++ b/packages/uikit-workshop/webpack.config.js @@ -20,8 +20,8 @@ const defaultConfig = { publicPath: './styleguide/', }; -module.exports = async function() { - return new Promise(async (resolve, reject) => { +module.exports = function() { + return new Promise(async resolve => { let customConfig = defaultConfig; const configToSearchFor = await explorer.searchSync();