Skip to content

Commit

Permalink
chore: remove unused eslintrc
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyongjie committed Jan 5, 2022
1 parent 97a78d3 commit 0eac2ea
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 129 deletions.
26 changes: 7 additions & 19 deletions superset-frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,24 +136,6 @@ module.exports = {
'no-nested-ternary': 0,
'no-prototype-builtins': 0,
'no-restricted-properties': 0,
'no-restricted-imports': [
'warn',
{
paths: [
{
name: 'antd',
message:
'Please import Ant components from the index of common/components',
},
{
name: '@superset-ui/core',
importNames: ['supersetTheme'],
message:
'Please use the theme directly from the ThemeProvider rather than importing supersetTheme.',
},
],
},
],
'no-shadow': 0, // re-enable up for discussion
'no-use-before-define': 0, // disabled temporarily
'padded-blocks': 0,
Expand Down Expand Up @@ -287,14 +269,20 @@ module.exports = {
'no-prototype-builtins': 0,
'no-restricted-properties': 0,
'no-restricted-imports': [
'error',
'warn',
{
paths: [
{
name: 'antd',
message:
'Please import Ant components from the index of common/components',
},
{
name: '@superset-ui/core',
importNames: ['supersetTheme'],
message:
'Please use the theme directly from the ThemeProvider rather than importing supersetTheme.',
},
],
},
],
Expand Down
34 changes: 0 additions & 34 deletions superset-frontend/src/common/components/.eslintrc

This file was deleted.

34 changes: 0 additions & 34 deletions superset-frontend/src/components/.eslintrc

This file was deleted.

31 changes: 0 additions & 31 deletions superset-frontend/src/dashboard/.eslintrc

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ const FilterFocusHighlight = React.forwardRef(
dashboardFilters,
);
const focusedNativeFilterId = nativeFilters.focusedFilterId;
if (!(focusedFilterScope || focusedNativeFilterId))
if (!(focusedFilterScope || focusedNativeFilterId)) {
return <div ref={ref} {...otherProps} />;
}

// we use local styles here instead of a conditionally-applied class,
// because adding any conditional class to this container
Expand Down
25 changes: 15 additions & 10 deletions superset-frontend/src/middleware/asyncEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
import { ensureIsArray, makeApi, SupersetClient } from '@superset-ui/core';
import {
ensureIsArray,
makeApi,
SupersetClient,
logging,
} from '@superset-ui/core';
import { SupersetError } from 'src/components/ErrorMessage/types';
import { FeatureFlag, isFeatureEnabled } from '../featureFlags';
import {
Expand Down Expand Up @@ -82,7 +87,7 @@ export const init = (appConfig?: AppConfig) => {
config = bootstrapData?.common?.conf;
} else {
config = {};
console.warn('asyncEvent: app config data not found');
logging.warn('asyncEvent: app config data not found');
}
}
transport = config.GLOBAL_ASYNC_QUERIES_TRANSPORT || TRANSPORT_POLLING;
Expand All @@ -91,7 +96,7 @@ export const init = (appConfig?: AppConfig) => {
try {
lastReceivedEventId = localStorage.getItem(LOCALSTORAGE_KEY);
} catch (err) {
console.warn('Failed to fetch last event Id from localStorage');
logging.warn('Failed to fetch last event Id from localStorage');
}

if (transport === TRANSPORT_POLLING) {
Expand Down Expand Up @@ -132,7 +137,7 @@ export const waitForAsyncData = async (asyncResponse: AsyncEvent) =>
break;
}
default: {
console.warn('received event with status', asyncEvent.status);
logging.warn('received event with status', asyncEvent.status);
}
}
removeListener(jobId);
Expand Down Expand Up @@ -171,7 +176,7 @@ const setLastId = (asyncEvent: AsyncEvent) => {
try {
localStorage.setItem(LOCALSTORAGE_KEY, lastReceivedEventId as string);
} catch (err) {
console.warn('Error saving event Id to localStorage', err);
logging.warn('Error saving event Id to localStorage', err);
}
};

Expand All @@ -182,7 +187,7 @@ const loadEventsFromApi = async () => {
const { result: events } = await fetchEvents(eventArgs);
if (events && events.length) await processEvents(events);
} catch (err) {
console.warn(err);
logging.warn(err);
}
}

Expand Down Expand Up @@ -210,7 +215,7 @@ export const processEvents = async (events: AsyncEvent[]) => {
}, RETRY_DELAY * retriesByJobId[jobId]);
} else {
delete retriesByJobId[jobId];
console.warn('listener not found for job_id', asyncEvent.job_id);
logging.warn('listener not found for job_id', asyncEvent.job_id);
}
}
setLastId(asyncEvent);
Expand All @@ -229,7 +234,7 @@ const wsConnect = (): void => {
ws = new WebSocket(url);

ws.addEventListener('open', event => {
console.log('WebSocket connected');
logging.log('WebSocket connected');
clearTimeout(wsConnectTimeout);
wsConnectRetries = 0;
});
Expand All @@ -240,7 +245,7 @@ const wsConnect = (): void => {
if (wsConnectRetries <= wsConnectMaxRetries) {
wsConnect();
} else {
console.warn('WebSocket not available, falling back to async polling');
logging.warn('WebSocket not available, falling back to async polling');
loadEventsFromApi();
}
}, wsConnectErrorDelay);
Expand All @@ -257,7 +262,7 @@ const wsConnect = (): void => {
events = [JSON.parse(event.data)];
await processEvents(events);
} catch (err) {
console.warn(err);
logging.warn(err);
}
});
};
Expand Down

0 comments on commit 0eac2ea

Please sign in to comment.