Skip to content

Commit

Permalink
chore(style): re-run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
STRML committed Oct 10, 2019
1 parent fcb2305 commit a0936f7
Show file tree
Hide file tree
Showing 20 changed files with 55 additions and 48 deletions.
2 changes: 1 addition & 1 deletion test/examples/0-showcase.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,5 @@ function generateLayout() {
}

if (process.env.STATIC_EXAMPLES === true) {
import("../test-hook.jsx").then((fn) => fn.default(ShowcaseLayout));
import("../test-hook.jsx").then(fn => fn.default(ShowcaseLayout));
}
2 changes: 1 addition & 1 deletion test/examples/1-basic.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ export default class BasicLayout extends React.PureComponent {
}

if (process.env.STATIC_EXAMPLES === true) {
import("../test-hook.jsx").then((fn) => fn.default(BasicLayout));
import("../test-hook.jsx").then(fn => fn.default(BasicLayout));
}
4 changes: 2 additions & 2 deletions test/examples/10-dynamic-min-max-wh.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const ReactGridLayout = WidthProvider(RGL);
* In this grid, all elements are allowed a max width of 2 if the height < 3,
* and a min width of 2 if the height >= 3.
*/
export default class DynamicMinMaxLayout extends React.PureComponent {
export default class DynamicMinMaxLayout extends React.PureComponent {
static defaultProps = {
isDraggable: true,
isResizable: true,
Expand Down Expand Up @@ -80,5 +80,5 @@ const ReactGridLayout = WidthProvider(RGL);
}

if (process.env.STATIC_EXAMPLES === true) {
import("../test-hook.jsx").then((fn) => fn.default(DynamicMinMaxLayout));
import("../test-hook.jsx").then(fn => fn.default(DynamicMinMaxLayout));
}
2 changes: 1 addition & 1 deletion test/examples/11-no-vertical-compact.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ export default class NoCompactingLayout extends React.PureComponent {
}

if (process.env.STATIC_EXAMPLES === true) {
import("../test-hook.jsx").then((fn) => fn.default(NoCompactingLayout));
import("../test-hook.jsx").then(fn => fn.default(NoCompactingLayout));
}
2 changes: 1 addition & 1 deletion test/examples/12-prevent-collision.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ export default class NoCollisionLayout extends React.PureComponent {
}

if (process.env.STATIC_EXAMPLES === true) {
import("../test-hook.jsx").then((fn) => fn.default(NoCollisionLayout));
import("../test-hook.jsx").then(fn => fn.default(NoCollisionLayout));
}
2 changes: 1 addition & 1 deletion test/examples/13-error-case.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ export default class ErrorCaseLayout extends React.PureComponent {
}

if (process.env.STATIC_EXAMPLES === true) {
import("../test-hook.jsx").then((fn) => fn.default(ErrorCaseLayout));
import("../test-hook.jsx").then(fn => fn.default(ErrorCaseLayout));
}
2 changes: 1 addition & 1 deletion test/examples/14-toolbox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,5 +206,5 @@ function generateLayout() {
}

if (process.env.STATIC_EXAMPLES === true) {
import("../test-hook.jsx").then((fn) => fn.default(ToolboxLayout));
import("../test-hook.jsx").then(fn => fn.default(ToolboxLayout));
}
2 changes: 1 addition & 1 deletion test/examples/15-drag-from-outside.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,5 @@ function generateLayout() {
}

if (process.env.STATIC_EXAMPLES === true) {
import("../test-hook.jsx").then((fn) => fn.default(DragFromOutsideLayout));
import("../test-hook.jsx").then(fn => fn.default(DragFromOutsideLayout));
}
2 changes: 1 addition & 1 deletion test/examples/16-responsive-bootstrap-style.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ export default class BootstrapStyleLayout extends React.PureComponent {
}

if (process.env.STATIC_EXAMPLES === true) {
import("../test-hook.jsx").then((fn) => fn.default(BootstrapStyleLayout));
import("../test-hook.jsx").then(fn => fn.default(BootstrapStyleLayout));
}
2 changes: 1 addition & 1 deletion test/examples/2-no-dragging.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ export default class NoDraggingLayout extends React.PureComponent {
}

if (process.env.STATIC_EXAMPLES === true) {
import("../test-hook.jsx").then((fn) => fn.default(NoDraggingLayout));
import("../test-hook.jsx").then(fn => fn.default(NoDraggingLayout));
}
2 changes: 1 addition & 1 deletion test/examples/3-messy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ export default class MessyLayout extends React.PureComponent {
}

if (process.env.STATIC_EXAMPLES === true) {
import("../test-hook.jsx").then((fn) => fn.default(MessyLayout));
import("../test-hook.jsx").then(fn => fn.default(MessyLayout));
}
2 changes: 1 addition & 1 deletion test/examples/4-grid-property.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ export default class GridPropertyLayout extends React.PureComponent {
}

if (process.env.STATIC_EXAMPLES === true) {
import("../test-hook.jsx").then((fn) => fn.default(GridPropertyLayout));
import("../test-hook.jsx").then(fn => fn.default(GridPropertyLayout));
}
2 changes: 1 addition & 1 deletion test/examples/5-static-elements.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ export default class StaticElementsLayout extends React.PureComponent {
}

if (process.env.STATIC_EXAMPLES === true) {
import("../test-hook.jsx").then((fn) => fn.default(StaticElementsLayout));
import("../test-hook.jsx").then(fn => fn.default(StaticElementsLayout));
}
2 changes: 1 addition & 1 deletion test/examples/6-dynamic-add-remove.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,5 @@ export default class AddRemoveLayout extends React.PureComponent {
}

if (process.env.STATIC_EXAMPLES === true) {
import("../test-hook.jsx").then((fn) => fn.default(AddRemoveLayout));
import("../test-hook.jsx").then(fn => fn.default(AddRemoveLayout));
}
4 changes: 2 additions & 2 deletions test/examples/7-localstorage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const originalLayout = getFromLS("layout") || [];
/**
* This layout demonstrates how to sync to localstorage.
*/
export default class LocalStorageLayout extends React.PureComponent {
export default class LocalStorageLayout extends React.PureComponent {
static defaultProps = {
className: "layout",
cols: 12,
Expand Down Expand Up @@ -92,5 +92,5 @@ function saveToLS(key, value) {
}

if (process.env.STATIC_EXAMPLES === true) {
import("../test-hook.jsx").then((fn) => fn.default(LocalStorageLayout));
import("../test-hook.jsx").then(fn => fn.default(LocalStorageLayout));
}
4 changes: 3 additions & 1 deletion test/examples/8-localstorage-responsive.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,7 @@ function saveToLS(key, value) {
}

if (process.env.STATIC_EXAMPLES === true) {
import("../test-hook.jsx").then((fn) => fn.default(ResponsiveLocalStorageLayout));
import("../test-hook.jsx").then(fn =>
fn.default(ResponsiveLocalStorageLayout)
);
}
2 changes: 1 addition & 1 deletion test/examples/9-min-max-wh.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ export default class MinMaxLayout extends React.PureComponent {
}

if (process.env.STATIC_EXAMPLES === true) {
import("../test-hook.jsx").then((fn) => fn.default(MinMaxLayout));
import("../test-hook.jsx").then(fn => fn.default(MinMaxLayout));
}
6 changes: 2 additions & 4 deletions webpack-dev-server.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ module.exports = {
loader: "babel-loader",
query: {
cacheDirectory: true,
plugins: [
['react-hot-loader/babel']
]
plugins: [["react-hot-loader/babel"]]
}
}
]
Expand All @@ -39,7 +37,7 @@ module.exports = {
compress: true,
port: 4002,
open: true,
contentBase: '.',
contentBase: "."
},
resolve: {
extensions: [".webpack.js", ".web.js", ".js", ".jsx"],
Expand Down
43 changes: 25 additions & 18 deletions webpack-examples.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
const webpack = require('webpack');
const fs = require('fs');
"use strict";
const webpack = require("webpack");
const fs = require("fs");

// Builds example bundles
module.exports = {
Expand All @@ -23,30 +23,35 @@ module.exports = {
output: {
path: __dirname + "/dist",
filename: "[name].js",
sourceMapFilename: "[file].map",
sourceMapFilename: "[file].map"
},
module: {
rules: [
{test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader', query: {
cacheDirectory: true,
}}
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: "babel-loader",
query: {
cacheDirectory: true
}
}
]
},
plugins: [
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production"),
// sigil to load self into #content
STATIC_EXAMPLES: JSON.stringify(true),
},
STATIC_EXAMPLES: JSON.stringify(true)
}
})
],
devServer: {
port: 4002,
open: true,
openPage: 'examples/0-showcase.html',
contentBase: '.',
publicPath: '/examples/'
openPage: "examples/0-showcase.html",
contentBase: ".",
publicPath: "/examples/"
},
resolve: {
extensions: [".js", ".jsx"],
Expand All @@ -55,11 +60,13 @@ module.exports = {
};

// Load all entry points
const files = fs.readdirSync(__dirname + '/test/examples').filter(function(element, index, array){
return element.match(/^.+\.jsx$/);
});
const files = fs
.readdirSync(__dirname + "/test/examples")
.filter(function(element, index, array) {
return element.match(/^.+\.jsx$/);
});

for (const file of files){
const module_name = file.replace(/\.jsx$/,'');
module.exports.entry[module_name] = './test/examples/' + file;
for (const file of files) {
const module_name = file.replace(/\.jsx$/, "");
module.exports.entry[module_name] = "./test/examples/" + file;
}
14 changes: 7 additions & 7 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ module.exports = {
root: "React"
},
"react-dom": {
"commonjs": "react-dom",
"commonjs2": "react-dom",
"amd": "react-dom",
"root": "ReactDOM"
commonjs: "react-dom",
commonjs2: "react-dom",
amd: "react-dom",
root: "ReactDOM"
}
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
test: /\.jsx?$/,
exclude: /node_modules/,
loader: "babel-loader",
query: {
cacheDirectory: true,
cacheDirectory: true
}
}
]
Expand Down

0 comments on commit a0936f7

Please sign in to comment.