mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 09:26:06 +08:00
chore: add cssinjs linter (#40001)
This commit is contained in:
parent
01023ef0ed
commit
7b06b662d1
@ -1,7 +1,7 @@
|
|||||||
import React, { startTransition, useCallback, useEffect, useMemo } from 'react';
|
import React, { startTransition, useCallback, useEffect, useMemo } from 'react';
|
||||||
import { createSearchParams, useOutlet, useSearchParams } from 'dumi';
|
import { createSearchParams, useOutlet, useSearchParams } from 'dumi';
|
||||||
import { ConfigProvider, theme as antdTheme } from 'antd';
|
import { ConfigProvider, theme as antdTheme } from 'antd';
|
||||||
import { createCache, StyleProvider } from '@ant-design/cssinjs';
|
import { createCache, StyleProvider, logicalPropertiesLinter } from '@ant-design/cssinjs';
|
||||||
import type { DirectionType } from 'antd/es/config-provider';
|
import type { DirectionType } from 'antd/es/config-provider';
|
||||||
import ThemeSwitch from '../common/ThemeSwitch';
|
import ThemeSwitch from '../common/ThemeSwitch';
|
||||||
import type { ThemeName } from '../common/ThemeSwitch';
|
import type { ThemeName } from '../common/ThemeSwitch';
|
||||||
@ -102,7 +102,7 @@ const GlobalLayout: React.FC = () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyleProvider cache={styleCache}>
|
<StyleProvider cache={styleCache} linters={[logicalPropertiesLinter]}>
|
||||||
<SiteContext.Provider value={siteContextValue}>
|
<SiteContext.Provider value={siteContextValue}>
|
||||||
<ConfigProvider
|
<ConfigProvider
|
||||||
theme={{
|
theme={{
|
||||||
|
@ -108,7 +108,7 @@
|
|||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ant-design/colors": "^6.0.0",
|
"@ant-design/colors": "^6.0.0",
|
||||||
"@ant-design/cssinjs": "^1.3.0",
|
"@ant-design/cssinjs": "^1.4.0",
|
||||||
"@ant-design/icons": "^4.7.0",
|
"@ant-design/icons": "^4.7.0",
|
||||||
"@ant-design/react-slick": "~1.0.0",
|
"@ant-design/react-slick": "~1.0.0",
|
||||||
"@babel/runtime": "^7.18.3",
|
"@babel/runtime": "^7.18.3",
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { renderToString } from 'react-dom/server';
|
import { renderToString } from 'react-dom/server';
|
||||||
import glob from 'glob';
|
import glob from 'glob';
|
||||||
import { StyleProvider, createCache } from '@ant-design/cssinjs';
|
import { StyleProvider, createCache, logicalPropertiesLinter } from '@ant-design/cssinjs';
|
||||||
import { excludeWarning } from './excludeWarning';
|
import { excludeWarning } from './excludeWarning';
|
||||||
import { render } from '../utils';
|
import { render } from '../utils';
|
||||||
import { TriggerMockContext } from './demoTestContext';
|
import { TriggerMockContext } from './demoTestContext';
|
||||||
@ -72,7 +72,11 @@ function baseText(doInject: boolean, component: string, options: Options = {}) {
|
|||||||
Demo = typeof Demo === 'function' ? <Demo /> : Demo;
|
Demo = typeof Demo === 'function' ? <Demo /> : Demo;
|
||||||
|
|
||||||
// Inject cssinjs cache to avoid create <style /> element
|
// Inject cssinjs cache to avoid create <style /> element
|
||||||
Demo = <StyleProvider cache={createCache()}>{Demo}</StyleProvider>;
|
Demo = (
|
||||||
|
<StyleProvider cache={createCache()} linters={[logicalPropertiesLinter]}>
|
||||||
|
{Demo}
|
||||||
|
</StyleProvider>
|
||||||
|
);
|
||||||
|
|
||||||
render(Demo);
|
render(Demo);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user