mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
test: support react 16 lint (#46963)
* feat: support react 16 lint * feat: test * feat: test * feat: test * feat: test * feat: 不增加 package script
This commit is contained in:
parent
c50f6f6b7d
commit
7e877dc799
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
@ -73,6 +73,12 @@ jobs:
|
||||
|
||||
- name: lint
|
||||
run: npm run lint
|
||||
|
||||
- name: lint:react-16
|
||||
run: npm run compile && npm run install-react-16 && npm run tsc:old
|
||||
|
||||
- name: lint:react-17
|
||||
run: npm run compile && npm run install-react-17 && npm run tsc:old
|
||||
needs: setup
|
||||
|
||||
check_metadata:
|
||||
|
@ -2,9 +2,9 @@ import React from 'react';
|
||||
import { PoweroffOutlined } from '@ant-design/icons';
|
||||
import { Button, Flex } from 'antd';
|
||||
|
||||
const Text1 = () => '部署';
|
||||
const Text1 = () => <>部署</>;
|
||||
const Text2 = () => <span>部署</span>;
|
||||
const Text3 = () => 'Submit';
|
||||
const Text3 = () => <>Submit</>;
|
||||
|
||||
const App: React.FC = () => (
|
||||
<Flex wrap="wrap" gap="small">
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { useState } from 'react';
|
||||
import { Button, ConfigProvider, Drawer, Space } from 'antd';
|
||||
import { createStyles, useTheme } from 'antd-style';
|
||||
import type { DrawerClassNames, DrawerStyles } from '../DrawerPanel';
|
||||
import type { DrawerClassNames, DrawerStyles } from 'antd/es/drawer/DrawerPanel';
|
||||
|
||||
const useStyle = createStyles(({ token }) => ({
|
||||
'my-drawer-body': {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { AudioOutlined } from '@ant-design/icons';
|
||||
import React from 'react';
|
||||
import { AudioOutlined } from '@ant-design/icons';
|
||||
import { Input, Space } from 'antd';
|
||||
import type { SearchProps } from '../Search';
|
||||
import type { SearchProps } from 'antd/es/input/Search';
|
||||
|
||||
const { Search } = Input;
|
||||
|
||||
|
@ -2,11 +2,9 @@ import React, { useRef, useState } from 'react';
|
||||
import { SearchOutlined } from '@ant-design/icons';
|
||||
import type { GetRef, TableColumnsType, TableColumnType } from 'antd';
|
||||
import { Button, Input, Space, Table } from 'antd';
|
||||
import type { FilterDropdownProps } from 'antd/es/table/interface';
|
||||
import Highlighter from 'react-highlight-words';
|
||||
|
||||
type FilterDropdownType = Exclude<TableColumnType<DataType>['filterDropdown'], React.ReactNode>;
|
||||
type FilterConfirmProps = Parameters<FilterDropdownType>[0]['confirm'];
|
||||
|
||||
type InputRef = GetRef<typeof Input>;
|
||||
|
||||
interface DataType {
|
||||
@ -52,7 +50,7 @@ const App: React.FC = () => {
|
||||
|
||||
const handleSearch = (
|
||||
selectedKeys: string[],
|
||||
confirm: FilterConfirmProps,
|
||||
confirm: FilterDropdownProps['confirm'],
|
||||
dataIndex: DataIndex,
|
||||
) => {
|
||||
confirm();
|
||||
|
@ -100,6 +100,7 @@
|
||||
"test:update": "jest --config .jest.js --no-cache -u",
|
||||
"token-meta": "tsx scripts/generate-token-meta.ts",
|
||||
"tsc": "tsc --noEmit",
|
||||
"tsc:old": "tsc --noEmit -p tsconfig-old-react.json",
|
||||
"version": "tsx scripts/generate-version.ts",
|
||||
"visual-regression": "tsx scripts/visual-regression/build.ts",
|
||||
"npm-install": "npm install"
|
||||
|
12
tsconfig-old-react.json
Normal file
12
tsconfig-old-react.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"paths": {
|
||||
"antd": ["es"],
|
||||
"antd/es/*": ["es/*"],
|
||||
"antd/lib/*": ["lib/*"],
|
||||
"antd/locale/*": ["locale/*"]
|
||||
}
|
||||
},
|
||||
"include": ["components/*/demo/*.tsx"]
|
||||
}
|
Loading…
Reference in New Issue
Block a user