Skip to content

Commit

Permalink
chore: upgrade eslint, babel, and prettier (#12393)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmud authored Jan 11, 2021
1 parent 6bee3a0 commit 9acf48f
Show file tree
Hide file tree
Showing 69 changed files with 4,862 additions and 2,263 deletions.
2 changes: 2 additions & 0 deletions superset-frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ module.exports = {
'react/no-unused-prop-types': 0,
'react/prop-types': 0,
'react/require-default-props': 0,
'react/sort-comp': 0, // TODO: re-enable in separate PR
'react/static-property-placement': 0, // re-enable up for discussion
'prettier/prettier': 'error',
},
Expand Down Expand Up @@ -246,6 +247,7 @@ module.exports = {
'react/no-unused-prop-types': 0,
'react/prop-types': 0,
'react/require-default-props': 0,
'react/sort-comp': 0, // TODO: re-enable in separate PR
'react/static-property-placement': 0, // disabled temporarily
'prettier/prettier': 'error',
},
Expand Down
5 changes: 3 additions & 2 deletions superset-frontend/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ module.exports = {
plugins: [
'lodash',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-optional-chaining',
['@babel/plugin-proposal-class-properties', { loose: true }],
['@babel/plugin-proposal-optional-chaining', { loose: true }],
['@babel/plugin-proposal-private-methods', { loose: true }],
['@babel/plugin-transform-runtime', { corejs: 3 }],
'react-hot-loader/babel',
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ describe('Dashboard filter', () => {
let filterId: number;
let aliases: string[];

const getAlias = (id: number) => {
return `@${DASHBOARD_CHART_ALIAS_PREFIX}${id}`;
};
const getAlias = (id: number) => `@${DASHBOARD_CHART_ALIAS_PREFIX}${id}`;

beforeEach(() => {
cy.server();
Expand Down Expand Up @@ -87,8 +85,8 @@ describe('Dashboard filter', () => {
});

cy.get('.filter_box button').click({ force: true });
cy.wait(aliases.filter(x => x !== getAlias(filterId))).then(requests => {
return Promise.all(
cy.wait(aliases.filter(x => x !== getAlias(filterId))).then(requests =>
Promise.all(
requests.map(async xhr => {
expect(xhr.status).to.eq(200);
const responseBody = await readResponseBlob(xhr.response.body);
Expand All @@ -108,8 +106,8 @@ describe('Dashboard filter', () => {
val: 'South Asia',
});
}),
);
});
),
);

// TODO add test with South Asia{enter} type action to select filter
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ describe('Dashboard load', () => {

it('should load dashboard', () => {
// wait and verify one-by-one
cy.wait(aliases).then(requests => {
return Promise.all(
cy.wait(aliases).then(requests =>
Promise.all(
requests.map(async xhr => {
expect(xhr.status).to.eq(200);
const responseBody = await readResponseBlob(xhr.response.body);
Expand All @@ -65,7 +65,7 @@ describe('Dashboard load', () => {
.find(`#chart-id-${sliceId}`)
.should('be.visible');
}),
);
});
),
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ describe('Dashboard form data', () => {
it('should apply url params to slice requests', () => {
const aliases = getChartAliases(dashboard.slices);
// wait and verify one-by-one
cy.wait(aliases).then(requests => {
return Promise.all(
cy.wait(aliases).then(requests =>
Promise.all(
requests.map(async xhr => {
expect(xhr.status).to.eq(200);
const responseBody = await readResponseBlob(xhr.response.body);
Expand All @@ -55,7 +55,7 @@ describe('Dashboard form data', () => {
});
}
}),
);
});
),
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ import rison from 'rison';
import shortid from 'shortid';
import { HEALTH_POP_FORM_DATA_DEFAULTS } from './visualizations/shared.helper';

const apiURL = (endpoint, queryObject) => {
return `${endpoint}?q=${rison.encode(queryObject)}`;
};
const apiURL = (endpoint, queryObject) =>
`${endpoint}?q=${rison.encode(queryObject)}`;

describe('Test explore links', () => {
beforeEach(() => {
Expand Down
6 changes: 3 additions & 3 deletions superset-frontend/cypress-base/cypress/support/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ Cypress.Commands.add('visitChartByName', name => {
});
});

Cypress.Commands.add('visitChartById', chartId => {
return cy.visit(`${BASE_EXPLORE_URL}{"slice_id": ${chartId}}`);
});
Cypress.Commands.add('visitChartById', chartId =>
cy.visit(`${BASE_EXPLORE_URL}{"slice_id": ${chartId}}`),
);

Cypress.Commands.add('visitChartByParams', params => {
const queryString =
Expand Down
Loading

0 comments on commit 9acf48f

Please sign in to comment.