提交 dbd9ad0b 编写于 作者: K Kamran Ahmed

Enable eslint, use spread and build update

上级 a5a663a5
......@@ -41,4 +41,4 @@ export const POPOVER_HTML = `
</div>`;
export const OVERLAY_HTML = `<div id="${ID_OVERLAY}"></div>`;
export const STAGE_HTML = `<div id="${ID_STAGE}"></div>`;
\ No newline at end of file
export const STAGE_HTML = `<div id="${ID_STAGE}"></div>`;
......@@ -24,7 +24,7 @@ export default class Driver {
* @param {Object} options
*/
constructor(options = {}) {
this.options = Object.assign({
this.options = {
animate: OVERLAY_ANIMATE, // Whether to animate or not
opacity: OVERLAY_OPACITY, // Overlay opacity
padding: OVERLAY_PADDING, // Spacing around the element from the overlay
......@@ -35,7 +35,8 @@ export default class Driver {
},
onDeselected: () => { // When the element has been deselected
},
}, options);
...options,
};
this.document = document;
this.window = window;
......@@ -244,11 +245,10 @@ export default class Driver {
querySelector = currentStep;
} else {
querySelector = currentStep.element;
elementOptions = Object.assign(
{},
this.options,
currentStep,
);
elementOptions = {
...this.options,
...currentStep,
};
}
const domElement = this.document.querySelector(querySelector);
......@@ -259,17 +259,14 @@ export default class Driver {
let popover = null;
if (elementOptions.popover && elementOptions.popover.description) {
const popoverOptions = Object.assign(
{},
this.options,
elementOptions.popover,
{
totalCount: allSteps.length,
currentIndex: index,
isFirst: index === 0,
isLast: index === allSteps.length - 1,
},
);
const popoverOptions = {
...this.options,
...elementOptions.popover,
totalCount: allSteps.length,
currentIndex: index,
isFirst: index === 0,
isLast: index === allSteps.length - 1,
};
popover = new Popover(popoverOptions, this.window, this.document);
}
......
......@@ -18,23 +18,26 @@ module.exports = {
},
module: {
rules: [
// {
// test: /\.js$/,
// exclude: /node_modules/,
// loader: 'eslint-loader',
// enforce: 'pre',
// options: {
// failOnWarning: false,
// failOnError: true,
// },
// },
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'eslint-loader',
enforce: 'pre',
options: {
failOnWarning: false,
failOnError: true,
},
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
presets: ['env'],
plugins: ['babel-plugin-add-module-exports'],
plugins: [
'babel-plugin-add-module-exports',
'transform-object-rest-spread',
],
},
},
{
......
......@@ -32,7 +32,10 @@ module.exports = {
loader: 'babel-loader',
options: {
presets: ['env'],
plugins: ['babel-plugin-add-module-exports'],
plugins: [
'babel-plugin-add-module-exports',
'transform-object-rest-spread',
],
},
},
{
......
......@@ -833,7 +833,7 @@ babel-plugin-transform-flow-strip-types@^6.8.0:
babel-plugin-syntax-flow "^6.18.0"
babel-runtime "^6.22.0"
babel-plugin-transform-object-rest-spread@^6.22.0:
babel-plugin-transform-object-rest-spread@^6.22.0, babel-plugin-transform-object-rest-spread@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06"
dependencies:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册