From b7e7dbba65154e0708f72074afde611d7e2c872a Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 27 Jan 2021 18:09:32 +0000 Subject: [PATCH] Linting. --- .../PropertyControls/TableViewSelect.svelte | 20 +++++---- .../scripts/gen-collection-info.js | 41 ++++++++++--------- 2 files changed, 32 insertions(+), 29 deletions(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableViewSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableViewSelect.svelte index 6b3873a08c..5031b37323 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableViewSelect.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/TableViewSelect.svelte @@ -34,15 +34,17 @@ })) return [...acc, ...viewsArr] }, []) - $: queries = $backendUiStore.queries.filter(query => query.queryVerb === "read").map(query => ({ - label: query.name, - name: query.name, - tableId: query._id, - ...query, - schema: query.schema, - parameters: query.parameters, - type: "query", - })) + $: queries = $backendUiStore.queries + .filter(query => query.queryVerb === "read") + .map(query => ({ + label: query.name, + name: query.name, + tableId: query._id, + ...query, + schema: query.schema, + parameters: query.parameters, + type: "query", + })) $: bindableProperties = getBindableProperties( $currentAsset.props, $store.selectedComponentId diff --git a/packages/string-templates/scripts/gen-collection-info.js b/packages/string-templates/scripts/gen-collection-info.js index e903b8ee1c..82ac843e36 100644 --- a/packages/string-templates/scripts/gen-collection-info.js +++ b/packages/string-templates/scripts/gen-collection-info.js @@ -10,14 +10,7 @@ const FILENAME = "../manifest.json" * https://github.com/helpers/handlebars-helpers */ -const COLLECTIONS = [ - "math", - "array", - "number", - "url", - "string", - "comparison", -] +const COLLECTIONS = ["math", "array", "number", "url", "string", "comparison"] const outputJSON = {} @@ -59,7 +52,8 @@ function getCommentInfo(file, func) { // from here work back until we have the comment if (lookForward(lines, funcLines, idx)) { let fromIdx = idx - let start = 0, end = 0 + let start = 0, + end = 0 do { if (lines[fromIdx].includes("*/")) { end = fromIdx @@ -96,7 +90,10 @@ function getCommentInfo(file, func) { function run() { const foundNames = [] for (let collection of COLLECTIONS) { - const collectionFile = fs.readFileSync(`../node_modules/handlebars-helpers/lib/${collection}.js`, "utf8") + const collectionFile = fs.readFileSync( + `../node_modules/handlebars-helpers/lib/${collection}.js`, + "utf8" + ) const collectionInfo = {} // collect information about helper let hbsHelperInfo = helpers[collection]() @@ -115,7 +112,14 @@ function run() { const jsDocInfo = getCommentInfo(collectionFile, fnc) let args = jsDocInfo.tags .filter(tag => tag.title === "param") - .map(tag => tag.description && tag.description.replace(/`/g, "").split(" ")[0].trim()) + .map( + tag => + tag.description && + tag.description + .replace(/`/g, "") + .split(" ")[0] + .trim() + ) collectionInfo[name] = fixSpecialCases(name, { args, numArgs: args.length, @@ -127,17 +131,14 @@ function run() { } // add the date helper outputJSON["date"] = { - "date": { - args: [ - "datetime", - "format" - ], + date: { + args: ["datetime", "format"], numArgs: 2, - example: "{{date now \"YYYY\"}}", - description: "Format a date using moment.js data formatting." - } + example: '{{date now "YYYY"}}', + description: "Format a date using moment.js data formatting.", + }, } fs.writeFileSync(FILENAME, JSON.stringify(outputJSON, null, 2)) } -run() \ No newline at end of file +run()