Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .eslintignore

This file was deleted.

159 changes: 0 additions & 159 deletions .eslintrc.js

This file was deleted.

16 changes: 16 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
snapshot*
dist/
es/
esm/
lib/
cjs/
node_modules/
static/
cypress/
script/test/cypress/
_site/
temp*
packages/common/**
packages/ai-core/**
site/engineering/static/**
packages/**/_example-js/
115 changes: 115 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
import importPlugin from 'eslint-plugin-import';
import reactHooksPlugin from 'eslint-plugin-react-hooks';

import { tdesign } from '@tdesign/eslint-config';

export default tdesign(
{
preset: 'react',
tests: true,
},
{
name: 'tdesign-react/ignores',
ignores: [
'**/dist/**',
'**/es/**',
'**/esm/**',
'**/lib/**',
'**/cjs/**',
'**/_example-js/**',
'**/node_modules/**',
'snapshot*/**',
'static/**',
'cypress/**',
'script/test/cypress/**',
'_site/**',
'temp*/**',
'packages/common/**',
'packages/ai-core/**',
'site/engineering/static/**',
'packages/components/**/type.ts',
],
},
{
name: 'tdesign-react/overrides',
files: ['**/*.{ts,tsx}'],
plugins: { import: importPlugin, 'react-hooks': reactHooksPlugin },
linterOptions: {
reportUnusedDisableDirectives: 'off',
},
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'lodash',
message: 'Please use lodash-es instead.',
},
],
},
],
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-wrapper-object-types': 'off',
'import/first': 'off',
'no-useless-assignment': 'off',
'no-unused-vars': 'off',
'react-refresh/only-export-components': 'off',
'simple-import-sort/exports': 'off',
'simple-import-sort/imports': 'off',
},
},
{
name: 'tdesign-react/hooks',
files: ['**/*.tsx'],
rules: {
'react-hooks/component-hook-factories': 'off',
'react-hooks/error-boundaries': 'off',
'react-hooks/exhaustive-deps': 'warn',
'react-hooks/globals': 'off',
'react-hooks/immutability': 'off',
'react-hooks/incompatible-library': 'off',
'react-hooks/preserve-manual-memoization': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/purity': 'off',
'react-hooks/refs': 'off',
'react-hooks/set-state-in-render': 'off',
'react-hooks/set-state-in-effect': 'off',
'react-hooks/static-components': 'off',
'react-hooks/unsupported-syntax': 'off',
'react-hooks/use-memo': 'off',
'react-hooks/void-use-memo': 'off',
},
},
{
name: 'tdesign-react/test-overrides',
files: ['**/_usage/**/*', '**/_example/**/*', '**/__tests__/**/*'],
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'no-unused-vars': 'off',
'simple-import-sort/imports': 'off',
},
},
{
name: 'tdesign-react/test-hook-overrides',
files: ['**/_usage/**/*.tsx', '**/_example/**/*.tsx', '**/__tests__/**/*.tsx'],
rules: {
'react-hooks/exhaustive-deps': 'off',
'react-hooks/immutability': 'off',
'react-hooks/set-state-in-effect': 'off',
},
},
{
name: 'tdesign-react/example-overrides',
files: ['**/_example/**/*', '**/__tests__/**/*'],
rules: {
'no-console': 'off',
},
},
);
19 changes: 8 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"dev:aigc": "pnpm run build:aigc-jsx-demo && pnpm -C packages/tdesign-react-aigc/site dev",
"site:aigc": "pnpm run build:aigc-jsx-demo && pnpm -C packages/tdesign-react-aigc/site build",
"site:aigc-preview": "pnpm -C packages/tdesign-react-aigc/site preview",
"lint": "pnpm run lint:tsc && eslint --ext .ts,.tsx ./ --max-warnings 0",
"lint:fix": "eslint --ext .ts,.tsx ./packages/components --ignore-pattern ./packages/components/__tests__ --max-warnings 0 --fix",
"lint:aigc-fix": "eslint --ext .ts,.tsx ./packages/pro-components --ignore-pattern ./packages/pro-components/__tests__ --max-warnings 0 --fix",
"lint": "pnpm run lint:tsc && eslint \"**/*.{ts,tsx}\" --max-warnings 0",
"lint:fix": "eslint \"packages/components/**/*.{ts,tsx}\" --ignore-pattern ./packages/components/__tests__ --max-warnings 0 --fix",
"lint:aigc-fix": "eslint \"packages/pro-components/**/*.{ts,tsx}\" --ignore-pattern ./packages/pro-components/__tests__ --max-warnings 0 --fix",
"lint:tsc": "tsc -p ./tsconfig.dev.json ",
"generate:usage": "node script/generate-usage/index.js",
"generate:coverage-badge": "pnpm run test:coverage && node script/generate-coverage.js",
Expand Down Expand Up @@ -88,8 +88,8 @@
"@types/react-dom": "^18.2.0",
"@types/rimraf": "^4.0.5",
"@types/testing-library__jest-dom": "5.14.2",
"@typescript-eslint/eslint-plugin": "^5.13.0",
"@typescript-eslint/parser": "^5.13.0",
"@tdesign/eslint-config": "https://pkg.pr.new/TDesignOteam/eslint-prettier-config/@tdesign/eslint-config@c21e4ff",
"@tdesign/prettier-config": "https://pkg.pr.new/TDesignOteam/eslint-prettier-config/@tdesign/prettier-config@c21e4ff",
"@vitejs/plugin-react": "^5.1.1",
"@vitest/coverage-istanbul": "^2.1.1",
"@vitest/coverage-v8": "^2.1.1",
Expand All @@ -101,12 +101,9 @@
"cz-conventional-changelog": "^3.3.0",
"dom-parser": "^0.1.6",
"esbuild": "^0.14.9",
"eslint": "^7.32.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "~7.28.0",
"eslint-plugin-react-hooks": "^4.0.0",
"eslint-plugin-simple-import-sort": "^13.0.0",
"eslint": "^10.5.0",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-react-hooks": "7.1.1",
"fs-extra": "^11.3.0",
"glob": "^9.0.3",
"husky": "^7.0.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/common
Submodule common updated 50 files
+0 −8 .eslintignore
+0 −92 .eslintrc.js
+5 −5 .github/workflows/component-ci.yml
+1 −1 .github/workflows/pull-request.yml
+0 −24 .prettierrc.js
+58 −0 eslint.config.mjs
+1 −1 js/color-picker/color.ts
+1 −1 js/color-picker/format.ts
+2 −2 js/color-picker/gradient.ts
+1 −0 js/components.ts
+6 −6 js/date-picker/format.ts
+7 −7 js/date-picker/utils.ts
+5 −0 js/global-config/mobile/locale/ar_KW.ts
+6 −0 js/global-config/mobile/locale/en_US.ts
+5 −0 js/global-config/mobile/locale/it_IT.ts
+5 −0 js/global-config/mobile/locale/ja_JP.ts
+5 −0 js/global-config/mobile/locale/ko_KR.ts
+5 −0 js/global-config/mobile/locale/ru_RU.ts
+5 −0 js/global-config/mobile/locale/zh_CN.ts
+5 −0 js/global-config/mobile/locale/zh_TW.ts
+3 −3 js/image-viewer/transform.ts
+2 −2 js/input-number/large-number.ts
+2 −2 js/input-number/number.ts
+3 −3 js/qrcode/qrcodegen.ts
+1 −1 js/qrcode/utils.ts
+10 −10 js/table/tree-store.ts
+2 −2 js/table/utils.ts
+1 −1 js/tree-select/utils.ts
+8 −8 js/upload/main.ts
+1 −1 js/utils/calcTextareaHeight.ts
+1 −1 js/utils/general.ts
+1 −1 js/utils/getPosition.ts
+2 −2 js/utils/observe.ts
+3 −3 js/watermark/generateBase64Url.ts
+5 −11 package.json
+1 −0 prettier.config.mjs
+17 −39 scripts/generate-css-vars.mjs
+3 −0 style/mobile/components/search/_index.less
+54 −2 style/mobile/components/table/_index.less
+21 −0 style/mobile/components/table/_pagination.less
+1 −1 style/mobile/components/table/_var.less
+25 −2 style/mobile/components/upload/_index.less
+0 −1 style/web/_reset.less
+1 −1 style/web/components/button/_index.less
+0 −1 style/web/components/button/_mixin.less
+5 −1 style/web/components/color-picker/_index.less
+8 −8 test/unit/input-number/number.test.js
+1 −1 test/unit/locale/locale.test.ts
+1 −1 test/unit/upload/utils.test.js
+1 −1 test/unit/utils/calcTextareaHeight.test.ts
2 changes: 1 addition & 1 deletion packages/components/_util/parseTNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function parseContentTNode<T>(tnode: TNode<T>, props: T) {
if (!tnode || ['string', 'number', 'boolean'].includes(typeof tnode)) return tnode as ReactNode;
try {
return React.cloneElement(tnode as ReactElement, { ...props });
} catch (e) {
} catch {
log.warn('parseContentTNode', `${tnode} is not a valid ReactNode`);
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/components/_util/react-render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ try {
if (mainVersion >= 18 && mainVersion < 19) {
legacyCreateRoot = fullClone.createRoot;
}
} catch (e) {
} catch {
// Do nothing;
}

Expand Down
1 change: 0 additions & 1 deletion packages/components/config-provider/_example/global.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react/no-unescaped-entities */
import React from 'react';
import { ConfigProvider, Space } from 'tdesign-react';
import enConfig from 'tdesign-react/es/locale/en_US';
Expand Down
Loading
Loading