mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 01:13:58 +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 { createSearchParams, useOutlet, useSearchParams } from 'dumi';
|
||||
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 ThemeSwitch from '../common/ThemeSwitch';
|
||||
import type { ThemeName } from '../common/ThemeSwitch';
|
||||
@ -102,7 +102,7 @@ const GlobalLayout: React.FC = () => {
|
||||
);
|
||||
|
||||
return (
|
||||
<StyleProvider cache={styleCache}>
|
||||
<StyleProvider cache={styleCache} linters={[logicalPropertiesLinter]}>
|
||||
<SiteContext.Provider value={siteContextValue}>
|
||||
<ConfigProvider
|
||||
theme={{
|
||||
|
@ -108,7 +108,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@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/react-slick": "~1.0.0",
|
||||
"@babel/runtime": "^7.18.3",
|
||||
|
@ -2,7 +2,7 @@
|
||||
import * as React from 'react';
|
||||
import { renderToString } from 'react-dom/server';
|
||||
import glob from 'glob';
|
||||
import { StyleProvider, createCache } from '@ant-design/cssinjs';
|
||||
import { StyleProvider, createCache, logicalPropertiesLinter } from '@ant-design/cssinjs';
|
||||
import { excludeWarning } from './excludeWarning';
|
||||
import { render } from '../utils';
|
||||
import { TriggerMockContext } from './demoTestContext';
|
||||
@ -72,7 +72,11 @@ function baseText(doInject: boolean, component: string, options: Options = {}) {
|
||||
Demo = typeof Demo === 'function' ? <Demo /> : Demo;
|
||||
|
||||
// Inject cssinjs cache to avoid create <style /> element
|
||||
Demo = <StyleProvider cache={createCache()}>{Demo}</StyleProvider>;
|
||||
Demo = (
|
||||
<StyleProvider cache={createCache()} linters={[logicalPropertiesLinter]}>
|
||||
{Demo}
|
||||
</StyleProvider>
|
||||
);
|
||||
|
||||
render(Demo);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user