Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples: Fix build on master #9759

Merged
merged 5 commits into from Feb 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.js
Expand Up @@ -13,6 +13,7 @@ module.exports = {
'react/jsx-props-no-spreading': 'off',
'react/jsx-fragments': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-object-literal-type-assertion': 'off',
'react/sort-comp': [
'error',
Expand Down
Expand Up @@ -2,6 +2,7 @@ import { Parser } from 'acorn';
// @ts-ignore
import jsx from 'acorn-jsx';
import { isNil } from 'lodash';
// eslint-disable-next-line import/no-extraneous-dependencies
import estree from 'estree';
// @ts-ignore
import * as acornWalk from 'acorn-walk';
Expand Down
1 change: 0 additions & 1 deletion addons/knobs/src/__types__/knob-test-cases.ts
Expand Up @@ -15,7 +15,6 @@ import {
} from '../index';

// Note: this is a helper to batch test return types and avoid "declared but never read" errors
// eslint-disable-next-line @typescript-eslint/no-empty-function
function expectKnobOfType<T>(..._: T[]) {}

const groupId = 'GROUP-ID1';
Expand Down
2 changes: 1 addition & 1 deletion app/react/package.json
Expand Up @@ -47,7 +47,7 @@
"core-js": "^3.0.1",
"global": "^4.3.2",
"lodash": "^4.17.15",
"mini-css-extract-plugin": "^0.9.0",
"mini-css-extract-plugin": "^0.7.0",
"prop-types": "^15.7.2",
"react-dev-utils": "^9.0.0",
"regenerator-runtime": "^0.13.3",
Expand Down
13 changes: 8 additions & 5 deletions app/react/src/server/cra-config.ts
Expand Up @@ -2,7 +2,7 @@ import fs from 'fs';
import path from 'path';
import semver from 'semver';
import { Configuration, Plugin, RuleSetRule } from 'webpack';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
// import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import { normalizeCondition } from 'webpack/lib/RuleSet';
import { logger } from '@storybook/node-logger';

Expand Down Expand Up @@ -164,12 +164,15 @@ export function applyCRAWebpackConfig(baseConfig: Configuration, configDir: stri
? getTypeScriptRules(craWebpackConfig.module.rules, configDir)
: [];

// I disabled the MiniCssExtractPlugin, because there's often a version mismatch between CRA & storybook
// causing a lot of issues of the build-storybook failing

// Add css minification for production
const plugins = [...baseConfig.plugins];
if (baseConfig.mode === 'production') {
// @ts-ignore
plugins.push(new MiniCssExtractPlugin());
}
// if (baseConfig.mode === 'production') {
// // @ts-ignore
// plugins.push(new MiniCssExtractPlugin());
// }

return {
...baseConfig,
Expand Down
1 change: 0 additions & 1 deletion app/riot/src/client/preview/rendering/stringified.js
@@ -1,4 +1,3 @@
/* eslint-disable import/no-duplicates */
import { mount, unregister, tag2 as tag } from 'riot';
import * as riot from 'riot';
import compiler from 'riot-compiler';
Expand Down
2 changes: 1 addition & 1 deletion app/vue/package.json
Expand Up @@ -43,7 +43,7 @@
"webpack": "^4.33.0"
},
"devDependencies": {
"@types/mini-css-extract-plugin": "^0.8.0",
"@types/mini-css-extract-plugin": "^0.9.0",
"@types/node": "^12.12.11",
"@types/webpack": "^4.41.0",
"babel-preset-vue": "^2.0.2",
Expand Down
Expand Up @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';

@Injectable()
export class DummyService {
// eslint-disable-next-line @typescript-eslint/no-empty-function, no-useless-constructor
// eslint-disable-next-line no-useless-constructor
constructor() {}

getItems() {
Expand Down
2 changes: 1 addition & 1 deletion examples/cra-ts-kitchen-sink/src/stories/Button.tsx
Expand Up @@ -14,7 +14,7 @@ interface ButtonProps {
/**
* default is false
*/
secondary: boolean;
secondary?: boolean;
}

/**
Expand Down
Expand Up @@ -5,7 +5,7 @@ Object {
"__": null,
"__b": 0,
"__c": null,
"__d": null,
"__d": undefined,
"__e": null,
"__k": null,
"constructor": undefined,
Expand All @@ -15,7 +15,7 @@ Object {
"__": null,
"__b": 0,
"__c": null,
"__d": null,
"__d": undefined,
"__e": null,
"__k": null,
"constructor": undefined,
Expand Down
2 changes: 1 addition & 1 deletion lib/components/src/tabs/tabs.tsx
Expand Up @@ -114,7 +114,7 @@ export const panelProps = {

const childrenToList = (children: any, selected: string) =>
Children.toArray(children).map(
({ props: { title, id, color, children: childrenOfChild } }, index) => {
({ props: { title, id, color, children: childrenOfChild } }: React.ReactElement, index) => {
const content = Array.isArray(childrenOfChild) ? childrenOfChild[0] : childrenOfChild;
return {
active: selected ? id === selected : index === 0,
Expand Down
1 change: 0 additions & 1 deletion lib/core-events/src/index.test.ts
@@ -1,4 +1,3 @@
/* eslint-disable import/no-duplicates */
import * as EventsPackageExport from '.';
import EventsDefaultExport, { CHANNEL_CREATED } from './index';

Expand Down