Fix Storybook React runtime
This commit is contained in:
@@ -182,5 +182,17 @@ module.exports = {
|
|||||||
"@typescript-eslint/no-var-requires": "off",
|
"@typescript-eslint/no-var-requires": "off",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
files: [".storybook/**/*.tsx"],
|
||||||
|
parserOptions: {
|
||||||
|
project: resolve(__dirname, ".storybook/tsconfig.json"),
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
...baseConfig.rules,
|
||||||
|
// Storybook doesn't use the automatic JSX runtime in the addon yet, so we need to allow
|
||||||
|
// `React` to be imported.
|
||||||
|
"import/no-namespace": ["error", { ignore: ["react"] }],
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"target": "es6",
|
"target": "es6",
|
||||||
"outDir": "out",
|
"outDir": "out",
|
||||||
"lib": ["ES2021", "dom"],
|
"lib": ["ES2021", "dom"],
|
||||||
"jsx": "react-jsx",
|
"jsx": "react",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"rootDir": "..",
|
"rootDir": "..",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import * as React from "react";
|
||||||
import { FunctionComponent, useCallback } from "react";
|
import { FunctionComponent, useCallback } from "react";
|
||||||
|
|
||||||
import { useGlobals } from "@storybook/manager-api";
|
import { useGlobals } from "@storybook/manager-api";
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import * as React from "react";
|
||||||
import { addons, types } from "@storybook/manager-api";
|
import { addons, types } from "@storybook/manager-api";
|
||||||
import { ThemeSelector } from "./ThemeSelector";
|
import { ThemeSelector } from "./ThemeSelector";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user