Skip to content

Commit

Permalink
[core] Run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Oct 24, 2020
1 parent f7856e1 commit f7fae8f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
33 changes: 18 additions & 15 deletions packages/storybook/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
const path = require('path');
const webpack = require('webpack');

const env = process.env.NODE_ENV || 'development'
const env = process.env.NODE_ENV || 'development';
/* eslint-disable */
const __DEV__ = env === 'development'
const __PROD__ = env === 'production'
const __DEV__ = env === 'development';
const __PROD__ = env === 'production';
/* eslint-enable */

if (!(__DEV__ || __PROD__)) {
throw new Error(`Unknown env: ${env}.`)
throw new Error(`Unknown env: ${env}.`);
}
console.log(`Loading config for ${env}`)
console.log(`Loading config for ${env}`);
const maxAssetSize = 1024 * 1024;

module.exports = {
Expand All @@ -25,25 +25,25 @@ module.exports = {
],
typescript: {
check: __DEV__, // Netlify is breaking the deploy with this settings on. So deactivate on release
reactDocgen: false
reactDocgen: false,
},
webpackFinal: async config => {
webpackFinal: async (config) => {
config.parallelism = 1;
config.module.rules.push({
test: /\.(ts|tsx)$/,
use: [
{
loader: require.resolve('ts-loader'),
}
},
],
});
if (__DEV__) {
config.module.rules.push({
test: /\.(ts|tsx)$/,
use: ['source-map-loader'],
enforce: 'pre',
exclude: /node_modules/,
include: path.resolve(__dirname, '../../../packages/grid/')
exclude: /node_modules/,
include: path.resolve(__dirname, '../../../packages/grid/'),
});
}

Expand All @@ -54,7 +54,7 @@ module.exports = {
loader: require.resolve('@storybook/source-loader'),
options: {
parser: 'typescript',
prettierConfig: {printWidth: 80, singleQuote: true},
prettierConfig: { printWidth: 80, singleQuote: true },
tsconfigPath: path.resolve(__dirname, '../tsconfig.json'),
},
},
Expand All @@ -68,25 +68,28 @@ module.exports = {
options: {
search: '__RELEASE_INFO__',
replace: 'MTU5NjMxOTIwMDAwMA==', // 2020-08-02
}
},
});

config.optimization = {
splitChunks: {
chunks: 'all',
minSize: 30 * 1024,
maxSize: maxAssetSize,
}
},
};
config.performance = {
maxAssetSize: maxAssetSize
maxAssetSize: maxAssetSize,
};
config.resolve = {
...config.resolve,
extensions: ['.js', '.ts', '.tsx'],
alias: {
'@material-ui/data-grid': path.resolve(__dirname, '../../../packages/grid/data-grid/src'),
'@material-ui/x-grid-data-generator': path.resolve(__dirname, '../../../packages/x-grid-data-generator/src'),
'@material-ui/x-grid-data-generator': path.resolve(
__dirname,
'../../../packages/x-grid-data-generator/src',
),
'@material-ui/x-grid': path.resolve(__dirname, '../../../packages/grid/x-grid/src'),
'@material-ui/x-license': path.resolve(__dirname, '../../../packages/x-license/src'),
},
Expand Down
5 changes: 3 additions & 2 deletions packages/storybook/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LicenseInfo.setLicenseKey(

configureActions({
depth: 3,
limit: 10
limit: 10,
});

addParameters({
Expand All @@ -20,7 +20,8 @@ addParameters({
* @type {Boolean}
*/
isToolshown: true,
storySort: (a, b) => (a[1].kind === b[1].kind ? 0 : a[1].id.localeCompare(b[1].id, undefined, { numeric: true })),
storySort: (a, b) =>
a[1].kind === b[1].kind ? 0 : a[1].id.localeCompare(b[1].id, undefined, { numeric: true }),
},
viewport: {
viewports: INITIAL_VIEWPORTS,
Expand Down

0 comments on commit f7fae8f

Please sign in to comment.