chore(frontend): Consolidate ESLint configurations in superset-frontend (#35318)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Evan Rusackas
2025-09-29 23:52:25 -07:00
committed by GitHub
parent 4e093a8e2a
commit 7deed00def
11 changed files with 109 additions and 233 deletions

View File

@@ -19,7 +19,7 @@
import { mergeReplaceArrays } from '@superset-ui/core';
describe('Theme Override Deep Merge Behavior', () => {
test('should merge nested objects correctly', () => {
it('should merge nested objects correctly', () => {
const baseOptions = {
grid: {
left: '5%',
@@ -67,7 +67,7 @@ describe('Theme Override Deep Merge Behavior', () => {
});
});
test('should replace arrays instead of merging them', () => {
it('should replace arrays instead of merging them', () => {
const baseOptions = {
series: [
{ name: 'Series 1', type: 'line' },
@@ -86,7 +86,7 @@ describe('Theme Override Deep Merge Behavior', () => {
expect(result.series).toHaveLength(1);
});
test('should handle null overrides correctly', () => {
it('should handle null overrides correctly', () => {
const baseOptions = {
grid: {
left: '5%',
@@ -127,7 +127,7 @@ describe('Theme Override Deep Merge Behavior', () => {
});
});
test('should handle override precedence correctly', () => {
it('should handle override precedence correctly', () => {
const baseTheme = {
textStyle: { color: '#000', fontSize: 12 },
};
@@ -167,7 +167,7 @@ describe('Theme Override Deep Merge Behavior', () => {
});
});
test('should preserve deep nested structures', () => {
it('should preserve deep nested structures', () => {
const baseOptions = {
xAxis: {
axisLabel: {
@@ -215,7 +215,7 @@ describe('Theme Override Deep Merge Behavior', () => {
});
});
test('should handle function values correctly', () => {
it('should handle function values correctly', () => {
const formatFunction = (value: any) => `${value}%`;
const overrideFunction = (value: any) => `$${value}`;
@@ -241,7 +241,7 @@ describe('Theme Override Deep Merge Behavior', () => {
expect(result.yAxis.axisLabel.formatter('100')).toBe('$100');
});
test('should handle empty objects and arrays', () => {
it('should handle empty objects and arrays', () => {
const baseOptions = {
series: [{ name: 'Test', data: [1, 2, 3] }],
grid: { left: '5%' },

View File

@@ -117,7 +117,7 @@ const chartPropsConfig = {
theme: supersetTheme,
};
it('should transform chart props for viz with showQueryIdentifiers=false', () => {
test('should transform chart props for viz with showQueryIdentifiers=false', () => {
const chartPropsConfigWithoutIdentifiers = {
...chartPropsConfig,
formData: {
@@ -158,7 +158,7 @@ it('should transform chart props for viz with showQueryIdentifiers=false', () =>
]);
});
it('should transform chart props for viz with showQueryIdentifiers=true', () => {
test('should transform chart props for viz with showQueryIdentifiers=true', () => {
const chartPropsConfigWithIdentifiers = {
...chartPropsConfig,
formData: {
@@ -259,7 +259,7 @@ describe('legend sorting', () => {
});
});
it('legend margin: top orientation sets grid.top correctly', () => {
test('legend margin: top orientation sets grid.top correctly', () => {
const chartPropsConfigWithoutIdentifiers = {
...chartPropsConfig,
formData: {
@@ -274,7 +274,7 @@ it('legend margin: top orientation sets grid.top correctly', () => {
expect((transformed.echartOptions.grid as any).top).toEqual(270);
});
it('legend margin: bottom orientation sets grid.bottom correctly', () => {
test('legend margin: bottom orientation sets grid.bottom correctly', () => {
const chartPropsConfigWithoutIdentifiers = {
...chartPropsConfig,
formData: {
@@ -290,7 +290,7 @@ it('legend margin: bottom orientation sets grid.bottom correctly', () => {
expect((transformed.echartOptions.grid as any).bottom).toEqual(270);
});
it('legend margin: left orientation sets grid.left correctly', () => {
test('legend margin: left orientation sets grid.left correctly', () => {
const chartPropsConfigWithoutIdentifiers = {
...chartPropsConfig,
formData: {
@@ -306,7 +306,7 @@ it('legend margin: left orientation sets grid.left correctly', () => {
expect((transformed.echartOptions.grid as any).left).toEqual(270);
});
it('legend margin: right orientation sets grid.right correctly', () => {
test('legend margin: right orientation sets grid.right correctly', () => {
const chartPropsConfigWithoutIdentifiers = {
...chartPropsConfig,
formData: {

View File

@@ -32,7 +32,7 @@ const mockColorScale = jest.fn(
describe('transformSeries', () => {
const series = { name: 'test-series' };
test('should use the colorScaleKey if timeShiftColor is enabled', () => {
it('should use the colorScaleKey if timeShiftColor is enabled', () => {
const opts = {
timeShiftColor: true,
colorScaleKey: 'test-key',
@@ -44,7 +44,7 @@ describe('transformSeries', () => {
expect((result as any)?.itemStyle.color).toBe('color-for-test-key-1');
});
test('should use seriesKey if timeShiftColor is not enabled', () => {
it('should use seriesKey if timeShiftColor is not enabled', () => {
const opts = {
timeShiftColor: false,
seriesKey: 'series-key',
@@ -56,7 +56,7 @@ describe('transformSeries', () => {
expect((result as any)?.itemStyle.color).toBe('color-for-series-key-2');
});
test('should apply border styles for bar series with connectNulls', () => {
it('should apply border styles for bar series with connectNulls', () => {
const opts = {
seriesType: EchartsTimeseriesSeriesType.Bar,
connectNulls: true,
@@ -72,7 +72,7 @@ describe('transformSeries', () => {
);
});
test('should not apply border styles for non-bar series', () => {
it('should not apply border styles for non-bar series', () => {
const opts = {
seriesType: EchartsTimeseriesSeriesType.Line,
connectNulls: true,
@@ -88,7 +88,7 @@ describe('transformSeries', () => {
});
describe('transformNegativeLabelsPosition', () => {
test('label position bottom of negative value no Horizontal', () => {
it('label position bottom of negative value no Horizontal', () => {
const isHorizontal = false;
const series: SeriesOption = {
data: [
@@ -112,7 +112,7 @@ describe('transformNegativeLabelsPosition', () => {
expect((result as any)[4].label).toBe(undefined);
});
test('label position left of negative value is Horizontal', () => {
it('label position left of negative value is Horizontal', () => {
const isHorizontal = true;
const series: SeriesOption = {
data: [
@@ -137,7 +137,7 @@ describe('transformNegativeLabelsPosition', () => {
expect((result as any)[4].label.position).toBe('outside');
});
test('label position to line type', () => {
it('label position to line type', () => {
const isHorizontal = false;
const series: SeriesOption = {
data: [
@@ -165,7 +165,7 @@ describe('transformNegativeLabelsPosition', () => {
expect((result as any)[4].label).toBe(undefined);
});
test('label position to bar type and stack', () => {
it('label position to bar type and stack', () => {
const isHorizontal = false;
const series: SeriesOption = {
data: [