chore(lint): migrate Jest lint rules from eslint to oxlint (#37787)

Signed-off-by: hainenber <dotronghai96@gmail.com>
This commit is contained in:
Đỗ Trọng Hải
2026-02-08 16:44:42 +07:00
committed by GitHub
parent c4d2d42b3b
commit 563d9f1a3f
264 changed files with 1893 additions and 1952 deletions

View File

@@ -59,7 +59,7 @@ describe('Pie transformProps', () => {
theme: supersetTheme,
});
it('should transform chart props for viz', () => {
test('should transform chart props for viz', () => {
expect(transformProps(chartProps as EchartsPieChartProps)).toEqual(
expect.objectContaining({
width: 800,
@@ -87,7 +87,7 @@ describe('Pie transformProps', () => {
});
describe('formatPieLabel', () => {
it('should generate a valid pie chart label', () => {
test('should generate a valid pie chart label', () => {
const numberFormatter = getNumberFormatter();
const params = { name: 'My Label', value: 1234, percent: 12.34 };
expect(
@@ -191,7 +191,7 @@ describe('Pie label string template', () => {
return (formatter as LabelFormatterCallback)(params);
};
it('should generate a valid pie chart label with template', () => {
test('should generate a valid pie chart label with template', () => {
expect(
format({
label_type: 'template',
@@ -200,7 +200,7 @@ describe('Pie label string template', () => {
).toEqual('Tablet:123k\n55.50%');
});
it('should be formatted using the number formatter', () => {
test('should be formatted using the number formatter', () => {
expect(
format({
label_type: 'template',
@@ -210,7 +210,7 @@ describe('Pie label string template', () => {
).toEqual('Tablet:123,456\n55.50%');
});
it('should be compatible with ECharts raw variable syntax', () => {
test('should be compatible with ECharts raw variable syntax', () => {
expect(
format({
label_type: 'template',
@@ -257,7 +257,7 @@ describe('Total value positioning with legends', () => {
}) as EchartsPieChartProps;
};
it('should center total text when legend is on the right', () => {
test('should center total text when legend is on the right', () => {
const props = getChartPropsWithLegend(true, true, 'right', true);
const transformed = transformProps(props);
@@ -280,7 +280,7 @@ describe('Total value positioning with legends', () => {
expect(leftValue).toBeGreaterThan(30); // Should be reasonable positioning
});
it('should center total text when legend is on the left', () => {
test('should center total text when legend is on the left', () => {
const props = getChartPropsWithLegend(true, true, 'left', true);
const transformed = transformProps(props);
@@ -300,7 +300,7 @@ describe('Total value positioning with legends', () => {
expect(leftValue).toBeLessThan(70); // Should be reasonable positioning
});
it('should center total text when legend is on top', () => {
test('should center total text when legend is on top', () => {
const props = getChartPropsWithLegend(true, true, 'top', true);
const transformed = transformProps(props);
@@ -319,7 +319,7 @@ describe('Total value positioning with legends', () => {
expect(topValue).toBeGreaterThan(50); // Shifted down for top legend
});
it('should center total text when legend is on bottom', () => {
test('should center total text when legend is on bottom', () => {
const props = getChartPropsWithLegend(true, true, 'bottom', true);
const transformed = transformProps(props);
@@ -338,7 +338,7 @@ describe('Total value positioning with legends', () => {
expect(topValue).toBeLessThan(50); // Shifted up for bottom legend
});
it('should use default positioning when no legend is shown', () => {
test('should use default positioning when no legend is shown', () => {
const props = getChartPropsWithLegend(true, false, 'right', true);
const transformed = transformProps(props);
@@ -351,7 +351,7 @@ describe('Total value positioning with legends', () => {
);
});
it('should handle regular pie chart (non-donut) positioning', () => {
test('should handle regular pie chart (non-donut) positioning', () => {
const props = getChartPropsWithLegend(true, true, 'right', false);
const transformed = transformProps(props);
@@ -364,7 +364,7 @@ describe('Total value positioning with legends', () => {
);
});
it('should not show total graphic when showTotal is false', () => {
test('should not show total graphic when showTotal is false', () => {
const props = getChartPropsWithLegend(false, true, 'right', true);
const transformed = transformProps(props);
@@ -429,7 +429,7 @@ describe('Other category', () => {
theme: supersetTheme,
});
it('generates Other category', () => {
test('generates Other category', () => {
const chartProps = getChartProps({
threshold_for_other: 20,
});
@@ -500,7 +500,7 @@ describe('legend sorting', () => {
theme: supersetTheme,
});
it('sort legend by data', () => {
test('sort legend by data', () => {
const chartProps = getChartProps({
legendSort: null,
});
@@ -515,7 +515,7 @@ describe('legend sorting', () => {
]);
});
it('sort legend by label ascending', () => {
test('sort legend by label ascending', () => {
const chartProps = getChartProps({
legendSort: 'asc',
});
@@ -530,7 +530,7 @@ describe('legend sorting', () => {
]);
});
it('sort legend by label descending', () => {
test('sort legend by label descending', () => {
const chartProps = getChartProps({
legendSort: 'desc',
});