From 8aa54203d39ab83c2b49fe4dc33413921eb8cedf Mon Sep 17 00:00:00 2001 From: Kenneth Bruskiewicz Date: Tue, 17 Dec 2024 16:08:41 -0800 Subject: [PATCH] Linter --- lib/AppContext.js | 4 ++-- lib/Toolbar.js | 5 +---- lib/index.js | 6 +----- lib/utils/i18n.js | 5 +---- lib/utils/templates.js | 6 +++++- lib/utils/validation.js | 5 +---- 6 files changed, 11 insertions(+), 20 deletions(-) diff --git a/lib/AppContext.js b/lib/AppContext.js index 0e9e7d42..5c8427ee 100644 --- a/lib/AppContext.js +++ b/lib/AppContext.js @@ -593,11 +593,11 @@ export default class AppContext { context.setDataHarmonizers(dhs); // COMMENTED OUT: WIP feature - if (!!context.oneToManyAppContext) { + if (context.oneToManyAppContext) { context.oneToManyAppContext.destroy(); } const appContext = buildAppContext(schema); - context.oneToManyAppContext = setup1M(appContext, dhs); // returns an event manager + context.oneToManyAppContext = setup1M(appContext, dhs); // returns an event manager return context; }); diff --git a/lib/Toolbar.js b/lib/Toolbar.js index 18d86730..b69031f2 100644 --- a/lib/Toolbar.js +++ b/lib/Toolbar.js @@ -24,10 +24,7 @@ import { LocaleNotSupportedError, } from '../lib/utils/templates'; -import { - findLocalesForLangcodes, - interface_translation, -} from './utils/i18n'; +import { findLocalesForLangcodes, interface_translation } from './utils/i18n'; import i18next from 'i18next'; import template from './toolbar.html'; diff --git a/lib/index.js b/lib/index.js index 270e3e7f..367f7ecb 100644 --- a/lib/index.js +++ b/lib/index.js @@ -2,8 +2,4 @@ export { default as Footer } from './Footer'; export { default as Toolbar } from './Toolbar'; export { default as DataHarmonizer } from './DataHarmonizer'; export { default as AppContext } from './AppContext'; -export { - DATE_OBJECT, - JSON_SCHEMA_FORMAT, - INPUT_FORMAT, -} from './utils/fields'; +export { DATE_OBJECT, JSON_SCHEMA_FORMAT, INPUT_FORMAT } from './utils/fields'; diff --git a/lib/utils/i18n.js b/lib/utils/i18n.js index a5287d46..05a2fa8b 100644 --- a/lib/utils/i18n.js +++ b/lib/utils/i18n.js @@ -5,10 +5,7 @@ import jqueryI18next from 'jquery-i18next'; import { flattenObject } from './objects'; import label_translations_file from '../../web/translations/translations.json'; -import { - MULTIVALUED_DELIMITER, - formatMultivaluedValue, -} from './fields'; +import { MULTIVALUED_DELIMITER, formatMultivaluedValue } from './fields'; import { renderContent } from './content'; export const interface_translation = transformStructFirstSpec( diff --git a/lib/utils/templates.js b/lib/utils/templates.js index a19f6d39..abb686a3 100644 --- a/lib/utils/templates.js +++ b/lib/utils/templates.js @@ -25,7 +25,11 @@ export async function templatePathForSchemaURI(schemaURI) { // for now, this is just the manifest for (let i = 0; i < template_manifest.children.length; i++) { const template = template_manifest.children[i]; - if (typeof template.children !== 'undefined' && template.children.length > 0 && template.children.some(c => c.name.includes("schema.json"))) { + if ( + typeof template.children !== 'undefined' && + template.children.length > 0 && + template.children.some((c) => c.name.includes('schema.json')) + ) { const schema = await getSchema(template.name); if (schema.id === schemaURI) { const templatePath = `${template.path.split('/').slice(-1)}/${schemaURI diff --git a/lib/utils/validation.js b/lib/utils/validation.js index 0703d564..3de77d97 100644 --- a/lib/utils/validation.js +++ b/lib/utils/validation.js @@ -1,7 +1,4 @@ -import { - formatMultivaluedValue, - parseMultivaluedValue, -} from './fields'; +import { formatMultivaluedValue, parseMultivaluedValue } from './fields'; /** * Test cellVal against "DataHarmonizer provenance: vX.Y.Z" pattern and if it