From fec771261c466b7238703f70827fc8bce3594685 Mon Sep 17 00:00:00 2001 From: Braden MacDonald Date: Fri, 15 Dec 2023 13:49:33 -0800 Subject: [PATCH] chore: fix some lint issues (WIP) --- .eslintrc.js => .eslintrc.cjs | 4 +--- src/auth/interface.js | 1 - src/logging/NewRelicLoggingService.js | 4 ++-- src/logging/interface.js | 8 ++++---- src/react/AppContext.jsx | 2 +- src/utils.js | 2 +- 6 files changed, 9 insertions(+), 12 deletions(-) rename .eslintrc.js => .eslintrc.cjs (88%) diff --git a/.eslintrc.js b/.eslintrc.cjs similarity index 88% rename from .eslintrc.js rename to .eslintrc.cjs index 8d5d03d00..bba025169 100755 --- a/.eslintrc.js +++ b/.eslintrc.cjs @@ -12,9 +12,7 @@ config.rules = { 'example/*', ], }], - 'import/extensions': ['error', { - ignore: ['@edx/frontend-platform*'], - }], + 'import/extensions': ['error', 'always'], 'import/no-unresolved': ['error', { ignore: ['@edx/frontend-platform*'], }], diff --git a/src/auth/interface.js b/src/auth/interface.js index 289fc5482..f42133463 100644 --- a/src/auth/interface.js +++ b/src/auth/interface.js @@ -252,7 +252,6 @@ export async function hydrateAuthenticatedUser() { publish(AUTHENTICATED_USER_CHANGED); } - /** * @typedef {import("axios").Axios} HttpClient */ diff --git a/src/logging/NewRelicLoggingService.js b/src/logging/NewRelicLoggingService.js index 9466fc994..07fe8a9c2 100644 --- a/src/logging/NewRelicLoggingService.js +++ b/src/logging/NewRelicLoggingService.js @@ -42,8 +42,8 @@ function sendError(error, customAttributes) { } /** - * @param {string} name - * @param {string|number|boolean|null} value + * @param {string} name + * @param {string|number|boolean|null} value */ function setCustomAttribute(name, value) { if (process.env.NODE_ENV === 'development') { diff --git a/src/logging/interface.js b/src/logging/interface.js index 4c941626f..5cc6b68e5 100644 --- a/src/logging/interface.js +++ b/src/logging/interface.js @@ -41,10 +41,10 @@ const serviceShape = { let service = null; /** - * - * @param {LoggingServiceConstructor} LoggingService - * @param {{config: import('../config').ConfigDocument}} options - * @returns + * + * @param {LoggingServiceConstructor} LoggingService + * @param {{config: import('../config').ConfigDocument}} options + * @returns */ export function configure(LoggingService, options) { PropTypes.checkPropTypes(optionsShape, options, 'property', 'Logging'); diff --git a/src/react/AppContext.jsx b/src/react/AppContext.jsx index be3915ce9..a25fb1528 100644 --- a/src/react/AppContext.jsx +++ b/src/react/AppContext.jsx @@ -26,7 +26,7 @@ import React from 'react'; const AppContext = React.createContext(/** @type {AppContext} */ ({ authenticatedUser: null, config: {}, - locale: "" + locale: '', })); export default AppContext; diff --git a/src/utils.js b/src/utils.js index 1b7e27fed..aba79baa6 100644 --- a/src/utils.js +++ b/src/utils.js @@ -155,7 +155,7 @@ export function parseURL(url) { * @returns {string} */ export function getPath(url) { - return new URL(url, window?.location.href ?? "https://example.com")?.pathname || ''; + return new URL(url, window?.location.href ?? 'https://example.com')?.pathname || ''; } /**