♻️ chore: format code (use npm run format) (#51978)

* chore: update formatter rule

* ♻️ chore: format code (use `npm run format`)
This commit is contained in:
𝑾𝒖𝒙𝒉 2024-12-12 10:22:30 +08:00 committed by GitHub
parent 093380d76b
commit 020176f2b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 24 additions and 23 deletions

View File

@ -65,6 +65,11 @@
} }
} }
}, },
"css": {
"formatter": {
"quoteStyle": "single"
}
},
"overrides": [ "overrides": [
{ {
"include": ["**/*.test.ts", "**/*.test.tsx", "tests/**/*", "scripts/**/*", ".dumi/**/*"], "include": ["**/*.test.ts", "**/*.test.tsx", "tests/**/*", "scripts/**/*", ".dumi/**/*"],

View File

@ -28,22 +28,14 @@ describe('Divider', () => {
}); });
it('support bool dashed', () => { it('support bool dashed', () => {
const { container } = render( const { container } = render(<Divider dashed>test test test</Divider>);
<Divider dashed>
test test test
</Divider>,
);
expect(container?.querySelector<HTMLSpanElement>('.ant-divider-dashed')).toHaveStyle({ expect(container?.querySelector<HTMLSpanElement>('.ant-divider-dashed')).toHaveStyle({
borderStyle: 'dashed', borderStyle: 'dashed',
}); });
}); });
it('support string variant', () => { it('support string variant', () => {
const { container } = render( const { container } = render(<Divider variant="dotted">test dotted</Divider>);
<Divider variant="dotted">
test dotted
</Divider>,
);
expect(container?.querySelector<HTMLSpanElement>('.ant-divider-dotted')).toHaveStyle({ expect(container?.querySelector<HTMLSpanElement>('.ant-divider-dotted')).toHaveStyle({
borderStyle: 'dotted', borderStyle: 'dotted',
}); });

View File

@ -7,17 +7,21 @@ const App: React.FC = () => (
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista
probare, quae sunt a te dicta? Refert tamen, quo modo. probare, quae sunt a te dicta? Refert tamen, quo modo.
</p> </p>
<Divider style={{ borderColor: '#7cb305' }}>Solid</Divider> <Divider style={{ borderColor: '#7cb305' }}>Solid</Divider>
<p> <p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista
probare, quae sunt a te dicta? Refert tamen, quo modo. probare, quae sunt a te dicta? Refert tamen, quo modo.
</p> </p>
<Divider variant="dotted" style={{ borderColor: '#7cb305' }}>Dotted</Divider> <Divider variant="dotted" style={{ borderColor: '#7cb305' }}>
Dotted
</Divider>
<p> <p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista
probare, quae sunt a te dicta? Refert tamen, quo modo. probare, quae sunt a te dicta? Refert tamen, quo modo.
</p> </p>
<Divider variant="dashed" style={{ borderColor: '#7cb305' }} dashed >Dashed</Divider> <Divider variant="dashed" style={{ borderColor: '#7cb305' }} dashed>
Dashed
</Divider>
<p> <p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista
probare, quae sunt a te dicta? Refert tamen, quo modo. probare, quae sunt a te dicta? Refert tamen, quo modo.

View File

@ -116,7 +116,7 @@ describe('FloatButtonGroup', () => {
fireEvent.click(container.querySelector('.ant-float-btn-group')!); fireEvent.click(container.querySelector('.ant-float-btn-group')!);
expect(onClick).toHaveBeenCalled(); expect(onClick).toHaveBeenCalled();
expect(onClick2).not.toHaveBeenCalled(); expect(onClick2).not.toHaveBeenCalled();
}); });
it('warning if set `open` but not set `trigger`', () => { it('warning if set `open` but not set `trigger`', () => {
const warnSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); const warnSpy = jest.spyOn(console, 'error').mockImplementation(() => {});

View File

@ -208,7 +208,7 @@ const OTP = React.forwardRef<OTPRef, OTPProps>((props, ref) => {
const nextCells = patchValue(index, txt); const nextCells = patchValue(index, txt);
const nextIndex = Math.min(index + txt.length, length - 1); const nextIndex = Math.min(index + txt.length, length - 1);
if (nextIndex !== index && nextCells[index] !== undefined) { if (nextIndex !== index && nextCells[index] !== undefined) {
refs.current[nextIndex]?.focus(); refs.current[nextIndex]?.focus();
} }

View File

@ -107,7 +107,7 @@ const InternalItem = React.forwardRef<HTMLDivElement, ListItemProps>((props, ref
}; };
const prefixCls = getPrefixCls('list', customizePrefixCls); const prefixCls = getPrefixCls('list', customizePrefixCls);
const actionsContent = (actions && actions.length > 0) && ( const actionsContent = actions && actions.length > 0 && (
<ul <ul
className={classNames(`${prefixCls}-item-action`, moduleClass('actions'))} className={classNames(`${prefixCls}-item-action`, moduleClass('actions'))}
key="actions" key="actions"

View File

@ -80,7 +80,7 @@ const localeValues: Locale = {
copy: 'Копировать', copy: 'Копировать',
copied: 'Скопировано', copied: 'Скопировано',
expand: 'Раскрыть', expand: 'Раскрыть',
collapse: "Свернуть", collapse: 'Свернуть',
}, },
Form: { Form: {
optional: '(необязательно)', optional: '(необязательно)',
@ -144,7 +144,7 @@ const localeValues: Locale = {
transparent: 'Прозрачный', transparent: 'Прозрачный',
singleColor: 'Один цвет', singleColor: 'Один цвет',
gradientColor: 'Градиент', gradientColor: 'Градиент',
} },
}; };
export default localeValues; export default localeValues;

View File

@ -32,7 +32,7 @@ const localeValues: Locale = {
selectAll: 'Barchasini tanlash', selectAll: 'Barchasini tanlash',
selectInvert: 'Tanlovni aylantirish', selectInvert: 'Tanlovni aylantirish',
selectNone: "Barcha ma'lumotlarni tozalang", selectNone: "Barcha ma'lumotlarni tozalang",
selectionAll: "Barchasini tanlash", selectionAll: 'Barchasini tanlash',
sortTitle: 'Tartiblash', sortTitle: 'Tartiblash',
expand: 'Satirni yozish', expand: 'Satirni yozish',
collapse: "Satirni yig'ish", collapse: "Satirni yig'ish",
@ -47,7 +47,7 @@ const localeValues: Locale = {
}, },
Modal: { Modal: {
okText: 'OK', okText: 'OK',
cancelText: "Yopish", cancelText: 'Yopish',
justOkText: 'OK', justOkText: 'OK',
}, },
Popconfirm: { Popconfirm: {

View File

@ -45,7 +45,7 @@ function addPluginsForProduction(config) {
analyzerMode: 'static', analyzerMode: 'static',
openAnalyzer: false, openAnalyzer: false,
reportFilename: '../report.html', reportFilename: '../report.html',
}) }),
); );
} }
if (newConfig.mode === 'production' && !process.env.PRODUCTION_ONLY) { if (newConfig.mode === 'production' && !process.env.PRODUCTION_ONLY) {
@ -53,7 +53,7 @@ function addPluginsForProduction(config) {
new DuplicatePackageCheckerPlugin({ new DuplicatePackageCheckerPlugin({
verbose: true, verbose: true,
emitError: true, emitError: true,
}) }),
); );
} }
@ -65,7 +65,7 @@ function addPluginsForProduction(config) {
}), }),
new CircularDependencyPlugin({ new CircularDependencyPlugin({
failOnError: true, failOnError: true,
}) }),
); );
return newConfig; return newConfig;