From 9b34510c8b167aa7ad8fae615f51e982d70c6159 Mon Sep 17 00:00:00 2001 From: Zsolt Ero Date: Thu, 18 Sep 2025 20:46:27 +0200 Subject: [PATCH] work --- README.md | 1 - biome.jsonc | 185 +++++++++++++++++++++++++--- package.json | 4 +- website/astro.config.mjs | 2 +- website/package.json | 5 +- website/src/components/Map.astro | 1 + website/src/pages/index.astro | 3 +- website/src/pages/quick_start.astro | 5 +- website/src/styles/global.css | 4 +- website/src/styles/map.css | 6 +- 10 files changed, 188 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index e694fe9..b9da3b3 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,6 @@ Please consider sponsoring our project on [GitHub Sponsors](https://github.com/s The only way this project can possibly work is to be super focused about what it is and what it isn't. OpenFreeMap has the following limitations by design: 1. OpenFreeMap is not providing: - - search or geocoding - route calculation, navigation or directions - static image generation diff --git a/biome.jsonc b/biome.jsonc index 5049d69..6e1f91a 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -1,31 +1,186 @@ { - "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", + "root": true, + "$schema": "https://biomejs.dev/schemas/2.2.4/schema.json", + + "vcs": { + "enabled": false, + "clientKind": "git", + "useIgnoreFile": true, + }, + "files": { + "maxSize": 100000, + "ignoreUnknown": true, + "includes": [ + "**", + // + "!**/.pytest_cache", + "!**/venv", + "!**/.astro", + "!**/.venv", + "!**/_astro", + "!**/_not_used", + "!**/dist", + "!**/dist-electron", + "!**/node_modules", + "!**/.pytest_cache", + // + ], + }, "formatter": { "indentStyle": "space", - "lineWidth": 100 - }, - "organizeImports": { - "enabled": true, - "ignore": [] + "lineWidth": 100, }, "linter": { "enabled": true, + "domains": { + "solid": "all", + }, "rules": { "recommended": true, + "style": { + "noNonNullAssertion": "off", + "useConsistentArrayType": { + "level": "error", + "options": { + "syntax": "generic", + }, + }, + "useLiteralEnumMembers": "error", + "useNodejsImportProtocol": "error", + "useAsConstAssertion": "error", + "useEnumInitializers": "error", + "useSelfClosingElements": "error", + "useSingleVarDeclarator": "error", + "noUnusedTemplateLiteral": "error", + "useNumberNamespace": "error", + "noInferrableTypes": "error", + "useExponentiationOperator": "error", + "useTemplate": "error", + "noParameterAssign": "error", + "useDefaultParameterLast": "error", + "useImportType": "error", + "useExportType": "error", + "useShorthandFunctionType": "error", + "noUselessElse": "error", + "useGroupedAccessorPairs": "error", + "useObjectSpread": "error", + }, + "security": { + // "noDangerouslySetInnerHtml": "off", + // "noBlankTarget": "off", + }, + "a11y": { + "useFocusableInteractive": "off", // The HTML element with the interactive role "treeitem" is not focusable. + "useSemanticElements": "off", // SessionTreeDay / role="group" + "noStaticElementInteractions": "off", // SessionTreeDay / To add interactivity such as a mouse or key event listener to a static element, give the element an appropriate role value. + "useAriaPropsSupportedByRole": "off", // SessionTree / The ARIA attribute 'aria-multiselectable' is not supported by this element. + "useKeyWithClickEvents": "off", // PasteBlock / Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event. + "noNoninteractiveElementToInteractiveRole": "off", // SessionTree + // "useValidAnchor": "off", + // "useButtonType": "off", + // "noLabelWithoutControl": "off", + // "noSvgWithoutTitle": "off", + // "noNoninteractiveTabindex": "off", + }, + "correctness": { + "noUnusedFunctionParameters": "off", + "noUnusedImports": "off", + "noUnusedVariables": "off", + "noUnusedPrivateClassMembers": "off", + "noUnreachable": "off", + "noSolidDestructuredProps": "error", + "noGlobalDirnameFilename": "error", + "useParseIntRadix": "error", + "useSingleJsDocAsterisk": "error", + }, + "suspicious": { + "noExplicitAny": "off", + "noImplicitAnyLet": "off", + "noUselessEscapeInString": "error", + "useStaticResponseMethods": "error", + "useIterableCallbackReturn": "off", + // "noAssignInExpressions": "off", + //"noArrayIndexKey": "off", + }, "complexity": { - "noForEach": "off" - } + "noCommaOperator": "error", + "useNumericLiterals": "error", + // "noArguments": "off", + "useIndexOf": "error", + "noImplicitCoercions": "error", // Number(), Boolean() + // "noUselessFragments": "off" + }, + "nursery": { + // "noShadow": "error", + // "useReadonlyClassProperties": "error", + // "noImportCycles": "error", + + // "noFloatingPromises": "error", + // "noMisusedPromises": "error", + + // "noUnassignedVariables": "error", // bug reported ref= not recognised + "noUselessUndefined": "error", + }, + "performance": { "useSolidForComponent": "error" }, }, - "ignore": [] }, "javascript": { "formatter": { "semicolons": "asNeeded", - "quoteStyle": "single" - } + "quoteStyle": "single", + }, }, - "files": { - "maxSize": 100000, - "ignore": ["venv", "dist", ".astro"] - } + "json": { + "parser": { + "allowTrailingCommas": true, + }, + "formatter": { + "trailingCommas": "none", + }, + }, + "assist": { + "enabled": true, + "actions": { + "source": { + "organizeImports": "on", + // "useSortedProperties": "on" // sort CSS props + }, + }, + }, + "overrides": [ + { + "includes": ["**/*.astro"], + "linter": { + "rules": { + "correctness": { + "noUnusedImports": "off", + }, + }, + }, + }, + { + "includes": ["**/*.jsonc"], + "json": { + "formatter": { + "trailingCommas": "all", + }, + }, + }, + { + "includes": ["**/*.css"], + "linter": { + "rules": { + "suspicious": { + "noDuplicateProperties": "off", + "noEmptyBlock": "off", + "noUnknownAtRules": "off", + }, + "complexity": { + "noImportantStyles": "off", + }, + "style": { "noDescendingSpecificity": "off" }, + }, + }, + }, + ], } diff --git a/package.json b/package.json index be0d4d2..d33c5e9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "dependencies": { - "@biomejs/biome": "^1.9.2", - "prettier": "^3.2.4", + "@biomejs/biome": "^2.2.4", + "prettier": "^3.6.2", "prettier-plugin-astro": "^0.14.0" }, "packageManager": "pnpm@9.9.0+sha512.60c18acd138bff695d339be6ad13f7e936eea6745660d4cc4a776d5247c540d0edee1a563695c183a66eb917ef88f2b4feb1fc25f32a7adcadc7aaf3438e99c1" diff --git a/website/astro.config.mjs b/website/astro.config.mjs index 59ccc67..c4dba60 100644 --- a/website/astro.config.mjs +++ b/website/astro.config.mjs @@ -1,7 +1,7 @@ // @ts-check -import { defineConfig } from 'astro/config' import sitemap from '@astrojs/sitemap' +import { defineConfig } from 'astro/config' // https://astro.build/config diff --git a/website/package.json b/website/package.json index 7f0ae49..2bf7176 100644 --- a/website/package.json +++ b/website/package.json @@ -15,6 +15,9 @@ "lightningcss": "^1.29.1" }, "pnpm": { - "onlyBuiltDependencies": ["esbuild", "sharp"] + "onlyBuiltDependencies": [ + "esbuild", + "sharp" + ] } } diff --git a/website/src/components/Map.astro b/website/src/components/Map.astro index 3860ae5..4e12d7d 100644 --- a/website/src/components/Map.astro +++ b/website/src/components/Map.astro @@ -1,5 +1,6 @@ --- import StyleUrlBug from './StyleUrlBug.astro' + const { showStyleURL } = Astro.props --- diff --git a/website/src/pages/index.astro b/website/src/pages/index.astro index 8040a27..08ffdb9 100644 --- a/website/src/pages/index.astro +++ b/website/src/pages/index.astro @@ -2,11 +2,10 @@ import Donate from '../components/Donate.astro' import Logo from '../components/Logo.astro' import Map_ from '../components/Map.astro' -import Layout from '../layouts/Layout.astro' - import { Content as AfterDonate } from '../content/index/after_donate.md' import { Content as BeforeDonate } from '../content/index/before_donate.md' import { Content as WhatisText } from '../content/index/whatis.md' +import Layout from '../layouts/Layout.astro' --- diff --git a/website/src/pages/quick_start.astro b/website/src/pages/quick_start.astro index cad1281..fa70f38 100644 --- a/website/src/pages/quick_start.astro +++ b/website/src/pages/quick_start.astro @@ -1,9 +1,7 @@ --- -import Map_ from '../components/Map.astro' -import Layout from '../layouts/Layout.astro' - import Donate from '../components/Donate.astro' import Logo from '../components/Logo.astro' +import Map_ from '../components/Map.astro' import { Content as CustomStylesText } from '../content/how_to_use/custom_styles.md' import { Content as LeafletText } from '../content/how_to_use/leaflet.md' import { Content as MapboxText } from '../content/how_to_use/mapbox.md' @@ -11,6 +9,7 @@ import { Content as MaplibreText } from '../content/how_to_use/maplibre.md' import { Content as MobileText } from '../content/how_to_use/mobile.md' import { Content as OpenLayersText } from '../content/how_to_use/openlayers.md' import { Content as SelfHostingText } from '../content/how_to_use/self_hosting.md' +import Layout from '../layouts/Layout.astro' --- diff --git a/website/src/styles/global.css b/website/src/styles/global.css index b5e3ac8..a9bc16f 100644 --- a/website/src/styles/global.css +++ b/website/src/styles/global.css @@ -24,8 +24,8 @@ h6 { margin-top: 3em; margin-bottom: 0.5em; line-height: 1.2; - font-family: Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", source-sans-pro, - sans-serif; + font-family: + Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", source-sans-pro, sans-serif; font-weight: bold; } diff --git a/website/src/styles/map.css b/website/src/styles/map.css index 32dd00a..ecd7a4b 100644 --- a/website/src/styles/map.css +++ b/website/src/styles/map.css @@ -25,7 +25,11 @@ } .mapbg-attrib { - font: 12px / 20px "Helvetica Neue", Arial, Helvetica, sans-serif; + font: + 12px / 20px "Helvetica Neue", + Arial, + Helvetica, + sans-serif; background-color: hsla(0, 0%, 100%, 0.5); padding: 0 5px; bottom: 0;