Skip to content

Commit 7179cb0

Browse files
committed
Merge remote-tracking branch 'origin' into rylan/feat/select/filterable
2 parents 7abbf3a + ac7e9e4 commit 7179cb0

1,068 files changed

Lines changed: 15538 additions & 3467 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 76 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ module.exports = {
33
'airbnb-base',
44
'prettier', // eslint-config-prettier 处理冲突
55
'plugin:react/recommended',
6-
'plugin:import/typescript',
76
'plugin:@typescript-eslint/recommended',
87
],
98
parser: '@typescript-eslint/parser',
10-
plugins: ['@typescript-eslint', 'react-hooks'],
9+
plugins: ['@typescript-eslint', 'react-hooks', 'simple-import-sort'],
1110
env: {
1211
browser: true,
1312
node: true,
@@ -27,32 +26,17 @@ module.exports = {
2726
},
2827
},
2928
rules: {
29+
'no-console': [
30+
'warn',
31+
{
32+
allow: ['info', 'warn', 'error'],
33+
},
34+
],
35+
36+
// code style config
37+
'no-param-reassign': 'off',
38+
'guard-for-in': 'off',
3039
'no-use-before-define': 'off',
31-
'@typescript-eslint/explicit-module-boundary-types': 'off',
32-
'@typescript-eslint/ban-types': 'off',
33-
'@typescript-eslint/explicit-function-return-type': 'off',
34-
'@typescript-eslint/indent': ['off', 2],
35-
'@typescript-eslint/ban-ts-comment': 'off',
36-
'@typescript-eslint/camelcase': 'off',
37-
'@typescript-eslint/no-empty-interface': 'error', // codecc
38-
'@typescript-eslint/no-explicit-any': 'off',
39-
'@typescript-eslint/no-use-before-define': ['error', { functions: false }],
40-
'@typescript-eslint/no-var-requires': 'off',
41-
'@typescript-eslint/no-unused-vars': 'error', // codecc
42-
'import/order': 'error',
43-
'import/extensions': 'off',
44-
'import/no-named-as-default': 'off',
45-
'import/prefer-default-export': 'off',
46-
'import/no-extraneous-dependencies': 'off',
47-
'import/no-cycle': 'off', // TODO: turn on this rule later
48-
'import/no-unresolved': 'off', // TODO: turn on this rule later
49-
'react/display-name': 'off',
50-
'react-hooks/exhaustive-deps': 'warn',
51-
'react-hooks/rules-of-hooks': 'error',
52-
'react/prop-types': 'off',
53-
'max-len': 'off',
54-
'no-shadow': 'off',
55-
'no-console': ['warn', { allow: ['warn', 'error'] }],
5640
'no-throw-literal': 'off',
5741
'no-unused-expressions': 'off',
5842
'no-bitwise': 'off',
@@ -68,7 +52,7 @@ module.exports = {
6852
'no-restricted-syntax': 'off',
6953
'no-restricted-globals': 'off',
7054
'no-unneeded-ternary': 'off',
71-
'eol-last': 'error', // codecc
55+
'eol-last': 'error',
7256
'func-names': 'off',
7357
'consistent-return': 'off',
7458
'default-case': 'off',
@@ -83,6 +67,70 @@ module.exports = {
8367
],
8468
},
8569
],
70+
'max-len': 'off',
71+
'no-shadow': 'off',
72+
73+
// import config
74+
'import/order': 'off',
75+
'import/extensions': 'off',
76+
'import/no-named-as-default': 'off',
77+
'import/prefer-default-export': 'off',
78+
'import/no-extraneous-dependencies': 'off',
79+
'import/no-cycle': 'off',
80+
'import/no-unresolved': 'off',
81+
'import/no-relative-packages': 'off',
82+
'simple-import-sort/imports': [
83+
'error',
84+
{
85+
groups: [
86+
// NodeJS 内置模块
87+
[
88+
'^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib)(/.*|$)',
89+
],
90+
// 副作用导入(例如 "dotenv/config"
91+
['^\\u0000'],
92+
// 第三方包
93+
['^react', '^\\w', '^@\\w'],
94+
// 内部路径别名
95+
['^@/'],
96+
// 相对路径
97+
['^\\.'],
98+
// 类型
99+
['^react\\u0000$', '^@?\\w.*\\u0000$', '^@/.*\\u0000$', '^\\..*\\u0000$'],
100+
// css
101+
['\\.css$', '\\.less$'],
102+
],
103+
},
104+
],
105+
'simple-import-sort/exports': 'error',
106+
107+
// typescript config
108+
'@typescript-eslint/explicit-module-boundary-types': 'off',
109+
'@typescript-eslint/ban-types': 'off',
110+
'@typescript-eslint/explicit-function-return-type': 'off',
111+
'@typescript-eslint/indent': ['off', 2],
112+
'@typescript-eslint/ban-ts-comment': 'off',
113+
'@typescript-eslint/camelcase': 'off',
114+
'@typescript-eslint/no-empty-interface': 'error',
115+
'@typescript-eslint/no-explicit-any': 'off',
116+
'@typescript-eslint/no-use-before-define': ['error', { functions: false }],
117+
'@typescript-eslint/no-var-requires': 'off',
118+
'@typescript-eslint/no-unused-vars': 'error',
119+
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
120+
'@typescript-eslint/consistent-type-imports': [
121+
'error',
122+
{
123+
prefer: 'type-imports',
124+
fixStyle: 'separate-type-imports',
125+
disallowTypeAnnotations: false,
126+
},
127+
],
128+
129+
// react config
130+
'react/display-name': 'off',
131+
'react-hooks/exhaustive-deps': 'warn',
132+
'react-hooks/rules-of-hooks': 'error',
133+
'react/prop-types': 'off',
86134
},
87135
overrides: [
88136
{

.github/workflows/issue-synchronize.temp.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/pr-comment-ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ jobs:
7373
- uses: actions/checkout@v4
7474
with:
7575
fetch-depth: 0
76-
token: ${{ secrets.PERSONAL_TOKEN }}
76+
token: ${{ secrets.TDESIGN_BOT_TOKEN }}
7777

7878
- name: gh checkout pr
7979
env:
80-
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
80+
GH_TOKEN: ${{ secrets.TDESIGN_BOT_TOKEN }}
8181
run: gh pr checkout ${{ github.event.issue.number }}
8282

8383
- name: git config
@@ -148,11 +148,11 @@ jobs:
148148
- uses: actions/checkout@v4
149149
with:
150150
fetch-depth: 0
151-
token: ${{ secrets.PERSONAL_TOKEN }}
151+
token: ${{ secrets.TDESIGN_BOT_TOKEN }}
152152

153153
- name: gh checkout pr
154154
env:
155-
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
155+
GH_TOKEN: ${{ secrets.TDESIGN_BOT_TOKEN }}
156156
run: gh pr checkout ${{ github.event.issue.number }} --recurse-submodules
157157

158158
- name: bot commtent
@@ -246,7 +246,7 @@ jobs:
246246
git commit -m "chore: update snapshot"
247247
fi
248248
git status
249-
249+
250250
- name: git push
251251
run: |
252252
git status
@@ -260,11 +260,11 @@ jobs:
260260
- uses: actions/checkout@v4
261261
with:
262262
fetch-depth: 0
263-
token: ${{ secrets.PERSONAL_TOKEN }}
263+
token: ${{ secrets.TDESIGN_BOT_TOKEN }}
264264

265265
- name: gh checkout pr
266266
env:
267-
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
267+
GH_TOKEN: ${{ secrets.TDESIGN_BOT_TOKEN }}
268268
run: gh pr checkout ${{ github.event.issue.number }} --recurse-submodules
269269

270270
- name: git config

.github/workflows/preview-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135
core.setOutput('comment', comment);
136136
137137
- name: comment
138-
uses: actions-cool/maintain-one-comment@v3
138+
uses:TDesignOteam/workflows/actions/maintain-one-comment@main
139139
with:
140140
token: ${{ secrets.TDESIGN_BOT_TOKEN }}
141141
number: ${{needs.preview-context.outputs.pr_id}}

.vscode/settings.json

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
{
22
"typescript.preferences.importModuleSpecifier": "relative",
3-
"eslint.validate": [
4-
"javascript",
5-
"javascriptreact",
6-
"typescript",
7-
"typescriptreact"
8-
],
3+
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
94
"[html]": {
105
"editor.formatOnSave": true,
116
"editor.defaultFormatter": "esbenp.prettier-vscode"
127
},
138
"[typescriptreact]": {
149
"editor.formatOnSave": true,
15-
"editor.defaultFormatter": "esbenp.prettier-vscode"
10+
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
1611
},
1712
"[javascriptreact]": {
1813
"editor.formatOnSave": true,
@@ -76,5 +71,5 @@
7671
"*.xaml": "$(capture).xaml.cs",
7772
"tsconfig.json": "tsconfig.*.json",
7873
"vitest.config.ts": "babel.config.js, postcss.config.js"
79-
},
74+
}
8075
}

globals.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ declare module '*.md?raw';
44

55
// eslint-disable-next-line no-underscore-dangle
66
declare const __VERSION__: string;
7+
8+
declare module '*.css';
9+
declare module '*.scss';
10+
declare module '*.less';

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"site:aigc": "pnpm run build:aigc-jsx-demo && pnpm -C packages/tdesign-react-aigc/site build",
1414
"site:aigc-preview": "pnpm -C packages/tdesign-react-aigc/site preview",
1515
"lint": "pnpm run lint:tsc && eslint --ext .ts,.tsx ./ --max-warnings 0",
16-
"lint:fix": "eslint --ext .ts,.tsx ./packages/components --ignore-pattern packages/components/__tests__ --max-warnings 0 --fix",
16+
"lint:fix": "eslint --ext .ts,.tsx ./packages/components --ignore-pattern ./packages/components/__tests__ --max-warnings 0 --fix",
17+
"lint:aigc-fix": "eslint --ext .ts,.tsx ./packages/pro-components --ignore-pattern ./packages/pro-components/__tests__ --max-warnings 0 --fix",
1718
"lint:tsc": "tsc -p ./tsconfig.dev.json ",
1819
"generate:usage": "node script/generate-usage/index.js",
1920
"generate:coverage-badge": "pnpm run test:coverage && node script/generate-coverage.js",
@@ -103,9 +104,9 @@
103104
"eslint": "^7.32.0",
104105
"eslint-config-airbnb-base": "^14.2.1",
105106
"eslint-config-prettier": "^8.3.0",
106-
"eslint-plugin-import": "^2.22.0",
107107
"eslint-plugin-react": "~7.28.0",
108108
"eslint-plugin-react-hooks": "^4.0.0",
109+
"eslint-plugin-simple-import-sort": "^13.0.0",
109110
"fs-extra": "^11.3.0",
110111
"glob": "^9.0.3",
111112
"husky": "^7.0.4",
@@ -144,7 +145,6 @@
144145
"dependencies": {
145146
"@babel/runtime": "~7.26.7",
146147
"@popperjs/core": "~2.11.2",
147-
"tdesign-react": "workspace:^",
148148
"@tdesign-react/chat": "workspace:^",
149149
"@tdesign/ai-chat-engine": "workspace:^",
150150
"@tdesign/common": "workspace:^",
@@ -153,6 +153,7 @@
153153
"@tdesign/common-style": "workspace:^",
154154
"@tdesign/components": "workspace:^",
155155
"@tdesign/pro-components-chat": "workspace:^",
156-
"@tdesign/react-site": "workspace:^"
156+
"@tdesign/react-site": "workspace:^",
157+
"tdesign-react": "workspace:^"
157158
}
158159
}

packages/components/_util/createHookContext.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import React, { createContext, PropsWithChildren, useContext } from 'react';
1+
import React, { createContext, useContext } from 'react';
2+
3+
import type { PropsWithChildren } from 'react';
24

35
/**
46
* 基于 Hook 创建一个 Context

packages/components/_util/dom.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { isString } from 'lodash-es';
2+
23
import { getCssVarsValue } from './style';
4+
35
import type { AttachNode } from '../common';
46

57
// 用于判断是否可使用 dom

0 commit comments

Comments
 (0)