From fd291378a9f2bda3032b5feeabde25307281d899 Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Sun, 18 Feb 2024 04:27:30 -0500 Subject: [PATCH] chore(lint): ensure that linting+formatting applies to functions as well --- biome.json | 3 +++ netlify/functions/rss-proxy/rss-proxy.ts | 30 ++++++++++++------------ package.json | 4 ++-- renovate.json | 8 +++---- tsconfig.json | 2 +- vite.config.js | 10 ++++---- 6 files changed, 29 insertions(+), 28 deletions(-) diff --git a/biome.json b/biome.json index bdf7405..ad07285 100644 --- a/biome.json +++ b/biome.json @@ -3,6 +3,9 @@ "organizeImports": { "enabled": false }, + "files": { + "ignore": ["node_modules/**/*", ".netlify/**/*", "dist/**/*"] + }, "linter": { "enabled": true, "rules": { diff --git a/netlify/functions/rss-proxy/rss-proxy.ts b/netlify/functions/rss-proxy/rss-proxy.ts index 008b819..579dc25 100755 --- a/netlify/functions/rss-proxy/rss-proxy.ts +++ b/netlify/functions/rss-proxy/rss-proxy.ts @@ -10,8 +10,8 @@ * follow. */ -import axios from 'axios' -import { parseFeed } from 'htmlparser2' +import axios from "axios"; +import { parseFeed } from "htmlparser2"; function processFeedXML(feed) { return { @@ -30,20 +30,20 @@ function processFeedXML(feed) { } const handler = async (event) => { - try { - const url = event.queryStringParameters.url - const responseData = await axios.get(url) - const newFeedData = parseFeed(responseData.data); + try { + const url = event.queryStringParameters.url; + const responseData = await axios.get(url); + const newFeedData = parseFeed(responseData.data); const newFeed = processFeedXML(newFeedData); const mergedFeeds = newFeed; - return { - statusCode: 200, - body: JSON.stringify(mergedFeeds), - } - } catch (error) { - return { statusCode: 500, body: error.toString() } - } -} + return { + statusCode: 200, + body: JSON.stringify(mergedFeeds), + }; + } catch (error) { + return { statusCode: 500, body: error.toString() }; + } +}; -module.exports = { handler } +module.exports = { handler }; diff --git a/package.json b/package.json index 8982c5a..b29e936 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "packageManager": "yarn@4.1.0", "license": "GPL-3.0", "scripts": { - "lint": "yarn biome format src/**/*.ts src/**/*.tsx && yarn biome check src/**/*.ts src/**/*.tsx", - "lint:fix": "yarn biome format src/**/*.ts src/**/*.tsx --write && yarn biome check src/**/*.ts src/**/*.tsx --apply", + "lint": "yarn biome format --config-path=. . && yarn biome check --config-path=. .", + "lint:fix": "yarn biome format --config-path=. . --write && yarn biome check --config-path=. . --apply", "typecheck": "tsc --noEmit", "start": "netlify dev", "start:app": "vite ./src --config ./vite.config.js --port 8080", diff --git a/renovate.json b/renovate.json index 19a36a7..7d170b8 100644 --- a/renovate.json +++ b/renovate.json @@ -1,7 +1,5 @@ { - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "schedule": ["on friday"], - "extends": [ - "config:base" - ] + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "schedule": ["on friday"], + "extends": ["config:base"] } diff --git a/tsconfig.json b/tsconfig.json index 4f93b81..4efbc70 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,5 +8,5 @@ "skipLibCheck": true, "rootDir": "." }, - "include": ["src/**/*"] + "include": ["src/**/*", "netlify/**/*"] } diff --git a/vite.config.js b/vite.config.js index a444002..0ba403f 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,7 +1,7 @@ -import legacy from "@vitejs/plugin-legacy" -import basicSSL from "@vitejs/plugin-basic-ssl" -import path from "node:path" -import { defineConfig } from "vite" +import legacy from "@vitejs/plugin-legacy"; +import basicSSL from "@vitejs/plugin-basic-ssl"; +import path from "node:path"; +import { defineConfig } from "vite"; export default defineConfig({ plugins: [legacy(), basicSSL()], @@ -30,4 +30,4 @@ export default defineConfig({ }, ], }, -}) +});