Skip to content

Commit

Permalink
♻️ chore: format code (use npm run format) (ant-design#51978)
Browse files Browse the repository at this point in the history
* chore: update formatter rule

* ♻️ chore: format code (use `npm run format`)
  • Loading branch information
Wxh16144 authored Dec 12, 2024
1 parent 093380d commit 020176f
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 23 deletions.
5 changes: 5 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
}
}
},
"css": {
"formatter": {
"quoteStyle": "single"
}
},
"overrides": [
{
"include": ["**/*.test.ts", "**/*.test.tsx", "tests/**/*", "scripts/**/*", ".dumi/**/*"],
Expand Down
12 changes: 2 additions & 10 deletions components/divider/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,14 @@ describe('Divider', () => {
});

it('support bool dashed', () => {
const { container } = render(
<Divider dashed>
test test test
</Divider>,
);
const { container } = render(<Divider dashed>test test test</Divider>);
expect(container?.querySelector<HTMLSpanElement>('.ant-divider-dashed')).toHaveStyle({
borderStyle: 'dashed',
});
});

it('support string variant', () => {
const { container } = render(
<Divider variant="dotted">
test dotted
</Divider>,
);
const { container } = render(<Divider variant="dotted">test dotted</Divider>);
expect(container?.querySelector<HTMLSpanElement>('.ant-divider-dotted')).toHaveStyle({
borderStyle: 'dotted',
});
Expand Down
10 changes: 7 additions & 3 deletions components/divider/demo/variant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@ const App: React.FC = () => (
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista
probare, quae sunt a te dicta? Refert tamen, quo modo.
</p>
<Divider style={{ borderColor: '#7cb305' }}>Solid</Divider>
<Divider style={{ borderColor: '#7cb305' }}>Solid</Divider>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista
probare, quae sunt a te dicta? Refert tamen, quo modo.
</p>
<Divider variant="dotted" style={{ borderColor: '#7cb305' }}>Dotted</Divider>
<Divider variant="dotted" style={{ borderColor: '#7cb305' }}>
Dotted
</Divider>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista
probare, quae sunt a te dicta? Refert tamen, quo modo.
</p>
<Divider variant="dashed" style={{ borderColor: '#7cb305' }} dashed >Dashed</Divider>
<Divider variant="dashed" style={{ borderColor: '#7cb305' }} dashed>
Dashed
</Divider>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista
probare, quae sunt a te dicta? Refert tamen, quo modo.
Expand Down
2 changes: 1 addition & 1 deletion components/float-button/__tests__/group.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe('FloatButtonGroup', () => {
fireEvent.click(container.querySelector('.ant-float-btn-group')!);
expect(onClick).toHaveBeenCalled();
expect(onClick2).not.toHaveBeenCalled();
});
});

it('warning if set `open` but not set `trigger`', () => {
const warnSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
Expand Down
2 changes: 1 addition & 1 deletion components/input/OTP/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ const OTP = React.forwardRef<OTPRef, OTPProps>((props, ref) => {
const nextCells = patchValue(index, txt);

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();
}

Expand Down
2 changes: 1 addition & 1 deletion components/list/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const InternalItem = React.forwardRef<HTMLDivElement, ListItemProps>((props, ref
};

const prefixCls = getPrefixCls('list', customizePrefixCls);
const actionsContent = (actions && actions.length > 0) && (
const actionsContent = actions && actions.length > 0 && (
<ul
className={classNames(`${prefixCls}-item-action`, moduleClass('actions'))}
key="actions"
Expand Down
4 changes: 2 additions & 2 deletions components/locale/ru_RU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const localeValues: Locale = {
copy: 'Копировать',
copied: 'Скопировано',
expand: 'Раскрыть',
collapse: "Свернуть",
collapse: 'Свернуть',
},
Form: {
optional: '(необязательно)',
Expand Down Expand Up @@ -144,7 +144,7 @@ const localeValues: Locale = {
transparent: 'Прозрачный',
singleColor: 'Один цвет',
gradientColor: 'Градиент',
}
},
};

export default localeValues;
4 changes: 2 additions & 2 deletions components/locale/uz_UZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const localeValues: Locale = {
selectAll: 'Barchasini tanlash',
selectInvert: 'Tanlovni aylantirish',
selectNone: "Barcha ma'lumotlarni tozalang",
selectionAll: "Barchasini tanlash",
selectionAll: 'Barchasini tanlash',
sortTitle: 'Tartiblash',
expand: 'Satirni yozish',
collapse: "Satirni yig'ish",
Expand All @@ -47,7 +47,7 @@ const localeValues: Locale = {
},
Modal: {
okText: 'OK',
cancelText: "Yopish",
cancelText: 'Yopish',
justOkText: 'OK',
},
Popconfirm: {
Expand Down
6 changes: 3 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ function addPluginsForProduction(config) {
analyzerMode: 'static',
openAnalyzer: false,
reportFilename: '../report.html',
})
}),
);
}
if (newConfig.mode === 'production' && !process.env.PRODUCTION_ONLY) {
newConfig.plugins.push(
new DuplicatePackageCheckerPlugin({
verbose: true,
emitError: true,
})
}),
);
}

Expand All @@ -65,7 +65,7 @@ function addPluginsForProduction(config) {
}),
new CircularDependencyPlugin({
failOnError: true,
})
}),
);

return newConfig;
Expand Down

0 comments on commit 020176f

Please sign in to comment.