Skip to content

Commit

Permalink
Fix linting errors in frontend.
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Jan 24, 2025
1 parent 8f99c34 commit b129737
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
5 changes: 1 addition & 4 deletions superset-frontend/src/components/Chart/chartAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ import { Logger, LOG_ACTIONS_LOAD_CHART } from 'src/logger/LogUtils';
import { allowCrossDomain as domainShardingEnabled } from 'src/utils/hostNamesConfig';
import { updateDataMask } from 'src/dataMask/actions';
import { waitForAsyncData } from 'src/middleware/asyncEvent';
import {
ensureAppRootSanitized,
ensureAppRootUnsanitized,
} from 'src/utils/pathUtils';
import { ensureAppRootUnsanitized } from 'src/utils/pathUtils';
import { safeStringify } from 'src/utils/safeStringify';
import { extendedDayjs } from 'src/utils/dates';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const publishDataMask = debounce(
// double it up.
const appRoot = applicationRoot();
let replacement_pathname = window.location.pathname;
if (appRoot != '/' && replacement_pathname.startsWith(appRoot)) {
if (appRoot !== '/' && replacement_pathname.startsWith(appRoot)) {
replacement_pathname = replacement_pathname.substring(appRoot.length);
}
history.location.pathname = replacement_pathname;
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/utils/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
* under the License.
*/
import parseCookie from 'src/utils/parseCookie';
import { ensureAppRootSanitized } from './pathUtils';
import rison from 'rison';
import { nanoid } from 'nanoid';
import { ensureAppRootSanitized } from './pathUtils';

export default function handleResourceExport(
resource: string,
Expand Down
8 changes: 4 additions & 4 deletions superset-frontend/src/utils/getBootstrapData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ export default function getBootstrapData(): BootstrapData {
}

// eslint-disable-next-line import/no-mutable-exports
const _APPLICATION_ROOT_NO_TRAILING_SLASH =
const APPLICATION_ROOT_NO_TRAILING_SLASH =
getBootstrapData().common.application_root.replace(/\/$/, '');

/**
* @param dom_sanitize If true, run the application root through dompurify before returning
* @returns The configured application root
*/
export function applicationRoot(dom_sanitize: boolean = false): string {
export function applicationRoot(dom_sanitize = false): string {
return dom_sanitize
? DOMPurify.sanitize(_APPLICATION_ROOT_NO_TRAILING_SLASH)
: _APPLICATION_ROOT_NO_TRAILING_SLASH;
? DOMPurify.sanitize(APPLICATION_ROOT_NO_TRAILING_SLASH)
: APPLICATION_ROOT_NO_TRAILING_SLASH;
}

0 comments on commit b129737

Please sign in to comment.