mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
chore(deps): update dependency eslint to v9 (#50690)
Co-authored-by: afc163 <afc163@gmail.com>
This commit is contained in:
parent
9c4d5496bd
commit
863f61d908
@ -11,15 +11,15 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
modulePattern: [
|
modulePattern: [
|
||||||
{
|
{
|
||||||
pattern: /ConfigContext.*renderEmpty/ms,
|
pattern: /ConfigContext.*renderEmpty/s,
|
||||||
module: '../empty',
|
module: '../empty',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern: /ConfigConsumer.*renderEmpty/ms,
|
pattern: /ConfigConsumer.*renderEmpty/s,
|
||||||
module: '../empty',
|
module: '../empty',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern: /config-provider\/context.*renderEmpty/ms,
|
pattern: /config-provider\/context.*renderEmpty/s,
|
||||||
module: '../empty',
|
module: '../empty',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -89,7 +89,6 @@ const useThemeAnimation = () => {
|
|||||||
.startViewTransition(async () => {
|
.startViewTransition(async () => {
|
||||||
// wait for theme change end
|
// wait for theme change end
|
||||||
while (colorBgElevated === animateRef.current.colorBgElevated) {
|
while (colorBgElevated === animateRef.current.colorBgElevated) {
|
||||||
// eslint-disable-next-line no-await-in-loop
|
|
||||||
await new Promise((resolve) => {
|
await new Promise((resolve) => {
|
||||||
setTimeout(resolve, 1000 / 60);
|
setTimeout(resolve, 1000 / 60);
|
||||||
});
|
});
|
||||||
@ -99,6 +98,7 @@ const useThemeAnimation = () => {
|
|||||||
root.classList.add(isDark ? 'light' : 'dark');
|
root.classList.add(isDark ? 'light' : 'dark');
|
||||||
})
|
})
|
||||||
.ready.then(() => {
|
.ready.then(() => {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.log(`Theme transition finished in ${Date.now() - time}ms`);
|
console.log(`Theme transition finished in ${Date.now() - time}ms`);
|
||||||
const clipPath = [
|
const clipPath = [
|
||||||
`circle(0px at ${x}px ${y}px)`,
|
`circle(0px at ${x}px ${y}px)`,
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
// must be .js file, can't modify to be .ts file!
|
// must be .js file, can't modify to be .ts file!
|
||||||
// eslint-disable-next-line no-restricted-exports
|
|
||||||
export { default } from './theme/common/Loading';
|
export { default } from './theme/common/Loading';
|
||||||
|
@ -112,7 +112,7 @@ export const BannerRecommendsFallback: React.FC = () => {
|
|||||||
const { isMobile } = useContext(SiteContext);
|
const { isMobile } = useContext(SiteContext);
|
||||||
const { styles } = useStyle();
|
const { styles } = useStyle();
|
||||||
|
|
||||||
const list = Array(3).fill(1);
|
const list = new Array(3).fill(1);
|
||||||
|
|
||||||
return isMobile ? (
|
return isMobile ? (
|
||||||
<Carousel className={styles.carousel}>
|
<Carousel className={styles.carousel}>
|
||||||
@ -140,7 +140,7 @@ const BannerRecommends: React.FC = () => {
|
|||||||
const data = useSiteData();
|
const data = useSiteData();
|
||||||
const extras = data?.extras?.[lang];
|
const extras = data?.extras?.[lang];
|
||||||
const icons = data?.icons || [];
|
const icons = data?.icons || [];
|
||||||
const first3 = !extras || extras.length === 0 ? Array(3).fill(null) : extras.slice(0, 3);
|
const first3 = !extras || extras.length === 0 ? new Array(3).fill(null) : extras.slice(0, 3);
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return <BannerRecommendsFallback />;
|
return <BannerRecommendsFallback />;
|
||||||
|
@ -102,7 +102,6 @@ const ThemeColorPicker: React.FC<ThemeColorPickerProps> = ({ value, onChange, id
|
|||||||
<Flex gap="middle">
|
<Flex gap="middle">
|
||||||
{matchColors.map<React.ReactNode>(({ color, active, picker }) => {
|
{matchColors.map<React.ReactNode>(({ color, active, picker }) => {
|
||||||
const colorNode = (
|
const colorNode = (
|
||||||
// eslint-disable-next-line jsx-a11y/label-has-associated-control
|
|
||||||
<label
|
<label
|
||||||
key={color}
|
key={color}
|
||||||
className={classNames(styles.color, { [styles.colorActive]: active })}
|
className={classNames(styles.color, { [styles.colorActive]: active })}
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable jsx-a11y/label-has-associated-control */
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Flex } from 'antd';
|
import { Flex } from 'antd';
|
||||||
import { createStyles } from 'antd-style';
|
import { createStyles } from 'antd-style';
|
||||||
|
@ -46,6 +46,7 @@ const { Header, Content, Sider } = Layout;
|
|||||||
|
|
||||||
const TokenChecker: React.FC = () => {
|
const TokenChecker: React.FC = () => {
|
||||||
if (process.env.NODE_ENV !== 'production') {
|
if (process.env.NODE_ENV !== 'production') {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.log('Demo Token:', theme.useToken());
|
console.log('Demo Token:', theme.useToken());
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -72,7 +72,7 @@ function rehypeAntd(): UnifiedTransformer<HastRoot> {
|
|||||||
|
|
||||||
if (typeof lang === 'string' && lang.startsWith('sandpack')) {
|
if (typeof lang === 'string' && lang.startsWith('sandpack')) {
|
||||||
const code = (node.children[0] as any).value as string;
|
const code = (node.children[0] as any).value as string;
|
||||||
const configRegx = /^const sandpackConfig = ([\S\s]*?});/;
|
const configRegx = /^const sandpackConfig = ([\s\S]*?});/;
|
||||||
const [configString] = code.match(configRegx) || [];
|
const [configString] = code.match(configRegx) || [];
|
||||||
/* biome-ignore lint/security/noGlobalEval: used in documentation */ /* eslint-disable-next-line no-eval */
|
/* biome-ignore lint/security/noGlobalEval: used in documentation */ /* eslint-disable-next-line no-eval */
|
||||||
const config = configString && eval(`(${configString.replace(configRegx, '$1')})`);
|
const config = configString && eval(`(${configString.replace(configRegx, '$1')})`);
|
||||||
|
@ -141,12 +141,12 @@
|
|||||||
|
|
||||||
const title = document.createElement('div');
|
const title = document.createElement('div');
|
||||||
title.className = 'mirror-modal-title';
|
title.className = 'mirror-modal-title';
|
||||||
title.innerText = '提示';
|
title.textContent = '提示';
|
||||||
dialog.append(title);
|
dialog.append(title);
|
||||||
|
|
||||||
const content = document.createElement('div');
|
const content = document.createElement('div');
|
||||||
content.className = 'mirror-modal-content';
|
content.className = 'mirror-modal-content';
|
||||||
content.innerText = '🚀 国内用户推荐访问国内镜像以获得极速体验~';
|
content.textContent = '🚀 国内用户推荐访问国内镜像以获得极速体验~';
|
||||||
dialog.append(content);
|
dialog.append(content);
|
||||||
|
|
||||||
const btnWrapper = document.createElement('div');
|
const btnWrapper = document.createElement('div');
|
||||||
@ -155,7 +155,7 @@
|
|||||||
|
|
||||||
const cancelBtn = document.createElement('a');
|
const cancelBtn = document.createElement('a');
|
||||||
cancelBtn.className = 'mirror-modal-cancel-btn mirror-modal-btn';
|
cancelBtn.className = 'mirror-modal-cancel-btn mirror-modal-btn';
|
||||||
cancelBtn.innerText = '7 天内不再显示';
|
cancelBtn.textContent = '7 天内不再显示';
|
||||||
btnWrapper.append(cancelBtn);
|
btnWrapper.append(cancelBtn);
|
||||||
cancelBtn.addEventListener('click', () => {
|
cancelBtn.addEventListener('click', () => {
|
||||||
window.localStorage.setItem(ANTD_DOT_NOT_SHOW_MIRROR_MODAL, new Date().toISOString());
|
window.localStorage.setItem(ANTD_DOT_NOT_SHOW_MIRROR_MODAL, new Date().toISOString());
|
||||||
@ -167,7 +167,7 @@
|
|||||||
const confirmBtn = document.createElement('a');
|
const confirmBtn = document.createElement('a');
|
||||||
confirmBtn.className = 'mirror-modal-confirm-btn mirror-modal-btn';
|
confirmBtn.className = 'mirror-modal-confirm-btn mirror-modal-btn';
|
||||||
confirmBtn.href = window.location.href.replace(window.location.host, 'ant-design.antgroup.com');
|
confirmBtn.href = window.location.href.replace(window.location.host, 'ant-design.antgroup.com');
|
||||||
confirmBtn.innerText = '🚀 立刻前往';
|
confirmBtn.textContent = '🚀 立刻前往';
|
||||||
btnWrapper.append(confirmBtn);
|
btnWrapper.append(confirmBtn);
|
||||||
|
|
||||||
document.body.append(modal);
|
document.body.append(modal);
|
||||||
|
@ -24,7 +24,6 @@ interface NewToken {
|
|||||||
|
|
||||||
// 通过给 antd-style 扩展 CustomToken 对象类型定义,可以为 useTheme 中增加相应的 token 对象
|
// 通过给 antd-style 扩展 CustomToken 对象类型定义,可以为 useTheme 中增加相应的 token 对象
|
||||||
declare module 'antd-style' {
|
declare module 'antd-style' {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
||||||
export interface CustomToken extends NewToken {}
|
export interface CustomToken extends NewToken {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ const IconSearch: React.FC = () => {
|
|||||||
let iconList = categories[key as CategoriesKeys];
|
let iconList = categories[key as CategoriesKeys];
|
||||||
if (searchKey) {
|
if (searchKey) {
|
||||||
const matchKey = searchKey
|
const matchKey = searchKey
|
||||||
// eslint-disable-next-line prefer-regex-literals
|
|
||||||
.replace(/^<([a-z]*)\s\/>$/gi, (_, name) => name)
|
.replace(/^<([a-z]*)\s\/>$/gi, (_, name) => name)
|
||||||
.replace(/(Filled|Outlined|TwoTone)$/, '')
|
.replace(/(Filled|Outlined|TwoTone)$/, '')
|
||||||
.toLowerCase();
|
.toLowerCase();
|
||||||
|
@ -44,15 +44,13 @@ const IconSearchFallback: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
<Skeleton.Button active style={{ margin: '28px 0 10px', width: 100 }} />
|
<Skeleton.Button active style={{ margin: '28px 0 10px', width: 100 }} />
|
||||||
<div className={styles.fallbackWrapper}>
|
<div className={styles.fallbackWrapper}>
|
||||||
{Array(24)
|
{new Array(24).fill(1).map((_, index) => (
|
||||||
.fill(1)
|
<div key={index} className={styles.skeletonWrapper}>
|
||||||
.map((_, index) => (
|
<Skeleton.Node active style={{ height: 110, width: '100%' }}>
|
||||||
<div key={index} className={styles.skeletonWrapper}>
|
{' '}
|
||||||
<Skeleton.Node active style={{ height: 110, width: '100%' }}>
|
</Skeleton.Node>
|
||||||
{' '}
|
</div>
|
||||||
</Skeleton.Node>
|
))}
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable react/no-array-index-key */
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Avatar, Divider, Empty, Skeleton, Tabs } from 'antd';
|
import { Avatar, Divider, Empty, Skeleton, Tabs } from 'antd';
|
||||||
import { createStyles } from 'antd-style';
|
import { createStyles } from 'antd-style';
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable global-require, import/no-unresolved */
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { BugOutlined, HistoryOutlined } from '@ant-design/icons';
|
import { BugOutlined, HistoryOutlined } from '@ant-design/icons';
|
||||||
import { Button, Drawer, Grid, Popover, Timeline, Typography } from 'antd';
|
import { Button, Drawer, Grid, Popover, Timeline, Typography } from 'antd';
|
||||||
|
@ -1,21 +1,19 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Icon from '@ant-design/icons';
|
import Icon from '@ant-design/icons';
|
||||||
|
|
||||||
const ThemeIcon: React.FC<{ className?: string }> = (props) => {
|
const SVGIcon: React.FC = (props) => (
|
||||||
const SVGIcon = React.useCallback(
|
<svg width={20} height={20} viewBox="0 0 24 24" fill="currentColor" {...props}>
|
||||||
() => (
|
<title>Theme icon</title>
|
||||||
<svg width={20} height={20} viewBox="0 0 24 24" fill="currentColor" {...props}>
|
<g fillRule="evenodd">
|
||||||
<title>Theme icon</title>
|
<g fillRule="nonzero">
|
||||||
<g fillRule="evenodd">
|
<path d="M7.02 3.635l12.518 12.518a1.863 1.863 0 010 2.635l-1.317 1.318a1.863 1.863 0 01-2.635 0L3.068 7.588A2.795 2.795 0 117.02 3.635zm2.09 14.428a.932.932 0 110 1.864.932.932 0 010-1.864zm-.043-9.747L7.75 9.635l9.154 9.153 1.318-1.317-9.154-9.155zM3.52 12.473c.514 0 .931.417.931.931v.932h.932a.932.932 0 110 1.864h-.932v.931a.932.932 0 01-1.863 0l-.001-.931h-.93a.932.932 0 010-1.864h.93v-.932c0-.514.418-.931.933-.931zm15.374-3.727a1.398 1.398 0 110 2.795 1.398 1.398 0 010-2.795zM4.385 4.953a.932.932 0 000 1.317l2.046 2.047L7.75 7 5.703 4.953a.932.932 0 00-1.318 0zM14.701.36a.932.932 0 01.931.932v.931h.932a.932.932 0 010 1.864h-.933l.001.932a.932.932 0 11-1.863 0l-.001-.932h-.93a.932.932 0 110-1.864h.93v-.931a.932.932 0 01.933-.932z" />
|
||||||
<g fillRule="nonzero">
|
</g>
|
||||||
<path d="M7.02 3.635l12.518 12.518a1.863 1.863 0 010 2.635l-1.317 1.318a1.863 1.863 0 01-2.635 0L3.068 7.588A2.795 2.795 0 117.02 3.635zm2.09 14.428a.932.932 0 110 1.864.932.932 0 010-1.864zm-.043-9.747L7.75 9.635l9.154 9.153 1.318-1.317-9.154-9.155zM3.52 12.473c.514 0 .931.417.931.931v.932h.932a.932.932 0 110 1.864h-.932v.931a.932.932 0 01-1.863 0l-.001-.931h-.93a.932.932 0 010-1.864h.93v-.932c0-.514.418-.931.933-.931zm15.374-3.727a1.398 1.398 0 110 2.795 1.398 1.398 0 010-2.795zM4.385 4.953a.932.932 0 000 1.317l2.046 2.047L7.75 7 5.703 4.953a.932.932 0 00-1.318 0zM14.701.36a.932.932 0 01.931.932v.931h.932a.932.932 0 010 1.864h-.933l.001.932a.932.932 0 11-1.863 0l-.001-.932h-.93a.932.932 0 110-1.864h.93v-.931a.932.932 0 01.933-.932z" />
|
</g>
|
||||||
</g>
|
</svg>
|
||||||
</g>
|
);
|
||||||
</svg>
|
|
||||||
),
|
const ThemeIcon: React.FC<{ className?: string }> = (props) => (
|
||||||
[props],
|
<Icon component={SVGIcon} {...props} />
|
||||||
);
|
);
|
||||||
return <Icon component={SVGIcon} {...props} />;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ThemeIcon;
|
export default ThemeIcon;
|
||||||
|
@ -37,7 +37,6 @@ export const getHash = (str: string, length = 8) =>
|
|||||||
* extends dumi internal tech stack, for customize previewer props
|
* extends dumi internal tech stack, for customize previewer props
|
||||||
*/
|
*/
|
||||||
class AntdReactTechStack extends ReactTechStack {
|
class AntdReactTechStack extends ReactTechStack {
|
||||||
// eslint-disable-next-line class-methods-use-this
|
|
||||||
generatePreviewerProps(...[props, opts]: any) {
|
generatePreviewerProps(...[props, opts]: any) {
|
||||||
props.pkgDependencyList = { ...devDependencies, ...dependencies };
|
props.pkgDependencyList = { ...devDependencies, ...dependencies };
|
||||||
props.jsx ??= '';
|
props.jsx ??= '';
|
||||||
|
@ -210,7 +210,6 @@ const Header: React.FC = () => {
|
|||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// eslint-disable-next-line class-methods-use-this
|
|
||||||
const handleVersionChange = useCallback((url: string) => {
|
const handleVersionChange = useCallback((url: string) => {
|
||||||
const currentUrl = window.location.href;
|
const currentUrl = window.location.href;
|
||||||
const currentPathname = window.location.pathname;
|
const currentPathname = window.location.pathname;
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
components/**/*.js
|
|
||||||
components/**/*.jsx
|
|
||||||
components/version/token.tsx
|
|
||||||
!components/*/__tests__/**/*.js
|
|
||||||
!components/*/demo/*.md
|
|
||||||
!.*.js
|
|
||||||
~*
|
|
||||||
typings
|
|
||||||
es/**/*
|
|
||||||
lib/**/*
|
|
||||||
locale
|
|
||||||
server
|
|
||||||
.dumi/tmp
|
|
||||||
.dumi/tmp-production
|
|
||||||
!.dumi/
|
|
||||||
node_modules
|
|
||||||
.eslintcache
|
|
||||||
_site
|
|
||||||
dist
|
|
||||||
coverage
|
|
||||||
**/*.d.ts
|
|
||||||
# Scripts
|
|
||||||
scripts/previewEditor/**/*
|
|
||||||
jest-stare
|
|
231
.eslintrc.js
231
.eslintrc.js
@ -1,231 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
extends: [
|
|
||||||
'airbnb',
|
|
||||||
'prettier',
|
|
||||||
'plugin:compat/recommended',
|
|
||||||
'plugin:jest/recommended',
|
|
||||||
'plugin:react/recommended',
|
|
||||||
'plugin:import/typescript',
|
|
||||||
'plugin:markdown/recommended-legacy',
|
|
||||||
],
|
|
||||||
env: {
|
|
||||||
browser: true,
|
|
||||||
node: true,
|
|
||||||
jasmine: true,
|
|
||||||
jest: true,
|
|
||||||
es6: true,
|
|
||||||
},
|
|
||||||
settings: {
|
|
||||||
react: {
|
|
||||||
version: 'detect',
|
|
||||||
},
|
|
||||||
polyfills: ['Promise', 'URL'],
|
|
||||||
'import/resolver': {
|
|
||||||
typescript: {},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
plugins: [
|
|
||||||
'react',
|
|
||||||
'@babel',
|
|
||||||
'jest',
|
|
||||||
'@typescript-eslint',
|
|
||||||
'react-hooks',
|
|
||||||
'unicorn',
|
|
||||||
'markdown',
|
|
||||||
'lodash',
|
|
||||||
],
|
|
||||||
// https://github.com/typescript-eslint/typescript-eslint/issues/46#issuecomment-470486034
|
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
files: ['*.ts', '*.tsx'],
|
|
||||||
rules: {
|
|
||||||
'@typescript-eslint/no-unused-vars': [2, { args: 'none' }],
|
|
||||||
'no-unused-expressions': 'off',
|
|
||||||
'@typescript-eslint/no-unused-expressions': 2,
|
|
||||||
'@typescript-eslint/consistent-type-imports': [2, { disallowTypeAnnotations: false }],
|
|
||||||
'import/consistent-type-specifier-style': 2,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// In v2, explicitly apply eslint-plugin-markdown's `markdown`
|
|
||||||
// processor on any Markdown files you want to lint.
|
|
||||||
files: ['components/*/demo/*.md'],
|
|
||||||
processor: 'markdown/markdown',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// In v2, configuration for fenced code blocks is separate from the
|
|
||||||
// containing Markdown file. Each code block has a virtual filename
|
|
||||||
// appended to the Markdown file's path.
|
|
||||||
files: [
|
|
||||||
'components/*/demo/*.md/*.ts',
|
|
||||||
'components/*/demo/*.md/*.tsx',
|
|
||||||
'components/*/demo/*.md/*.js',
|
|
||||||
'components/*/demo/*.md/*.jsx',
|
|
||||||
],
|
|
||||||
// Configuration for fenced code blocks goes with the override for
|
|
||||||
// the code block's virtual filename, for example:
|
|
||||||
parserOptions: {
|
|
||||||
ecmaFeatures: {
|
|
||||||
impliedStrict: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
globals: {
|
|
||||||
React: true,
|
|
||||||
ReactDOM: true,
|
|
||||||
mountNode: true,
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
indent: 0,
|
|
||||||
'@babel/new-cap': 0,
|
|
||||||
'@babel/no-invalid-this': 0,
|
|
||||||
'@babel/no-unused-expressions': 2,
|
|
||||||
'@babel/object-curly-spacing': 0,
|
|
||||||
'@babel/semi': 2,
|
|
||||||
'default-case': 0,
|
|
||||||
'eol-last': 0,
|
|
||||||
'no-console': 0,
|
|
||||||
'no-plusplus': 0,
|
|
||||||
'no-script-url': 0,
|
|
||||||
'prefer-rest-params': 0,
|
|
||||||
'compat/compat': 0,
|
|
||||||
'class-methods-use-this': 0,
|
|
||||||
'react/no-access-state-in-setstate': 0,
|
|
||||||
'react/destructuring-assignment': 0,
|
|
||||||
'react/no-multi-comp': 0,
|
|
||||||
'react/no-array-index-key': 0,
|
|
||||||
'jsx-a11y/href-no-hash': 0,
|
|
||||||
'jsx-a11y/control-has-associated-label': 0,
|
|
||||||
'import/no-extraneous-dependencies': 0,
|
|
||||||
'react/jsx-no-constructed-context-values': 0,
|
|
||||||
'react/no-unstable-nested-components': 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
files: ['components/**/demo/*.tsx'],
|
|
||||||
rules: {
|
|
||||||
'import/no-extraneous-dependencies': 0,
|
|
||||||
'no-console': 0,
|
|
||||||
'compat/compat': 0,
|
|
||||||
'react/no-unstable-nested-components': 0,
|
|
||||||
'jsx-a11y/control-has-associated-label': 0,
|
|
||||||
'class-methods-use-this': 0,
|
|
||||||
'react/no-access-state-in-setstate': 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
files: ['.dumi/**/*.ts', '.dumi/**/*.tsx', '.dumi/**/*.js', '.dumi/**/*.jsx'],
|
|
||||||
rules: {
|
|
||||||
'import/no-extraneous-dependencies': 0,
|
|
||||||
'no-console': 0,
|
|
||||||
'compat/compat': 0,
|
|
||||||
'react/no-unstable-nested-components': 0,
|
|
||||||
'jsx-a11y/control-has-associated-label': 0,
|
|
||||||
'class-methods-use-this': 0,
|
|
||||||
'react/no-access-state-in-setstate': 0,
|
|
||||||
'react/no-unknown-property': ['error', { ignore: ['css'] }],
|
|
||||||
'react/no-array-index-key': 0,
|
|
||||||
'react/button-has-type': 0,
|
|
||||||
'react/no-danger': 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
files: ['**/*.json'],
|
|
||||||
rules: {
|
|
||||||
'no-unused-expressions': 0,
|
|
||||||
'comma-dangle': 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
files: ['**/*.test.ts', '**/*.test.tsx', '**/*.spec.ts', '**/*.spec.tsx'],
|
|
||||||
rules: {
|
|
||||||
'compat/compat': 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
rules: {
|
|
||||||
'react/jsx-one-expression-per-line': 0,
|
|
||||||
'react/prop-types': 0,
|
|
||||||
'react/forbid-prop-types': 0,
|
|
||||||
'react/jsx-indent': 0,
|
|
||||||
'react/jsx-wrap-multilines': ['error', { declaration: false, assignment: false }],
|
|
||||||
'react/jsx-filename-extension': 0,
|
|
||||||
'react/state-in-constructor': 0,
|
|
||||||
'react/jsx-props-no-spreading': 0,
|
|
||||||
'react/destructuring-assignment': 0, // TODO: remove later
|
|
||||||
'react/require-default-props': 0,
|
|
||||||
'react/sort-comp': 0,
|
|
||||||
'react/display-name': 0,
|
|
||||||
'react/static-property-placement': 0,
|
|
||||||
'react/jsx-no-bind': 0, // Should not check test file
|
|
||||||
'react/no-find-dom-node': 0,
|
|
||||||
'react/no-unused-prop-types': 0,
|
|
||||||
'react/default-props-match-prop-types': 0,
|
|
||||||
'react-hooks/rules-of-hooks': 2, // Checks rules of Hooks
|
|
||||||
'react/function-component-definition': 0,
|
|
||||||
'react/no-unused-class-component-methods': 0,
|
|
||||||
'import/extensions': 0,
|
|
||||||
'import/no-cycle': 2,
|
|
||||||
'lodash/import-scope': 2,
|
|
||||||
'import/no-extraneous-dependencies': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
devDependencies: [
|
|
||||||
'site/**',
|
|
||||||
'tests/**',
|
|
||||||
'scripts/**',
|
|
||||||
'scripts/*.ts',
|
|
||||||
'**/*.test.js',
|
|
||||||
'**/__tests__/*',
|
|
||||||
'*.config.js',
|
|
||||||
'**/*.md',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
'jsx-a11y/no-static-element-interactions': 0,
|
|
||||||
'jsx-a11y/anchor-has-content': 0,
|
|
||||||
'jsx-a11y/click-events-have-key-events': 0,
|
|
||||||
'jsx-a11y/anchor-is-valid': 0,
|
|
||||||
'jsx-a11y/no-noninteractive-element-interactions': 0,
|
|
||||||
// label-has-for has been deprecated
|
|
||||||
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/label-has-for.md
|
|
||||||
'jsx-a11y/label-has-for': 0,
|
|
||||||
|
|
||||||
'comma-dangle': ['error', 'always-multiline'],
|
|
||||||
'consistent-return': 0, // TODO: remove later
|
|
||||||
'no-param-reassign': 0, // TODO: remove later
|
|
||||||
'no-underscore-dangle': 0,
|
|
||||||
// for (let i = 0; i < len; i++)
|
|
||||||
'no-plusplus': 0,
|
|
||||||
// https://eslint.org/docs/rules/no-continue
|
|
||||||
// labeledLoop is conflicted with `eslint . --fix`
|
|
||||||
'no-continue': 0,
|
|
||||||
// ban this for Number.isNaN needs polyfill
|
|
||||||
'no-restricted-globals': 0,
|
|
||||||
'max-classes-per-file': 0,
|
|
||||||
|
|
||||||
'jest/no-test-callback': 0,
|
|
||||||
'jest/expect-expect': 0,
|
|
||||||
'jest/no-done-callback': 0,
|
|
||||||
'jest/valid-title': 0,
|
|
||||||
'jest/no-conditional-expect': 0,
|
|
||||||
'jest/no-standalone-expect': 0,
|
|
||||||
|
|
||||||
'unicorn/better-regex': 2,
|
|
||||||
'unicorn/prefer-string-trim-start-end': 2,
|
|
||||||
'unicorn/expiring-todo-comments': 2,
|
|
||||||
'unicorn/no-abusive-eslint-disable': 0,
|
|
||||||
|
|
||||||
// https://github.com/typescript-eslint/typescript-eslint/issues/2540#issuecomment-692866111
|
|
||||||
'no-use-before-define': 0,
|
|
||||||
'@typescript-eslint/no-use-before-define': 2,
|
|
||||||
'no-shadow': 0,
|
|
||||||
'@typescript-eslint/no-shadow': [2, { ignoreTypeValueShadow: true }],
|
|
||||||
// https://github.com/typescript-eslint/typescript-eslint/issues/2528#issuecomment-689369395
|
|
||||||
'no-undef': 0,
|
|
||||||
'import/order': 0,
|
|
||||||
},
|
|
||||||
globals: {
|
|
||||||
gtag: true,
|
|
||||||
},
|
|
||||||
};
|
|
34
.github/dependabot.yml
vendored
34
.github/dependabot.yml
vendored
@ -5,35 +5,35 @@
|
|||||||
|
|
||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: "npm"
|
- package-ecosystem: npm
|
||||||
directory: "/"
|
directory: /
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: daily
|
||||||
groups:
|
groups:
|
||||||
rc-component-patch:
|
rc-component-patch:
|
||||||
dependency-type: "production"
|
dependency-type: production
|
||||||
patterns:
|
patterns:
|
||||||
- "rc-*"
|
- "rc-*"
|
||||||
- "@rc-component*"
|
- "@rc-component*"
|
||||||
update-types: ["patch"]
|
update-types: [patch]
|
||||||
dependencies:
|
dependencies:
|
||||||
dependency-type: "production"
|
dependency-type: production
|
||||||
exclude-patterns:
|
exclude-patterns:
|
||||||
- "rc-*"
|
- "rc-*"
|
||||||
- "@rc-component*"
|
- "@rc-component*"
|
||||||
update-types: ["major", "minor"]
|
update-types: [major, minor]
|
||||||
dev-dependencies:
|
dev-dependencies:
|
||||||
dependency-type: "development"
|
dependency-type: development
|
||||||
update-types: ["major"]
|
update-types: [major]
|
||||||
ignore:
|
ignore:
|
||||||
- dependency-name: "@ant-design/cssinjs"
|
- dependency-name: "@ant-design/cssinjs"
|
||||||
- dependency-name: "dayjs"
|
- dependency-name: dayjs
|
||||||
versions: ["1.x"]
|
versions: [1.x]
|
||||||
- package-ecosystem: "github-actions"
|
- package-ecosystem: github-actions
|
||||||
directory: "/"
|
directory: /
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: daily
|
||||||
labels:
|
labels:
|
||||||
- "github-actions"
|
- github-actions
|
||||||
- "dependencies"
|
- dependencies
|
||||||
- "skip-verify-files"
|
- skip-verify-files
|
||||||
|
4
.github/workflows/issue-check-inactive.yml
vendored
4
.github/workflows/issue-check-inactive.yml
vendored
@ -17,6 +17,6 @@ jobs:
|
|||||||
- name: check-inactive
|
- name: check-inactive
|
||||||
uses: actions-cool/issues-helper@v3
|
uses: actions-cool/issues-helper@v3
|
||||||
with:
|
with:
|
||||||
actions: 'check-inactive'
|
actions: check-inactive
|
||||||
inactive-label: 'Inactive'
|
inactive-label: Inactive
|
||||||
inactive-day: 30
|
inactive-day: 30
|
||||||
|
8
.github/workflows/issue-close-require.yml
vendored
8
.github/workflows/issue-close-require.yml
vendored
@ -17,15 +17,15 @@ jobs:
|
|||||||
- name: need reproduce
|
- name: need reproduce
|
||||||
uses: actions-cool/issues-helper@v3
|
uses: actions-cool/issues-helper@v3
|
||||||
with:
|
with:
|
||||||
actions: 'close-issues'
|
actions: close-issues
|
||||||
labels: '🤔 Need Reproduce'
|
labels: 🤔 Need Reproduce
|
||||||
inactive-day: 3
|
inactive-day: 3
|
||||||
|
|
||||||
- name: needs more info
|
- name: needs more info
|
||||||
uses: actions-cool/issues-helper@v3
|
uses: actions-cool/issues-helper@v3
|
||||||
with:
|
with:
|
||||||
actions: 'close-issues'
|
actions: close-issues
|
||||||
labels: 'needs-more-info'
|
labels: needs-more-info
|
||||||
inactive-day: 3
|
inactive-day: 3
|
||||||
body: |
|
body: |
|
||||||
Since the issue was labeled with `needs-more-info`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.
|
Since the issue was labeled with `needs-more-info`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.
|
||||||
|
8
.github/workflows/issue-labeled.yml
vendored
8
.github/workflows/issue-labeled.yml
vendored
@ -20,7 +20,7 @@ jobs:
|
|||||||
if: github.event.label.name == 'help wanted'
|
if: github.event.label.name == 'help wanted'
|
||||||
uses: actions-cool/issues-helper@v3
|
uses: actions-cool/issues-helper@v3
|
||||||
with:
|
with:
|
||||||
actions: 'create-comment'
|
actions: create-comment
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
issue-number: ${{ github.event.issue.number }}
|
issue-number: ${{ github.event.issue.number }}
|
||||||
body: |
|
body: |
|
||||||
@ -34,7 +34,7 @@ jobs:
|
|||||||
if: github.event.label.name == '🤔 Need Reproduce'
|
if: github.event.label.name == '🤔 Need Reproduce'
|
||||||
uses: actions-cool/issues-helper@v3
|
uses: actions-cool/issues-helper@v3
|
||||||
with:
|
with:
|
||||||
actions: 'create-comment'
|
actions: create-comment
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
issue-number: ${{ github.event.issue.number }}
|
issue-number: ${{ github.event.issue.number }}
|
||||||
body: |
|
body: |
|
||||||
@ -86,6 +86,6 @@ jobs:
|
|||||||
if: github.event.label.name != 'unconfirmed'
|
if: github.event.label.name != 'unconfirmed'
|
||||||
uses: actions-cool/issues-helper@v3
|
uses: actions-cool/issues-helper@v3
|
||||||
with:
|
with:
|
||||||
actions: 'remove-labels'
|
actions: remove-labels
|
||||||
issue-number: ${{ github.event.issue.number }}
|
issue-number: ${{ github.event.issue.number }}
|
||||||
labels: 'unconfirmed'
|
labels: unconfirmed
|
||||||
|
12
.github/workflows/issue-open-check.yml
vendored
12
.github/workflows/issue-open-check.yml
vendored
@ -18,15 +18,15 @@ jobs:
|
|||||||
- uses: actions-cool/check-user-permission@v2
|
- uses: actions-cool/check-user-permission@v2
|
||||||
id: checkUser
|
id: checkUser
|
||||||
with:
|
with:
|
||||||
require: 'write'
|
require: write
|
||||||
check-bot: true
|
check-bot: true
|
||||||
|
|
||||||
- name: add unconfirmed label
|
- name: add unconfirmed label
|
||||||
uses: actions-cool/issues-helper@v3
|
uses: actions-cool/issues-helper@v3
|
||||||
with:
|
with:
|
||||||
actions: 'add-labels'
|
actions: add-labels
|
||||||
issue-number: ${{ github.event.issue.number }}
|
issue-number: ${{ github.event.issue.number }}
|
||||||
labels: 'unconfirmed'
|
labels: unconfirmed
|
||||||
|
|
||||||
- name: check invalid
|
- name: check invalid
|
||||||
if: (contains(github.event.issue.body, 'ant-design-issue-helper') == false) && (steps.checkUser.outputs.require-result == 'false')
|
if: (contains(github.event.issue.body, 'ant-design-issue-helper') == false) && (steps.checkUser.outputs.require-result == 'false')
|
||||||
@ -34,7 +34,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
actions: 'create-comment,add-labels,close-issue'
|
actions: 'create-comment,add-labels,close-issue'
|
||||||
issue-number: ${{ github.event.issue.number }}
|
issue-number: ${{ github.event.issue.number }}
|
||||||
labels: 'Invalid'
|
labels: Invalid
|
||||||
body: |
|
body: |
|
||||||
Hello @${{ github.event.issue.user.login }}, your issue has been closed because it does not conform to our issue requirements. Please use the [Issue Helper](http://new-issue.ant.design) to create an issue, thank you!
|
Hello @${{ github.event.issue.user.login }}, your issue has been closed because it does not conform to our issue requirements. Please use the [Issue Helper](http://new-issue.ant.design) to create an issue, thank you!
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ jobs:
|
|||||||
uses: actions-cool/issues-helper@v3
|
uses: actions-cool/issues-helper@v3
|
||||||
id: checkid
|
id: checkid
|
||||||
with:
|
with:
|
||||||
actions: 'check-issue'
|
actions: check-issue
|
||||||
issue-number: ${{ github.event.issue.number }}
|
issue-number: ${{ github.event.issue.number }}
|
||||||
# 格式如:'x1,x2' or 'x1,x2/y1,y2' 最多支持 2 个数组
|
# 格式如:'x1,x2' or 'x1,x2/y1,y2' 最多支持 2 个数组
|
||||||
title-includes: '官网,网站,国内,镜像,mobile ant design,mobile.ant.design,ant design,ant design pro,pro.ant.design/挂了,挂掉了,无法访问,不能访问,访问速度,访问慢,访问不了,加载太慢,加载慢,加载很慢,出问题,打不开,登不上,can not open,cannot open,can not be reached'
|
title-includes: '官网,网站,国内,镜像,mobile ant design,mobile.ant.design,ant design,ant design pro,pro.ant.design/挂了,挂掉了,无法访问,不能访问,访问速度,访问慢,访问不了,加载太慢,加载慢,加载很慢,出问题,打不开,登不上,can not open,cannot open,can not be reached'
|
||||||
@ -80,7 +80,7 @@ jobs:
|
|||||||
if: contains(github.event.issue.body, 'ant-design-issue-helper') == true && contains(github.event.issue.title, 'IE9') == true || contains(github.event.issue.title, 'IE 9') == true || contains(github.event.issue.title, 'IE10') == true || contains(github.event.issue.title, 'IE 10') == true || contains(github.event.issue.title, 'IE11') == true || contains(github.event.issue.title, 'IE 11') == true || contains(github.event.issue.title, 'Internet Explorer') == true || contains(github.event.issue.body, 'IE9') == true || contains(github.event.issue.body, 'IE 9') == true || contains(github.event.issue.body, 'IE10') == true || contains(github.event.issue.body, 'IE 10') == true || contains(github.event.issue.body, 'IE11') == true || contains(github.event.issue.body, 'IE 11') == true || contains(github.event.issue.body, 'Internet Explorer') == true
|
if: contains(github.event.issue.body, 'ant-design-issue-helper') == true && contains(github.event.issue.title, 'IE9') == true || contains(github.event.issue.title, 'IE 9') == true || contains(github.event.issue.title, 'IE10') == true || contains(github.event.issue.title, 'IE 10') == true || contains(github.event.issue.title, 'IE11') == true || contains(github.event.issue.title, 'IE 11') == true || contains(github.event.issue.title, 'Internet Explorer') == true || contains(github.event.issue.body, 'IE9') == true || contains(github.event.issue.body, 'IE 9') == true || contains(github.event.issue.body, 'IE10') == true || contains(github.event.issue.body, 'IE 10') == true || contains(github.event.issue.body, 'IE11') == true || contains(github.event.issue.body, 'IE 11') == true || contains(github.event.issue.body, 'Internet Explorer') == true
|
||||||
uses: actions-cool/issues-helper@v3
|
uses: actions-cool/issues-helper@v3
|
||||||
with:
|
with:
|
||||||
actions: 'add-labels'
|
actions: add-labels
|
||||||
issue-number: ${{ github.event.issue.number }}
|
issue-number: ${{ github.event.issue.number }}
|
||||||
labels: 'IE | Firefox | Safari,Internet Explorer'
|
labels: 'IE | Firefox | Safari,Internet Explorer'
|
||||||
|
|
||||||
|
2
.github/workflows/issue-remove-inactive.yml
vendored
2
.github/workflows/issue-remove-inactive.yml
vendored
@ -20,6 +20,6 @@ jobs:
|
|||||||
if: github.event.issue.state == 'open' && github.actor == github.event.issue.user.login
|
if: github.event.issue.state == 'open' && github.actor == github.event.issue.user.login
|
||||||
uses: actions-cool/issues-helper@v3
|
uses: actions-cool/issues-helper@v3
|
||||||
with:
|
with:
|
||||||
actions: 'remove-labels'
|
actions: remove-labels
|
||||||
issue-number: ${{ github.event.issue.number }}
|
issue-number: ${{ github.event.issue.number }}
|
||||||
labels: 'Inactive, needs-more-info'
|
labels: 'Inactive, needs-more-info'
|
||||||
|
2
.github/workflows/issue-schedule.yml
vendored
2
.github/workflows/issue-schedule.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
|||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
env:
|
env:
|
||||||
DINGDING_BOT_TOKEN: ${{ secrets.DINGDING_BOT_COLLABORATOR_TOKEN }}
|
DINGDING_BOT_TOKEN: ${{ secrets.DINGDING_BOT_COLLABORATOR_TOKEN }}
|
||||||
actionTitle: '近 7 天未确认的 issue'
|
actionTitle: 近 7 天未确认的 issue
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const dingdingTokenKey = process.env.DINGDING_BOT_TOKEN;
|
const dingdingTokenKey = process.env.DINGDING_BOT_TOKEN;
|
||||||
|
4
.github/workflows/mock-project-build.yml
vendored
4
.github/workflows/mock-project-build.yml
vendored
@ -57,10 +57,10 @@ jobs:
|
|||||||
- uses: actions-cool/ci-notice@v1
|
- uses: actions-cool/ci-notice@v1
|
||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
with:
|
with:
|
||||||
notice-types: 'dingding'
|
notice-types: dingding
|
||||||
# Exit directly with non-zero to trigger the failure logic of ci-notice.
|
# Exit directly with non-zero to trigger the failure logic of ci-notice.
|
||||||
ci: |
|
ci: |
|
||||||
echo "❌ CI Mock Project Build Failed"
|
echo "❌ CI Mock Project Build Failed"
|
||||||
exit 1
|
exit 1
|
||||||
dingding-token: ${{ secrets.DINGDING_BOT_COLLABORATOR_TOKEN }}
|
dingding-token: ${{ secrets.DINGDING_BOT_COLLABORATOR_TOKEN }}
|
||||||
notice-title: 'CI Mock Project Build Failed'
|
notice-title: CI Mock Project Build Failed
|
||||||
|
8
.github/workflows/pr-check-ci.yml
vendored
8
.github/workflows/pr-check-ci.yml
vendored
@ -20,13 +20,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions-cool/check-pr-ci@v1
|
- uses: actions-cool/check-pr-ci@v1
|
||||||
with:
|
with:
|
||||||
filter-label: 'BranchAutoMerge'
|
filter-label: BranchAutoMerge
|
||||||
filter-creator-authority: 'write'
|
filter-creator-authority: write
|
||||||
filter-head-ref: 'master, feature, next, master-merge-feature, feature-merge-master, next-merge-master, next-merge-feature'
|
filter-head-ref: 'master, feature, next, master-merge-feature, feature-merge-master, next-merge-master, next-merge-feature'
|
||||||
filter-support-fork: false
|
filter-support-fork: false
|
||||||
skip-run-names: 'deploy preview, pr-check-ci, upstream workflow summary, suggest-related-links, download visual-regression report'
|
skip-run-names: 'deploy preview, pr-check-ci, upstream workflow summary, suggest-related-links, download visual-regression report'
|
||||||
conflict-review-body: '😅 This branch has conflicts that must be resolved!'
|
conflict-review-body: 😅 This branch has conflicts that must be resolved!
|
||||||
success-review: true
|
success-review: true
|
||||||
success-merge: true
|
success-merge: true
|
||||||
merge-method: 'merge'
|
merge-method: merge
|
||||||
merge-title: 'chore: auto merge branches (#${number})'
|
merge-title: 'chore: auto merge branches (#${number})'
|
||||||
|
2
.github/workflows/pr-check-merge.yml
vendored
2
.github/workflows/pr-check-merge.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions-cool/issues-helper@v3
|
- uses: actions-cool/issues-helper@v3
|
||||||
with:
|
with:
|
||||||
actions: 'create-comment'
|
actions: create-comment
|
||||||
issue-number: ${{ github.event.number }}
|
issue-number: ${{ github.event.number }}
|
||||||
body: |
|
body: |
|
||||||
Hi @${{ github.event.pull_request.user.login }}。
|
Hi @${{ github.event.pull_request.user.login }}。
|
||||||
|
2
.github/workflows/pr-contributor-welcome.yml
vendored
2
.github/workflows/pr-contributor-welcome.yml
vendored
@ -39,4 +39,4 @@ jobs:
|
|||||||
<img src="https://github.com/user-attachments/assets/cfee105e-8731-481f-a336-92b79a84d35a" height="200" />
|
<img src="https://github.com/user-attachments/assets/cfee105e-8731-481f-a336-92b79a84d35a" height="200" />
|
||||||
|
|
||||||
<!-- WELCOME_CONTRIBUTION -->
|
<!-- WELCOME_CONTRIBUTION -->
|
||||||
body-include: '<!-- WELCOME_CONTRIBUTION -->'
|
body-include: <!-- WELCOME_CONTRIBUTION -->
|
||||||
|
4
.github/workflows/pr-open-check.yml
vendored
4
.github/workflows/pr-open-check.yml
vendored
@ -16,8 +16,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions-cool/pr-welcome@v1
|
- uses: actions-cool/pr-welcome@v1
|
||||||
with:
|
with:
|
||||||
refuse-issue-label: '🎱 Collaborate PR only'
|
refuse-issue-label: 🎱 Collaborate PR only
|
||||||
need-creator-authority: 'write'
|
need-creator-authority: write
|
||||||
comment: |
|
comment: |
|
||||||
Hi @${{ github.event.pull_request.user.login }}. The issue mentioned in this PR needs to be confirmed with the designer or core team. Thank you for your contribution! 😊
|
Hi @${{ github.event.pull_request.user.login }}. The issue mentioned in this PR needs to be confirmed with the designer or core team. Thank you for your contribution! 😊
|
||||||
|
|
||||||
|
2
.github/workflows/preview-build.yml
vendored
2
.github/workflows/preview-build.yml
vendored
@ -26,7 +26,7 @@ jobs:
|
|||||||
id: site
|
id: site
|
||||||
run: bun run site
|
run: bun run site
|
||||||
env:
|
env:
|
||||||
NODE_OPTIONS: "--max_old_space_size=4096"
|
NODE_OPTIONS: --max_old_space_size=4096
|
||||||
- name: run e2e test
|
- name: run e2e test
|
||||||
run: bun run test:site
|
run: bun run test:site
|
||||||
- name: upload site artifact
|
- name: upload site artifact
|
||||||
|
6
.github/workflows/preview-deploy.yml
vendored
6
.github/workflows/preview-deploy.yml
vendored
@ -4,7 +4,7 @@ name: Preview Deploy
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows: ["Preview Build"]
|
workflows: [Preview Build]
|
||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ jobs:
|
|||||||
body: |
|
body: |
|
||||||
[<img width="300" alt="Preview is ready" src="https://user-images.githubusercontent.com/5378891/72400743-23dbb200-3785-11ea-9d13-1a2d92743846.png">](https://preview-${{ steps.pr.outputs.id }}-ant-design.surge.sh)
|
[<img width="300" alt="Preview is ready" src="https://user-images.githubusercontent.com/5378891/72400743-23dbb200-3785-11ea-9d13-1a2d92743846.png">](https://preview-${{ steps.pr.outputs.id }}-ant-design.surge.sh)
|
||||||
<!-- AUTO_PREVIEW_HOOK -->
|
<!-- AUTO_PREVIEW_HOOK -->
|
||||||
body-include: '<!-- AUTO_PREVIEW_HOOK -->'
|
body-include: <!-- AUTO_PREVIEW_HOOK -->
|
||||||
number: ${{ steps.pr.outputs.id }}
|
number: ${{ steps.pr.outputs.id }}
|
||||||
|
|
||||||
- name: failed comment
|
- name: failed comment
|
||||||
@ -115,7 +115,7 @@ jobs:
|
|||||||
body: |
|
body: |
|
||||||
[<img width="300" alt="Preview failed" src="https://user-images.githubusercontent.com/5378891/75333447-1e63a280-58c1-11ea-975d-235367fd1522.png">](https://preview-${{ steps.pr.outputs.id }}-ant-design.surge.sh)
|
[<img width="300" alt="Preview failed" src="https://user-images.githubusercontent.com/5378891/75333447-1e63a280-58c1-11ea-975d-235367fd1522.png">](https://preview-${{ steps.pr.outputs.id }}-ant-design.surge.sh)
|
||||||
<!-- AUTO_PREVIEW_HOOK -->
|
<!-- AUTO_PREVIEW_HOOK -->
|
||||||
body-include: '<!-- AUTO_PREVIEW_HOOK -->'
|
body-include: <!-- AUTO_PREVIEW_HOOK -->
|
||||||
number: ${{ steps.pr.outputs.id }}
|
number: ${{ steps.pr.outputs.id }}
|
||||||
|
|
||||||
- name: Check surge deploy result and exit if failed
|
- name: Check surge deploy result and exit if failed
|
||||||
|
2
.github/workflows/preview-start.yml
vendored
2
.github/workflows/preview-start.yml
vendored
@ -28,4 +28,4 @@ jobs:
|
|||||||
body: |
|
body: |
|
||||||
[<img width="500" alt="Prepare preview" src="https://user-images.githubusercontent.com/5378891/72351368-2c979e00-371b-11ea-9652-eb4e825d745e.gif">](https://preview-${{ github.event.number }}-ant-design.surge.sh)
|
[<img width="500" alt="Prepare preview" src="https://user-images.githubusercontent.com/5378891/72351368-2c979e00-371b-11ea-9652-eb4e825d745e.gif">](https://preview-${{ github.event.number }}-ant-design.surge.sh)
|
||||||
<!-- AUTO_PREVIEW_HOOK -->
|
<!-- AUTO_PREVIEW_HOOK -->
|
||||||
body-include: '<!-- AUTO_PREVIEW_HOOK -->'
|
body-include: <!-- AUTO_PREVIEW_HOOK -->
|
||||||
|
10
.github/workflows/release-dingtalk.yml
vendored
10
.github/workflows/release-dingtalk.yml
vendored
@ -23,13 +23,13 @@ jobs:
|
|||||||
- name: Send to Ant Design DingGroup
|
- name: Send to Ant Design DingGroup
|
||||||
uses: actions-cool/release-helper@v2
|
uses: actions-cool/release-helper@v2
|
||||||
with:
|
with:
|
||||||
trigger: 'tag'
|
trigger: tag
|
||||||
changelogs: 'CHANGELOG.en-US.md, CHANGELOG.zh-CN.md'
|
changelogs: 'CHANGELOG.en-US.md, CHANGELOG.zh-CN.md'
|
||||||
branch: 'master, 4.x-stable'
|
branch: 'master, 4.x-stable'
|
||||||
tag: '5*, 4*'
|
tag: '5*, 4*'
|
||||||
latest: '5*'
|
latest: '5*'
|
||||||
dingding-token: ${{ secrets.DINGDING_BOT_TOKEN }} ${{ secrets.DINGDING_BOT_COLLABORATOR_TOKEN }} ${{ secrets.DINGDING_BOT_MAINTAINER_TOKEN }}
|
dingding-token: ${{ secrets.DINGDING_BOT_TOKEN }} ${{ secrets.DINGDING_BOT_COLLABORATOR_TOKEN }} ${{ secrets.DINGDING_BOT_MAINTAINER_TOKEN }}
|
||||||
dingding-msg: 'CHANGELOG.zh-CN.md'
|
dingding-msg: CHANGELOG.zh-CN.md
|
||||||
msg-title: '# Ant Design {{v}} 发布日志'
|
msg-title: '# Ant Design {{v}} 发布日志'
|
||||||
msg-poster: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*zx7LTI_ECSAAAAAAAAAAAABkARQnAQ'
|
msg-poster: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*zx7LTI_ECSAAAAAAAAAAAABkARQnAQ'
|
||||||
msg-footer: '💬 前往 [**Ant Design Releases**]({{url}}) 查看更新日志'
|
msg-footer: '💬 前往 [**Ant Design Releases**]({{url}}) 查看更新日志'
|
||||||
@ -39,17 +39,17 @@ jobs:
|
|||||||
- name: Send to Bigfish DingGroup
|
- name: Send to Bigfish DingGroup
|
||||||
uses: actions-cool/release-helper@v2
|
uses: actions-cool/release-helper@v2
|
||||||
with:
|
with:
|
||||||
trigger: 'tag'
|
trigger: tag
|
||||||
changelogs: 'CHANGELOG.en-US.md, CHANGELOG.zh-CN.md'
|
changelogs: 'CHANGELOG.en-US.md, CHANGELOG.zh-CN.md'
|
||||||
branch: 'master, 4.x-stable'
|
branch: 'master, 4.x-stable'
|
||||||
tag: '5*, 4*'
|
tag: '5*, 4*'
|
||||||
latest: '5*'
|
latest: '5*'
|
||||||
dingding-token: ${{ secrets.DINGDING_BOT_BIGFISH_TOKEN }} ${{ secrets.DINGDING_BOT_BIGFISH_2_TOKEN }} ${{ secrets.DINGDING_BOT_YUNFENGDIE_TOKEN }}
|
dingding-token: ${{ secrets.DINGDING_BOT_BIGFISH_TOKEN }} ${{ secrets.DINGDING_BOT_BIGFISH_2_TOKEN }} ${{ secrets.DINGDING_BOT_YUNFENGDIE_TOKEN }}
|
||||||
dingding-msg: 'CHANGELOG.zh-CN.md'
|
dingding-msg: CHANGELOG.zh-CN.md
|
||||||
dingding-delay-minute: 10
|
dingding-delay-minute: 10
|
||||||
release: false
|
release: false
|
||||||
conch-tag: 'conch-v5, conch'
|
conch-tag: 'conch-v5, conch'
|
||||||
antd-conch-msg: '🐟 当前 Bigfish 内嵌 antd 版本:'
|
antd-conch-msg: 🐟 当前 Bigfish 内嵌 antd 版本:
|
||||||
msg-title: '# Ant Design {{v}} 发布日志'
|
msg-title: '# Ant Design {{v}} 发布日志'
|
||||||
msg-poster: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*zx7LTI_ECSAAAAAAAAAAAABkARQnAQ'
|
msg-poster: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*zx7LTI_ECSAAAAAAAAAAAABkARQnAQ'
|
||||||
msg-footer: '💬 前往 [**Ant Design Releases**]({{url}}) 查看更新日志'
|
msg-footer: '💬 前往 [**Ant Design Releases**]({{url}}) 查看更新日志'
|
||||||
|
4
.github/workflows/site-deploy.yml
vendored
4
.github/workflows/site-deploy.yml
vendored
@ -25,13 +25,13 @@ jobs:
|
|||||||
- name: build site
|
- name: build site
|
||||||
run: bun run predeploy
|
run: bun run predeploy
|
||||||
env:
|
env:
|
||||||
NODE_OPTIONS: "--max_old_space_size=4096"
|
NODE_OPTIONS: --max_old_space_size=4096
|
||||||
|
|
||||||
- name: build dist and bundle analyzer report
|
- name: build dist and bundle analyzer report
|
||||||
run: bun run dist
|
run: bun run dist
|
||||||
env:
|
env:
|
||||||
ANALYZER: 1
|
ANALYZER: 1
|
||||||
NODE_OPTIONS: "--max_old_space_size=4096"
|
NODE_OPTIONS: --max_old_space_size=4096
|
||||||
|
|
||||||
- name: Get version
|
- name: Get version
|
||||||
id: publish-version
|
id: publish-version
|
||||||
|
2
.github/workflows/size-limit.yml
vendored
2
.github/workflows/size-limit.yml
vendored
@ -25,6 +25,6 @@ jobs:
|
|||||||
package_manager: bun
|
package_manager: bun
|
||||||
build_script: dist
|
build_script: dist
|
||||||
env:
|
env:
|
||||||
NODE_OPTIONS: "--max_old_space_size=4096"
|
NODE_OPTIONS: --max_old_space_size=4096
|
||||||
PRODUCTION_ONLY: 1
|
PRODUCTION_ONLY: 1
|
||||||
CI_JOB_NUMBER: 1
|
CI_JOB_NUMBER: 1
|
||||||
|
14
.github/workflows/test.yml
vendored
14
.github/workflows/test.yml
vendored
@ -27,7 +27,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
react: ['16', '17']
|
react: ['16', '17']
|
||||||
shard: ['1/2', '2/2']
|
shard: [1/2, 2/2]
|
||||||
env:
|
env:
|
||||||
REACT: ${{ matrix.react }}
|
REACT: ${{ matrix.react }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -58,8 +58,8 @@ jobs:
|
|||||||
name: test-react-latest
|
name: test-react-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
module: ['dom']
|
module: [dom]
|
||||||
shard: ['1/2', '2/2']
|
shard: [1/2, 2/2]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@ -85,8 +85,8 @@ jobs:
|
|||||||
name: test-react-latest-dist
|
name: test-react-latest-dist
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
module: ['dist', 'dist-min']
|
module: [dist, dist-min]
|
||||||
shard: ['1/2', '2/2']
|
shard: [1/2, 2/2]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
@ -170,7 +170,7 @@ jobs:
|
|||||||
- name: dist
|
- name: dist
|
||||||
run: bun run dist
|
run: bun run dist
|
||||||
env:
|
env:
|
||||||
NODE_OPTIONS: "--max_old_space_size=4096"
|
NODE_OPTIONS: --max_old_space_size=4096
|
||||||
CI: 1
|
CI: 1
|
||||||
|
|
||||||
- name: check build files
|
- name: check build files
|
||||||
@ -204,7 +204,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
module: [lib, es]
|
module: [lib, es]
|
||||||
shard: ['1/2', '2/2']
|
shard: [1/2, 2/2]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: oven-sh/setup-bun@v2
|
- uses: oven-sh/setup-bun@v2
|
||||||
|
14
.github/workflows/verify-files-modify.yml
vendored
14
.github/workflows/verify-files-modify.yml
vendored
@ -18,10 +18,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
forbid-paths: '.github/, scripts/'
|
forbid-paths: '.github/, scripts/'
|
||||||
forbid-files: 'CHANGELOG.zh-CN.md, CHANGELOG.en-US.md, LICENSE'
|
forbid-files: 'CHANGELOG.zh-CN.md, CHANGELOG.en-US.md, LICENSE'
|
||||||
skip-verify-authority: 'write'
|
skip-verify-authority: write
|
||||||
skip-label: 'skip-verify-files'
|
skip-label: skip-verify-files
|
||||||
assignees: 'afc163, zombieJ, xrkffgg, MadCcc'
|
assignees: 'afc163, zombieJ, xrkffgg, MadCcc'
|
||||||
comment-mark: 'version'
|
comment-mark: version
|
||||||
comment: |
|
comment: |
|
||||||
Hi @${{ github.event.pull_request.user.login }}. Thanks for your contribution. The path `.github/` or `scripts/` and `CHANGELOG` is only maintained by team members. This current PR will be closed and team members will help on this.
|
Hi @${{ github.event.pull_request.user.login }}. Thanks for your contribution. The path `.github/` or `scripts/` and `CHANGELOG` is only maintained by team members. This current PR will be closed and team members will help on this.
|
||||||
close: true
|
close: true
|
||||||
@ -35,11 +35,11 @@ jobs:
|
|||||||
- name: verify-version
|
- name: verify-version
|
||||||
uses: actions-cool/verify-files-modify@v1
|
uses: actions-cool/verify-files-modify@v1
|
||||||
with:
|
with:
|
||||||
forbid-files: 'README.md'
|
forbid-files: README.md
|
||||||
skip-verify-authority: 'write'
|
skip-verify-authority: write
|
||||||
skip-label: 'skip-verify-files'
|
skip-label: skip-verify-files
|
||||||
assignees: 'afc163, zombieJ, xrkffgg, MadCcc'
|
assignees: 'afc163, zombieJ, xrkffgg, MadCcc'
|
||||||
comment-mark: 'readmeCheck'
|
comment-mark: readmeCheck
|
||||||
comment: |
|
comment: |
|
||||||
Hi @${{ github.event.pull_request.user.login }}. Thanks for your contribution. But, we don't have plan to add README of more languages. This current PR will be closed and team members will help on this.
|
Hi @${{ github.event.pull_request.user.login }}. Thanks for your contribution. But, we don't have plan to add README of more languages. This current PR will be closed and team members will help on this.
|
||||||
close: true
|
close: true
|
||||||
|
2
.github/workflows/verify-package-version.yml
vendored
2
.github/workflows/verify-package-version.yml
vendored
@ -19,6 +19,6 @@ jobs:
|
|||||||
- name: verify-version
|
- name: verify-version
|
||||||
uses: actions-cool/verify-package-version@v1
|
uses: actions-cool/verify-package-version@v1
|
||||||
with:
|
with:
|
||||||
title-include-content: 'docs'
|
title-include-content: docs
|
||||||
title-include-version: true
|
title-include-version: true
|
||||||
open-comment: true
|
open-comment: true
|
||||||
|
@ -21,7 +21,7 @@ jobs:
|
|||||||
name: visual-diff snapshot
|
name: visual-diff snapshot
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
shard: ['1/2', '2/2']
|
shard: [1/2, 2/2]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@ -35,7 +35,7 @@ jobs:
|
|||||||
bun run version
|
bun run version
|
||||||
bun run test:image -- --shard=${{matrix.shard}}
|
bun run test:image -- --shard=${{matrix.shard}}
|
||||||
env:
|
env:
|
||||||
NODE_OPTIONS: "--max_old_space_size=4096"
|
NODE_OPTIONS: --max_old_space_size=4096
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
name: artifact snapshot
|
name: artifact snapshot
|
||||||
|
@ -4,7 +4,7 @@ name: 👀 Visual Regression Diff Finish
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows: ["👀 Visual Regression Diff Build"]
|
workflows: [👀 Visual Regression Diff Build]
|
||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ jobs:
|
|||||||
body: |
|
body: |
|
||||||
${{ steps.report.outputs.content }}
|
${{ steps.report.outputs.content }}
|
||||||
<!-- VISUAL_DIFF_REGRESSION_HOOK -->
|
<!-- VISUAL_DIFF_REGRESSION_HOOK -->
|
||||||
body-include: '<!-- VISUAL_DIFF_REGRESSION_HOOK -->'
|
body-include: <!-- VISUAL_DIFF_REGRESSION_HOOK -->
|
||||||
number: ${{ steps.pr.outputs.id }}
|
number: ${{ steps.pr.outputs.id }}
|
||||||
|
|
||||||
- name: failed comment
|
- name: failed comment
|
||||||
@ -147,7 +147,7 @@ jobs:
|
|||||||
- `report upload` status: ${{ steps.report.outcome }}
|
- `report upload` status: ${{ steps.report.outcome }}
|
||||||
- workflow url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
- workflow url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||||
<!-- VISUAL_DIFF_REGRESSION_HOOK -->
|
<!-- VISUAL_DIFF_REGRESSION_HOOK -->
|
||||||
body-include: '<!-- VISUAL_DIFF_REGRESSION_HOOK -->'
|
body-include: <!-- VISUAL_DIFF_REGRESSION_HOOK -->
|
||||||
number: ${{ steps.pr.outputs.id }}
|
number: ${{ steps.pr.outputs.id }}
|
||||||
|
|
||||||
# Resync commit status. This will be also reset by `visual-regression-diff-approver`
|
# Resync commit status. This will be also reset by `visual-regression-diff-approver`
|
||||||
|
@ -34,4 +34,4 @@ jobs:
|
|||||||
<img src="https://github.com/ant-design/ant-design/assets/507615/5d52d8a2-f74e-4159-9792-c705b7bc1744" width="300" />
|
<img src="https://github.com/ant-design/ant-design/assets/507615/5d52d8a2-f74e-4159-9792-c705b7bc1744" width="300" />
|
||||||
|
|
||||||
<!-- VISUAL_DIFF_REGRESSION_HOOK -->
|
<!-- VISUAL_DIFF_REGRESSION_HOOK -->
|
||||||
body-include: '<!-- VISUAL_DIFF_REGRESSION_HOOK -->'
|
body-include: <!-- VISUAL_DIFF_REGRESSION_HOOK -->
|
||||||
|
@ -4,7 +4,7 @@ name: 👁️ Visual Regression Persist Finish
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows: ["👁️ Visual Regression Persist Start"]
|
workflows: [👁️ Visual Regression Persist Start]
|
||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ jobs:
|
|||||||
bun run test:image
|
bun run test:image
|
||||||
tar -czvf imageSnapshots.tar.gz imageSnapshots/*
|
tar -czvf imageSnapshots.tar.gz imageSnapshots/*
|
||||||
env:
|
env:
|
||||||
NODE_OPTIONS: "--max_old_space_size=4096"
|
NODE_OPTIONS: --max_old_space_size=4096
|
||||||
|
|
||||||
# Upload `imageSnapshots` on master
|
# Upload `imageSnapshots` on master
|
||||||
- name: upload report artifact
|
- name: upload report artifact
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"*.{ts,tsx,js,jsx,css}": ["biome check --write"],
|
"*.{ts,tsx,js,jsx,css,mjs,json}": ["biome check --write"],
|
||||||
"*.{md,yml}": ["prettier --ignore-unknown --write"]
|
"*.{md,yml}": ["prettier --ignore-unknown --write"]
|
||||||
}
|
}
|
||||||
|
3
.npmrc
3
.npmrc
@ -1,5 +1,4 @@
|
|||||||
package-lock=false
|
package-lock=false
|
||||||
|
legacy-peer-deps=true
|
||||||
PUPPETEER_DOWNLOAD_BASE_URL="https://cdn.npmmirror.com/binaries/chrome-for-testing"
|
PUPPETEER_DOWNLOAD_BASE_URL="https://cdn.npmmirror.com/binaries/chrome-for-testing"
|
||||||
|
|
||||||
npm_config_sharp_libvips_binary_host="https://cdn.npmmirror.com/binaries/sharp-libvips"
|
npm_config_sharp_libvips_binary_host="https://cdn.npmmirror.com/binaries/sharp-libvips"
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
/* eslint-disable global-require, import/no-unresolved */
|
/* eslint-disable no-restricted-globals */
|
||||||
|
|
||||||
// This is a alias proxy, which will use global `@ant-design/cssinjs` first.
|
// This is a alias proxy, which will use global `@ant-design/cssinjs` first.
|
||||||
// Use local if global not found.
|
// Use local if global not found.
|
||||||
let cssinjs;
|
let cssinjs;
|
||||||
@ -13,6 +12,7 @@ if (typeof window !== 'undefined' && window.antdCssinjs) {
|
|||||||
} else {
|
} else {
|
||||||
// Use local version.
|
// Use local version.
|
||||||
// Use relative path since webpack will also replace module here.
|
// Use relative path since webpack will also replace module here.
|
||||||
|
// eslint-disable-next-line antfu/no-import-node-modules-by-path
|
||||||
cssinjs = require('../node_modules/@ant-design/cssinjs');
|
cssinjs = require('../node_modules/@ant-design/cssinjs');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ describe('node', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Use mock to get config
|
// Use mock to get config
|
||||||
require(`../../${componentTestFile}`); // eslint-disable-line global-require, import/no-dynamic-require
|
require(`../../${componentTestFile}`);
|
||||||
const option = (global as any).testConfig?.[componentName];
|
const option = (global as any).testConfig?.[componentName];
|
||||||
|
|
||||||
demoList.forEach((demoFile) => {
|
demoList.forEach((demoFile) => {
|
||||||
@ -42,7 +42,7 @@ describe('node', () => {
|
|||||||
const test = skip.some((skipMarkdown) => demoFile.includes(skipMarkdown)) ? it.skip : it;
|
const test = skip.some((skipMarkdown) => demoFile.includes(skipMarkdown)) ? it.skip : it;
|
||||||
|
|
||||||
test(demoFile, () => {
|
test(demoFile, () => {
|
||||||
const Demo = require(`../../${demoFile}`).default; // eslint-disable-line global-require, import/no-dynamic-require
|
const Demo = require(`../../${demoFile}`).default;
|
||||||
expect(() => {
|
expect(() => {
|
||||||
renderToString(<Demo />);
|
renderToString(<Demo />);
|
||||||
}).not.toThrow();
|
}).not.toThrow();
|
||||||
|
@ -4,10 +4,6 @@ import type { GetProp, GetProps, GetRef } from '../type';
|
|||||||
|
|
||||||
describe('type', () => {
|
describe('type', () => {
|
||||||
class CC extends React.Component<{ bamboo?: number }> {
|
class CC extends React.Component<{ bamboo?: number }> {
|
||||||
getBamboo() {
|
|
||||||
return this.props.bamboo;
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return this.props.bamboo;
|
return this.props.bamboo;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable class-methods-use-this */
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import KeyCode from 'rc-util/lib/KeyCode';
|
import KeyCode from 'rc-util/lib/KeyCode';
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@ describe('Wave component', () => {
|
|||||||
let disCnt = 0;
|
let disCnt = 0;
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
/* eslint-disable class-methods-use-this */
|
|
||||||
class FakeResizeObserver {
|
class FakeResizeObserver {
|
||||||
observe = () => {
|
observe = () => {
|
||||||
obCnt += 1;
|
obCnt += 1;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable */
|
|
||||||
export function easeInOutCubic(t: number, b: number, c: number, d: number) {
|
export function easeInOutCubic(t: number, b: number, c: number, d: number) {
|
||||||
const cc = c - b;
|
const cc = c - b;
|
||||||
// biome-ignore lint: it is a common easing function
|
// biome-ignore lint: it is a common easing function
|
||||||
|
@ -27,10 +27,9 @@ const initCollapseMotion = (rootCls = defaultPrefixCls): CSSMotionProps => ({
|
|||||||
motionDeadline: 500,
|
motionDeadline: 500,
|
||||||
});
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
const _SelectPlacements = ['bottomLeft', 'bottomRight', 'topLeft', 'topRight'] as const;
|
||||||
const SelectPlacements = ['bottomLeft', 'bottomRight', 'topLeft', 'topRight'] as const;
|
|
||||||
|
|
||||||
export type SelectCommonPlacement = (typeof SelectPlacements)[number];
|
export type SelectCommonPlacement = (typeof _SelectPlacements)[number];
|
||||||
|
|
||||||
const getTransitionName = (rootPrefixCls: string, motion: string, transitionName?: string) => {
|
const getTransitionName = (rootPrefixCls: string, motion: string, transitionName?: string) => {
|
||||||
if (transitionName !== undefined) {
|
if (transitionName !== undefined) {
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable default-case */
|
|
||||||
import type { AlignType, BuildInPlacements } from '@rc-component/trigger';
|
import type { AlignType, BuildInPlacements } from '@rc-component/trigger';
|
||||||
|
|
||||||
import { getArrowOffsetToken } from '../style/placementArrow';
|
import { getArrowOffsetToken } from '../style/placementArrow';
|
||||||
|
@ -2,10 +2,8 @@ import classNames from 'classnames';
|
|||||||
|
|
||||||
import type { ValidateStatus } from '../form/FormItem';
|
import type { ValidateStatus } from '../form/FormItem';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
const _InputStatuses = ['warning', 'error', ''] as const;
|
||||||
const InputStatuses = ['warning', 'error', ''] as const;
|
export type InputStatus = (typeof _InputStatuses)[number];
|
||||||
|
|
||||||
export type InputStatus = (typeof InputStatuses)[number];
|
|
||||||
|
|
||||||
export function getStatusClassNames(
|
export function getStatusClassNames(
|
||||||
prefixCls: string,
|
prefixCls: string,
|
||||||
|
@ -77,7 +77,6 @@ export const devUseWarning: (component: string) => TypeWarning =
|
|||||||
|
|
||||||
// Warning for the first time
|
// Warning for the first time
|
||||||
if (!existWarning) {
|
if (!existWarning) {
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.warn(
|
console.warn(
|
||||||
'[antd] There exists deprecated usage in your code:',
|
'[antd] There exists deprecated usage in your code:',
|
||||||
deprecatedWarnList,
|
deprecatedWarnList,
|
||||||
|
@ -219,7 +219,6 @@ const Alert = React.forwardRef<AlertRef, AlertProps>((props, ref) => {
|
|||||||
const mergedAriaProps = React.useMemo<React.AriaAttributes>(() => {
|
const mergedAriaProps = React.useMemo<React.AriaAttributes>(() => {
|
||||||
const merged = closable ?? alert?.closable;
|
const merged = closable ?? alert?.closable;
|
||||||
if (typeof merged === 'object') {
|
if (typeof merged === 'object') {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
const { closeIcon: _, ...ariaProps } = merged;
|
const { closeIcon: _, ...ariaProps } = merged;
|
||||||
return ariaProps;
|
return ariaProps;
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,6 @@ describe('Alert', () => {
|
|||||||
const warnSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
const warnSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
||||||
expect(warnSpy).toHaveBeenCalledTimes(0);
|
expect(warnSpy).toHaveBeenCalledTimes(0);
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
// eslint-disable-next-line react/jsx-no-undef
|
|
||||||
const ThrowError = () => <NotExisted />;
|
const ThrowError = () => <NotExisted />;
|
||||||
render(
|
render(
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
|
@ -78,8 +78,8 @@ describe('AutoComplete', () => {
|
|||||||
);
|
);
|
||||||
expect(screen.getByRole('combobox')).toBeInTheDocument();
|
expect(screen.getByRole('combobox')).toBeInTheDocument();
|
||||||
await userEvent.type(screen.getByRole('combobox'), '1');
|
await userEvent.type(screen.getByRole('combobox'), '1');
|
||||||
expect(screen.getByTitle(/111/i)).toBeInTheDocument();
|
expect(screen.getByTitle(/111/)).toBeInTheDocument();
|
||||||
expect(screen.getByTitle(/222/i)).toBeInTheDocument();
|
expect(screen.getByTitle(/222/)).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not warning when getInputElement is null', () => {
|
it('should not warning when getInputElement is null', () => {
|
||||||
|
@ -232,7 +232,6 @@ describe('Button', () => {
|
|||||||
it('should merge text if children using variable', () => {
|
it('should merge text if children using variable', () => {
|
||||||
const wrapper = render(
|
const wrapper = render(
|
||||||
<Button>
|
<Button>
|
||||||
{/* eslint-disable-next-line react/jsx-curly-brace-presence */}
|
|
||||||
This {'is'} a test {1}
|
This {'is'} a test {1}
|
||||||
</Button>,
|
</Button>,
|
||||||
);
|
);
|
||||||
@ -330,7 +329,6 @@ describe('Button', () => {
|
|||||||
it('should handle fragment as children', () => {
|
it('should handle fragment as children', () => {
|
||||||
const wrapper = render(
|
const wrapper = render(
|
||||||
<Button>
|
<Button>
|
||||||
{/* eslint-disable-next-line react/jsx-no-useless-fragment */}
|
|
||||||
<>text</>
|
<>text</>
|
||||||
</Button>,
|
</Button>,
|
||||||
);
|
);
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable react/button-has-type */
|
|
||||||
import React, { Children, createRef, useContext, useEffect, useMemo, useState } from 'react';
|
import React, { Children, createRef, useContext, useEffect, useMemo, useState } from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import omit from 'rc-util/lib/omit';
|
import omit from 'rc-util/lib/omit';
|
||||||
|
@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import { cloneElement, isFragment } from '../_util/reactNode';
|
import { cloneElement, isFragment } from '../_util/reactNode';
|
||||||
import type { BaseButtonProps, LegacyButtonType } from './button';
|
import type { BaseButtonProps, LegacyButtonType } from './button';
|
||||||
|
|
||||||
const rxTwoCNChar = /^[\u4e00-\u9fa5]{2}$/;
|
const rxTwoCNChar = /^[\u4E00-\u9FA5]{2}$/;
|
||||||
export const isTwoCNChar = rxTwoCNChar.test.bind(rxTwoCNChar);
|
export const isTwoCNChar = rxTwoCNChar.test.bind(rxTwoCNChar);
|
||||||
|
|
||||||
export function convertLegacyProps(
|
export function convertLegacyProps(
|
||||||
@ -75,20 +75,16 @@ export function spaceChildren(children: React.ReactNode, needInserted: boolean)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
const _ButtonTypes = ['default', 'primary', 'dashed', 'link', 'text'] as const;
|
||||||
const ButtonTypes = ['default', 'primary', 'dashed', 'link', 'text'] as const;
|
export type ButtonType = (typeof _ButtonTypes)[number];
|
||||||
export type ButtonType = (typeof ButtonTypes)[number];
|
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
const _ButtonShapes = ['default', 'circle', 'round'] as const;
|
||||||
const ButtonShapes = ['default', 'circle', 'round'] as const;
|
export type ButtonShape = (typeof _ButtonShapes)[number];
|
||||||
export type ButtonShape = (typeof ButtonShapes)[number];
|
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
const _ButtonHTMLTypes = ['submit', 'button', 'reset'] as const;
|
||||||
const ButtonHTMLTypes = ['submit', 'button', 'reset'] as const;
|
export type ButtonHTMLType = (typeof _ButtonHTMLTypes)[number];
|
||||||
export type ButtonHTMLType = (typeof ButtonHTMLTypes)[number];
|
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
export const _ButtonVariantTypes = [
|
||||||
export const ButtonVariantTypes = [
|
|
||||||
'outlined',
|
'outlined',
|
||||||
'dashed',
|
'dashed',
|
||||||
'solid',
|
'solid',
|
||||||
@ -96,8 +92,7 @@ export const ButtonVariantTypes = [
|
|||||||
'text',
|
'text',
|
||||||
'link',
|
'link',
|
||||||
] as const;
|
] as const;
|
||||||
export type ButtonVariantType = (typeof ButtonVariantTypes)[number];
|
export type ButtonVariantType = (typeof _ButtonVariantTypes)[number];
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
export const _ButtonColorTypes = ['default', 'primary', 'danger'] as const;
|
||||||
export const ButtonColorTypes = ['default', 'primary', 'danger'] as const;
|
export type ButtonColorType = (typeof _ButtonColorTypes)[number];
|
||||||
export type ButtonColorType = (typeof ButtonColorTypes)[number];
|
|
||||||
|
@ -202,7 +202,7 @@ describe('Calendar', () => {
|
|||||||
|
|
||||||
it('Calendar should support locale', () => {
|
it('Calendar should support locale', () => {
|
||||||
MockDate.set(Dayjs('2018-10-19').valueOf());
|
MockDate.set(Dayjs('2018-10-19').valueOf());
|
||||||
// eslint-disable-next-line global-require
|
|
||||||
const zhCN = require('../locale/zh_CN').default;
|
const zhCN = require('../locale/zh_CN').default;
|
||||||
const wrapper = render(<Calendar locale={zhCN} />);
|
const wrapper = render(<Calendar locale={zhCN} />);
|
||||||
expect(wrapper.container.children[0]).toMatchSnapshot();
|
expect(wrapper.container.children[0]).toMatchSnapshot();
|
||||||
@ -211,9 +211,9 @@ describe('Calendar', () => {
|
|||||||
|
|
||||||
it('Calendar locale support should override ConfigProvider locale', () => {
|
it('Calendar locale support should override ConfigProvider locale', () => {
|
||||||
MockDate.set(Dayjs('2018-10-19').valueOf());
|
MockDate.set(Dayjs('2018-10-19').valueOf());
|
||||||
// eslint-disable-next-line global-require
|
|
||||||
const zhCN = require('../locale/zh_CN').default;
|
const zhCN = require('../locale/zh_CN').default;
|
||||||
// eslint-disable-next-line global-require
|
|
||||||
const enUs = require('../../locale/en_US').default;
|
const enUs = require('../../locale/en_US').default;
|
||||||
const wrapper = render(
|
const wrapper = render(
|
||||||
<ConfigProvider locale={enUs}>
|
<ConfigProvider locale={enUs}>
|
||||||
|
@ -97,7 +97,6 @@ describe('Carousel', () => {
|
|||||||
|
|
||||||
describe('should works for dotPosition', () => {
|
describe('should works for dotPosition', () => {
|
||||||
(['left', 'right', 'top', 'bottom'] as const).forEach((dotPosition) => {
|
(['left', 'right', 'top', 'bottom'] as const).forEach((dotPosition) => {
|
||||||
// eslint-disable-next-line jest/valid-title
|
|
||||||
it(dotPosition, () => {
|
it(dotPosition, () => {
|
||||||
const { container } = render(
|
const { container } = render(
|
||||||
<Carousel dotPosition={dotPosition}>
|
<Carousel dotPosition={dotPosition}>
|
||||||
|
@ -147,7 +147,7 @@ const InternalCheckbox: React.ForwardRefRenderFunction<CheckboxRef, CheckboxProp
|
|||||||
const ariaChecked = indeterminate ? 'mixed' : undefined;
|
const ariaChecked = indeterminate ? 'mixed' : undefined;
|
||||||
return wrapCSSVar(
|
return wrapCSSVar(
|
||||||
<Wave component="Checkbox" disabled={mergedDisabled}>
|
<Wave component="Checkbox" disabled={mergedDisabled}>
|
||||||
{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
|
{}
|
||||||
<label
|
<label
|
||||||
className={classString}
|
className={classString}
|
||||||
style={{ ...checkbox?.style, ...style }}
|
style={{ ...checkbox?.style, ...style }}
|
||||||
|
@ -4,7 +4,6 @@ import { resetWarned } from '../../_util/warning';
|
|||||||
import { act, fireEvent, render, waitFakeTimer } from '../../../tests/utils';
|
import { act, fireEvent, render, waitFakeTimer } from '../../../tests/utils';
|
||||||
|
|
||||||
describe('Collapse', () => {
|
describe('Collapse', () => {
|
||||||
// eslint-disable-next-line global-require
|
|
||||||
const Collapse = require('..').default;
|
const Collapse = require('..').default;
|
||||||
|
|
||||||
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
/* eslint-disable class-methods-use-this */
|
|
||||||
import { Color as RcColor } from '@rc-component/color-picker';
|
import { Color as RcColor } from '@rc-component/color-picker';
|
||||||
|
|
||||||
import type { ColorGenInput, Colors } from './interface';
|
import type { ColorGenInput, Colors } from './interface';
|
||||||
|
|
||||||
export const toHexFormat = (value?: string, alpha?: boolean) =>
|
export const toHexFormat = (value?: string, alpha?: boolean) =>
|
||||||
value?.replace(/[^\w/]/gi, '').slice(0, alpha ? 8 : 6) || '';
|
value?.replace(/[^\w/]/g, '').slice(0, alpha ? 8 : 6) || '';
|
||||||
|
|
||||||
export const getHex = (value?: string, alpha?: boolean) => (value ? toHexFormat(value, alpha) : '');
|
export const getHex = (value?: string, alpha?: boolean) => (value ? toHexFormat(value, alpha) : '');
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ import Button from '../../button';
|
|||||||
|
|
||||||
describe('ConfigProvider.Icon', () => {
|
describe('ConfigProvider.Icon', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
// eslint-disable-next-line jest/no-standalone-expect
|
|
||||||
expect(document.querySelectorAll('style')).toHaveLength(0);
|
expect(document.querySelectorAll('style')).toHaveLength(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* eslint-disable import/prefer-default-export, prefer-destructuring */
|
|
||||||
|
|
||||||
import { generate } from '@ant-design/colors';
|
import { generate } from '@ant-design/colors';
|
||||||
import { TinyColor } from '@ctrl/tinycolor';
|
import { TinyColor } from '@ctrl/tinycolor';
|
||||||
import canUseDom from 'rc-util/lib/Dom/canUseDom';
|
import canUseDom from 'rc-util/lib/Dom/canUseDom';
|
||||||
|
@ -1,2 +1 @@
|
|||||||
// eslint-disable-next-line no-restricted-exports
|
|
||||||
export { useResetIconStyle as default } from '../../theme/internal';
|
export { useResetIconStyle as default } from '../../theme/internal';
|
||||||
|
@ -18,7 +18,6 @@ const range = (start: number, end: number) => {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
// eslint-disable-next-line arrow-body-style
|
|
||||||
const disabledDate: RangePickerProps['disabledDate'] = (current) => {
|
const disabledDate: RangePickerProps['disabledDate'] = (current) => {
|
||||||
// Can not select days before today and today
|
// Can not select days before today and today
|
||||||
return current && current < dayjs().endOf('day');
|
return current && current < dayjs().endOf('day');
|
||||||
|
@ -58,9 +58,7 @@ const useStyle = createStyles(({ token }) => ({
|
|||||||
`,
|
`,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const seeds = Array(30)
|
const seeds = new Array(30).fill(1).map(() => Math.random());
|
||||||
.fill(1)
|
|
||||||
.map(() => Math.random());
|
|
||||||
|
|
||||||
const getSales = (date: Dayjs) => Math.floor(seeds[date.date() % 30] * 10000);
|
const getSales = (date: Dayjs) => Math.floor(seeds[date.date() % 30] * 10000);
|
||||||
|
|
||||||
|
@ -11,10 +11,9 @@ import type { SizeType } from '../../config-provider/SizeContext';
|
|||||||
import type { Variant } from '../../config-provider';
|
import type { Variant } from '../../config-provider';
|
||||||
import type { TimePickerLocale } from '../../time-picker';
|
import type { TimePickerLocale } from '../../time-picker';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
const _DataPickerPlacements = ['bottomLeft', 'bottomRight', 'topLeft', 'topRight'] as const;
|
||||||
const DataPickerPlacements = ['bottomLeft', 'bottomRight', 'topLeft', 'topRight'] as const;
|
|
||||||
|
|
||||||
type DataPickerPlacement = (typeof DataPickerPlacements)[number];
|
type DataPickerPlacement = (typeof _DataPickerPlacements)[number];
|
||||||
|
|
||||||
export type PickerLocale = {
|
export type PickerLocale = {
|
||||||
lang: RcPickerLocale & AdditionalPickerLocaleLangProps;
|
lang: RcPickerLocale & AdditionalPickerLocaleLangProps;
|
||||||
|
@ -37,7 +37,6 @@ describe('Descriptions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('when max-width: 575px, column=2', () => {
|
it('when max-width: 575px, column=2', () => {
|
||||||
// eslint-disable-next-line global-require
|
|
||||||
const wrapper = render(
|
const wrapper = render(
|
||||||
<Descriptions column={{ xs: 2 }}>
|
<Descriptions column={{ xs: 2 }}>
|
||||||
<Descriptions.Item label="Product">Cloud Database</Descriptions.Item>
|
<Descriptions.Item label="Product">Cloud Database</Descriptions.Item>
|
||||||
@ -51,7 +50,6 @@ describe('Descriptions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('when max-width: 575px, column=2, span=2', () => {
|
it('when max-width: 575px, column=2, span=2', () => {
|
||||||
// eslint-disable-next-line global-require
|
|
||||||
const { container } = render(
|
const { container } = render(
|
||||||
<Descriptions
|
<Descriptions
|
||||||
column={{ xs: 2 }}
|
column={{ xs: 2 }}
|
||||||
@ -81,7 +79,6 @@ describe('Descriptions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('column is number', () => {
|
it('column is number', () => {
|
||||||
// eslint-disable-next-line global-require
|
|
||||||
const wrapper = render(
|
const wrapper = render(
|
||||||
<Descriptions column={3}>
|
<Descriptions column={3}>
|
||||||
<Descriptions.Item label="Product">Cloud Database</Descriptions.Item>
|
<Descriptions.Item label="Product">Cloud Database</Descriptions.Item>
|
||||||
@ -146,7 +143,6 @@ describe('Descriptions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('vertical layout', () => {
|
it('vertical layout', () => {
|
||||||
// eslint-disable-next-line global-require
|
|
||||||
const wrapper = render(
|
const wrapper = render(
|
||||||
<Descriptions layout="vertical">
|
<Descriptions layout="vertical">
|
||||||
<Descriptions.Item label="Product">Cloud Database</Descriptions.Item>
|
<Descriptions.Item label="Product">Cloud Database</Descriptions.Item>
|
||||||
|
@ -16,9 +16,8 @@ import type { DrawerClassNames, DrawerPanelProps, DrawerStyles } from './DrawerP
|
|||||||
import DrawerPanel from './DrawerPanel';
|
import DrawerPanel from './DrawerPanel';
|
||||||
import useStyle from './style';
|
import useStyle from './style';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
const _SizeTypes = ['default', 'large'] as const;
|
||||||
const SizeTypes = ['default', 'large'] as const;
|
type sizeType = (typeof _SizeTypes)[number];
|
||||||
type sizeType = (typeof SizeTypes)[number];
|
|
||||||
|
|
||||||
export interface PushState {
|
export interface PushState {
|
||||||
distance: string | number;
|
distance: string | number;
|
||||||
|
@ -22,8 +22,7 @@ import { OverrideProvider } from '../menu/OverrideContext';
|
|||||||
import { useToken } from '../theme/internal';
|
import { useToken } from '../theme/internal';
|
||||||
import useStyle from './style';
|
import useStyle from './style';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
const _Placements = [
|
||||||
const Placements = [
|
|
||||||
'topLeft',
|
'topLeft',
|
||||||
'topCenter',
|
'topCenter',
|
||||||
'topRight',
|
'topRight',
|
||||||
@ -34,7 +33,7 @@ const Placements = [
|
|||||||
'bottom',
|
'bottom',
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
type Placement = (typeof Placements)[number];
|
type Placement = (typeof _Placements)[number];
|
||||||
type DropdownPlacement = Exclude<Placement, 'topCenter' | 'bottomCenter'>;
|
type DropdownPlacement = Exclude<Placement, 'topCenter' | 'bottomCenter'>;
|
||||||
|
|
||||||
type OverlayFunc = () => React.ReactElement;
|
type OverlayFunc = () => React.ReactElement;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable react/button-has-type */
|
|
||||||
import React, { useContext, useMemo } from 'react';
|
import React, { useContext, useMemo } from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import omit from 'rc-util/lib/omit';
|
import omit from 'rc-util/lib/omit';
|
||||||
|
@ -31,9 +31,8 @@ interface FieldError {
|
|||||||
warnings: string[];
|
warnings: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
const _ValidateStatuses = ['success', 'warning', 'error', 'validating', ''] as const;
|
||||||
const ValidateStatuses = ['success', 'warning', 'error', 'validating', ''] as const;
|
export type ValidateStatus = (typeof _ValidateStatuses)[number];
|
||||||
export type ValidateStatus = (typeof ValidateStatuses)[number];
|
|
||||||
|
|
||||||
type RenderChildren<Values = any> = (form: FormInstance<Values>) => React.ReactNode;
|
type RenderChildren<Values = any> = (form: FormInstance<Values>) => React.ReactNode;
|
||||||
type RcFieldProps<Values = any> = Omit<FieldProps<Values>, 'children'>;
|
type RcFieldProps<Values = any> = Omit<FieldProps<Values>, 'children'>;
|
||||||
|
@ -710,7 +710,6 @@ describe('Form', () => {
|
|||||||
</Form>,
|
</Form>,
|
||||||
);
|
);
|
||||||
|
|
||||||
/* eslint-disable no-await-in-loop */
|
|
||||||
for (let i = 0; i < 3; i += 1) {
|
for (let i = 0; i < 3; i += 1) {
|
||||||
await changeValue(0, 'bamboo');
|
await changeValue(0, 'bamboo');
|
||||||
await changeValue(0, '');
|
await changeValue(0, '');
|
||||||
@ -721,7 +720,6 @@ describe('Form', () => {
|
|||||||
await changeValue(0, 'p');
|
await changeValue(0, 'p');
|
||||||
expect(container.querySelector('.ant-form-item-explain')?.textContent).toEqual('not a p');
|
expect(container.querySelector('.ant-form-item-explain')?.textContent).toEqual('not a p');
|
||||||
}
|
}
|
||||||
/* eslint-enable */
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// https://github.com/ant-design/ant-design/issues/20813
|
// https://github.com/ant-design/ant-design/issues/20813
|
||||||
@ -1025,7 +1023,6 @@ describe('Form', () => {
|
|||||||
it('validation message should has alert role', async () => {
|
it('validation message should has alert role', async () => {
|
||||||
// https://github.com/ant-design/ant-design/issues/25711
|
// https://github.com/ant-design/ant-design/issues/25711
|
||||||
const { container } = render(
|
const { container } = render(
|
||||||
// eslint-disable-next-line no-template-curly-in-string
|
|
||||||
<Form validateMessages={{ required: 'name is good!' }}>
|
<Form validateMessages={{ required: 'name is good!' }}>
|
||||||
<Form.Item name="test" rules={[{ required: true }]}>
|
<Form.Item name="test" rules={[{ required: true }]}>
|
||||||
<input />
|
<input />
|
||||||
@ -1067,7 +1064,7 @@ describe('Form', () => {
|
|||||||
|
|
||||||
for (let i = 0; i < 5; i += 1) {
|
for (let i = 0; i < 5; i += 1) {
|
||||||
fireEvent.click(container.querySelector('button')!);
|
fireEvent.click(container.querySelector('button')!);
|
||||||
// eslint-disable-next-line no-await-in-loop
|
|
||||||
await waitFakeTimer();
|
await waitFakeTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ describe('Form.List', () => {
|
|||||||
{(fields, { add, remove }) => (
|
{(fields, { add, remove }) => (
|
||||||
<>
|
<>
|
||||||
{fields.map((field) => (
|
{fields.map((field) => (
|
||||||
/* biome-ignore lint/correctness/useJsxKeyInIterable: key is in a field */ /* eslint-disable-next-line react/jsx-key */
|
/* biome-ignore lint/correctness/useJsxKeyInIterable: key is in a field */ /* eslint-disable-next-line react/no-missing-key */
|
||||||
<Form.Item {...field}>
|
<Form.Item {...field}>
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
@ -6,7 +6,6 @@ const layout = {
|
|||||||
wrapperCol: { span: 16 },
|
wrapperCol: { span: 16 },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* eslint-disable no-template-curly-in-string */
|
|
||||||
const validateMessages = {
|
const validateMessages = {
|
||||||
required: '${label} is required!',
|
required: '${label} is required!',
|
||||||
types: {
|
types: {
|
||||||
@ -17,7 +16,6 @@ const validateMessages = {
|
|||||||
range: '${label} must be between ${min} and ${max}',
|
range: '${label} must be between ${min} and ${max}',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
/* eslint-enable no-template-curly-in-string */
|
|
||||||
|
|
||||||
const onFinish = (values: any) => {
|
const onFinish = (values: any) => {
|
||||||
console.log(values);
|
console.log(values);
|
||||||
|
@ -8,10 +8,8 @@ import RowContext from './RowContext';
|
|||||||
import type { RowContextState } from './RowContext';
|
import type { RowContextState } from './RowContext';
|
||||||
import { useRowStyle } from './style';
|
import { useRowStyle } from './style';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
const _RowAligns = ['top', 'middle', 'bottom', 'stretch'] as const;
|
||||||
const RowAligns = ['top', 'middle', 'bottom', 'stretch'] as const;
|
const _RowJustify = [
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
const RowJustify = [
|
|
||||||
'start',
|
'start',
|
||||||
'end',
|
'end',
|
||||||
'center',
|
'center',
|
||||||
@ -28,12 +26,12 @@ type ResponsiveLike<T> = {
|
|||||||
type Gap = number | undefined;
|
type Gap = number | undefined;
|
||||||
export type Gutter = number | undefined | Partial<Record<Breakpoint, number>>;
|
export type Gutter = number | undefined | Partial<Record<Breakpoint, number>>;
|
||||||
|
|
||||||
type ResponsiveAligns = ResponsiveLike<(typeof RowAligns)[number]>;
|
type ResponsiveAligns = ResponsiveLike<(typeof _RowAligns)[number]>;
|
||||||
type ResponsiveJustify = ResponsiveLike<(typeof RowJustify)[number]>;
|
type ResponsiveJustify = ResponsiveLike<(typeof _RowJustify)[number]>;
|
||||||
export interface RowProps extends React.HTMLAttributes<HTMLDivElement> {
|
export interface RowProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||||
gutter?: Gutter | [Gutter, Gutter];
|
gutter?: Gutter | [Gutter, Gutter];
|
||||||
align?: (typeof RowAligns)[number] | ResponsiveAligns;
|
align?: (typeof _RowAligns)[number] | ResponsiveAligns;
|
||||||
justify?: (typeof RowJustify)[number] | ResponsiveJustify;
|
justify?: (typeof _RowJustify)[number] | ResponsiveJustify;
|
||||||
prefixCls?: string;
|
prefixCls?: string;
|
||||||
wrap?: boolean;
|
wrap?: boolean;
|
||||||
}
|
}
|
||||||
|
@ -238,7 +238,6 @@ exports[`renders components/icon/demo/custom.tsx extend context correctly 1`] =
|
|||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
aria-label="home"
|
aria-label="home"
|
||||||
class="anticon anticon-home"
|
class="anticon anticon-home"
|
||||||
fill="currentColor"
|
|
||||||
focusable="false"
|
focusable="false"
|
||||||
height="1em"
|
height="1em"
|
||||||
role="img"
|
role="img"
|
||||||
@ -302,7 +301,6 @@ exports[`renders components/icon/demo/iconfont.tsx extend context correctly 1`]
|
|||||||
<svg
|
<svg
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class=""
|
class=""
|
||||||
fill="currentColor"
|
|
||||||
focusable="false"
|
focusable="false"
|
||||||
height="1em"
|
height="1em"
|
||||||
width="1em"
|
width="1em"
|
||||||
@ -323,7 +321,6 @@ exports[`renders components/icon/demo/iconfont.tsx extend context correctly 1`]
|
|||||||
<svg
|
<svg
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class=""
|
class=""
|
||||||
fill="currentColor"
|
|
||||||
focusable="false"
|
focusable="false"
|
||||||
height="1em"
|
height="1em"
|
||||||
width="1em"
|
width="1em"
|
||||||
@ -344,7 +341,6 @@ exports[`renders components/icon/demo/iconfont.tsx extend context correctly 1`]
|
|||||||
<svg
|
<svg
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class=""
|
class=""
|
||||||
fill="currentColor"
|
|
||||||
focusable="false"
|
focusable="false"
|
||||||
height="1em"
|
height="1em"
|
||||||
width="1em"
|
width="1em"
|
||||||
@ -374,7 +370,6 @@ exports[`renders components/icon/demo/scriptUrl.tsx extend context correctly 1`]
|
|||||||
<svg
|
<svg
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class=""
|
class=""
|
||||||
fill="currentColor"
|
|
||||||
focusable="false"
|
focusable="false"
|
||||||
height="1em"
|
height="1em"
|
||||||
width="1em"
|
width="1em"
|
||||||
@ -395,7 +390,6 @@ exports[`renders components/icon/demo/scriptUrl.tsx extend context correctly 1`]
|
|||||||
<svg
|
<svg
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class=""
|
class=""
|
||||||
fill="currentColor"
|
|
||||||
focusable="false"
|
focusable="false"
|
||||||
height="1em"
|
height="1em"
|
||||||
width="1em"
|
width="1em"
|
||||||
@ -416,7 +410,6 @@ exports[`renders components/icon/demo/scriptUrl.tsx extend context correctly 1`]
|
|||||||
<svg
|
<svg
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class=""
|
class=""
|
||||||
fill="currentColor"
|
|
||||||
focusable="false"
|
focusable="false"
|
||||||
height="1em"
|
height="1em"
|
||||||
width="1em"
|
width="1em"
|
||||||
@ -437,7 +430,6 @@ exports[`renders components/icon/demo/scriptUrl.tsx extend context correctly 1`]
|
|||||||
<svg
|
<svg
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class=""
|
class=""
|
||||||
fill="currentColor"
|
|
||||||
focusable="false"
|
focusable="false"
|
||||||
height="1em"
|
height="1em"
|
||||||
width="1em"
|
width="1em"
|
||||||
|
@ -236,7 +236,6 @@ exports[`renders components/icon/demo/custom.tsx correctly 1`] = `
|
|||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
aria-label="home"
|
aria-label="home"
|
||||||
class="anticon anticon-home"
|
class="anticon anticon-home"
|
||||||
fill="currentColor"
|
|
||||||
focusable="false"
|
focusable="false"
|
||||||
height="1em"
|
height="1em"
|
||||||
role="img"
|
role="img"
|
||||||
@ -298,7 +297,6 @@ exports[`renders components/icon/demo/iconfont.tsx correctly 1`] = `
|
|||||||
<svg
|
<svg
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class=""
|
class=""
|
||||||
fill="currentColor"
|
|
||||||
focusable="false"
|
focusable="false"
|
||||||
height="1em"
|
height="1em"
|
||||||
width="1em"
|
width="1em"
|
||||||
@ -319,7 +317,6 @@ exports[`renders components/icon/demo/iconfont.tsx correctly 1`] = `
|
|||||||
<svg
|
<svg
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class=""
|
class=""
|
||||||
fill="currentColor"
|
|
||||||
focusable="false"
|
focusable="false"
|
||||||
height="1em"
|
height="1em"
|
||||||
width="1em"
|
width="1em"
|
||||||
@ -340,7 +337,6 @@ exports[`renders components/icon/demo/iconfont.tsx correctly 1`] = `
|
|||||||
<svg
|
<svg
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class=""
|
class=""
|
||||||
fill="currentColor"
|
|
||||||
focusable="false"
|
focusable="false"
|
||||||
height="1em"
|
height="1em"
|
||||||
width="1em"
|
width="1em"
|
||||||
@ -368,7 +364,6 @@ exports[`renders components/icon/demo/scriptUrl.tsx correctly 1`] = `
|
|||||||
<svg
|
<svg
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class=""
|
class=""
|
||||||
fill="currentColor"
|
|
||||||
focusable="false"
|
focusable="false"
|
||||||
height="1em"
|
height="1em"
|
||||||
width="1em"
|
width="1em"
|
||||||
@ -389,7 +384,6 @@ exports[`renders components/icon/demo/scriptUrl.tsx correctly 1`] = `
|
|||||||
<svg
|
<svg
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class=""
|
class=""
|
||||||
fill="currentColor"
|
|
||||||
focusable="false"
|
focusable="false"
|
||||||
height="1em"
|
height="1em"
|
||||||
width="1em"
|
width="1em"
|
||||||
@ -410,7 +404,6 @@ exports[`renders components/icon/demo/scriptUrl.tsx correctly 1`] = `
|
|||||||
<svg
|
<svg
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class=""
|
class=""
|
||||||
fill="currentColor"
|
|
||||||
focusable="false"
|
focusable="false"
|
||||||
height="1em"
|
height="1em"
|
||||||
width="1em"
|
width="1em"
|
||||||
@ -431,7 +424,6 @@ exports[`renders components/icon/demo/scriptUrl.tsx correctly 1`] = `
|
|||||||
<svg
|
<svg
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class=""
|
class=""
|
||||||
fill="currentColor"
|
|
||||||
focusable="false"
|
focusable="false"
|
||||||
height="1em"
|
height="1em"
|
||||||
width="1em"
|
width="1em"
|
||||||
|
@ -118,7 +118,7 @@ const InputNumber = React.forwardRef<HTMLInputElement, InputNumberProps>((props,
|
|||||||
|
|
||||||
const [variant, enableVariantCls] = useVariant('inputNumber', customVariant, bordered);
|
const [variant, enableVariantCls] = useVariant('inputNumber', customVariant, bordered);
|
||||||
|
|
||||||
/* biome-ignore lint/complexity/noUselessFragments: avoid falsy value */ /* eslint-disable-next-line react/jsx-no-useless-fragment */
|
/* biome-ignore lint/complexity/noUselessFragments: avoid falsy value */
|
||||||
const suffixNode = hasFeedback && <>{feedbackIcon}</>;
|
const suffixNode = hasFeedback && <>{feedbackIcon}</>;
|
||||||
|
|
||||||
const inputNumberClass = classNames(
|
const inputNumberClass = classNames(
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { createPortal } from 'react-dom';
|
import { createPortal } from 'react-dom';
|
||||||
|
|
||||||
// eslint-disable-next-line import/no-unresolved
|
|
||||||
import type { InputProps, InputRef } from '..';
|
import type { InputProps, InputRef } from '..';
|
||||||
import Input from '..';
|
import Input from '..';
|
||||||
import { resetWarned } from '../../_util/warning';
|
import { resetWarned } from '../../_util/warning';
|
||||||
|
@ -2,7 +2,6 @@ import type { ReactNode } from 'react';
|
|||||||
|
|
||||||
import type { InputProps } from './Input';
|
import type { InputProps } from './Input';
|
||||||
|
|
||||||
// eslint-disable-next-line import/prefer-default-export
|
|
||||||
export function hasPrefixSuffix(props: {
|
export function hasPrefixSuffix(props: {
|
||||||
prefix?: ReactNode;
|
prefix?: ReactNode;
|
||||||
suffix?: ReactNode;
|
suffix?: ReactNode;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable react/no-multi-comp */
|
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
import 'dayjs/locale/ar';
|
import 'dayjs/locale/ar';
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-template-curly-in-string */
|
|
||||||
import Pagination from 'rc-pagination/lib/locale/ar_EG';
|
import Pagination from 'rc-pagination/lib/locale/ar_EG';
|
||||||
|
|
||||||
import type { Locale } from '.';
|
import type { Locale } from '.';
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-template-curly-in-string */
|
|
||||||
import Pagination from 'rc-pagination/lib/locale/az_AZ';
|
import Pagination from 'rc-pagination/lib/locale/az_AZ';
|
||||||
|
|
||||||
import type { Locale } from '.';
|
import type { Locale } from '.';
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-template-curly-in-string */
|
|
||||||
import Pagination from 'rc-pagination/lib/locale/bn_BD';
|
import Pagination from 'rc-pagination/lib/locale/bn_BD';
|
||||||
|
|
||||||
import type { Locale } from '.';
|
import type { Locale } from '.';
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-template-curly-in-string */
|
|
||||||
import Pagination from 'rc-pagination/lib/locale/by_BY';
|
import Pagination from 'rc-pagination/lib/locale/by_BY';
|
||||||
|
|
||||||
import type { Locale } from '.';
|
import type { Locale } from '.';
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-template-curly-in-string */
|
|
||||||
import Pagination from 'rc-pagination/lib/locale/ca_ES';
|
import Pagination from 'rc-pagination/lib/locale/ca_ES';
|
||||||
|
|
||||||
import type { Locale } from '.';
|
import type { Locale } from '.';
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-template-curly-in-string */
|
|
||||||
import Pagination from 'rc-pagination/lib/locale/cs_CZ';
|
import Pagination from 'rc-pagination/lib/locale/cs_CZ';
|
||||||
|
|
||||||
import type { Locale } from '.';
|
import type { Locale } from '.';
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-template-curly-in-string */
|
|
||||||
import Pagination from 'rc-pagination/lib/locale/de_DE';
|
import Pagination from 'rc-pagination/lib/locale/de_DE';
|
||||||
|
|
||||||
import type { Locale } from '.';
|
import type { Locale } from '.';
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-template-curly-in-string */
|
|
||||||
import Pagination from 'rc-pagination/lib/locale/en_GB';
|
import Pagination from 'rc-pagination/lib/locale/en_GB';
|
||||||
|
|
||||||
import type { Locale } from '.';
|
import type { Locale } from '.';
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-template-curly-in-string */
|
|
||||||
import Pagination from 'rc-pagination/lib/locale/en_US';
|
import Pagination from 'rc-pagination/lib/locale/en_US';
|
||||||
|
|
||||||
import type { Locale } from '.';
|
import type { Locale } from '.';
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-template-curly-in-string */
|
|
||||||
import Pagination from 'rc-pagination/lib/locale/es_ES';
|
import Pagination from 'rc-pagination/lib/locale/es_ES';
|
||||||
|
|
||||||
import type { Locale } from '.';
|
import type { Locale } from '.';
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-template-curly-in-string */
|
|
||||||
import Pagination from 'rc-pagination/lib/locale/et_EE';
|
import Pagination from 'rc-pagination/lib/locale/et_EE';
|
||||||
|
|
||||||
import type { Locale } from '.';
|
import type { Locale } from '.';
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user