From 73e51d1ec94f851292d54d37b410b1f53d32d2c0 Mon Sep 17 00:00:00 2001 From: Shinrai Date: Sun, 9 Aug 2026 20:43:25 -0700 Subject: [PATCH] ci: canonical lint/format config (slothlet base + jsonv + json/md/css) Aligns the golden-reference config to the slothlet base and adds the fleet JSON handling: - eslint: add json5, @cldmv/eslint-plugin-jsonv (.jsonv), and @eslint/css; markdown + json/jsonc already present. Rules/globals follow the slothlet base (no-unused ^(_|___.*)$, node+browser). No HTML (base has none). - prettier: add @cldmv/prettier-plugin-jsonv + a *.jsonv -> parser:jsonv override. - NEW .prettierignore adapted from slothlet, incl. the *.yml/*.yaml exclusion: CI workflow YAML is deliberately 4-space and YAML disallows tabs, so prettier (tabWidth 2) was pointlessly reindenting every workflow file 4->2. git-embedded never carried a .prettierignore, so that churn propagated to every onboarded repo (observed on polyfillme #20). This is the fix at the source. Verified: npm run lint green; format:check flags only real source/doc drift (left for the post-merge autofix) and no longer touches workflow YAML. --- .configs/.prettierrc | 9 +++- .configs/eslint.config.mjs | 29 +++++++++++-- .prettierignore | 16 +++++++ package-lock.json | 86 ++++++++++++++++++++++++++++++++++++++ package.json | 4 ++ 5 files changed, 140 insertions(+), 4 deletions(-) create mode 100644 .prettierignore diff --git a/.configs/.prettierrc b/.configs/.prettierrc index af4250c..f84f51b 100644 --- a/.configs/.prettierrc +++ b/.configs/.prettierrc @@ -17,6 +17,13 @@ "options": { "proseWrap": "preserve" } + }, + { + "files": "*.jsonv", + "options": { + "parser": "jsonv" + } } - ] + ], + "plugins": ["@cldmv/prettier-plugin-jsonv"] } diff --git a/.configs/eslint.config.mjs b/.configs/eslint.config.mjs index cebb305..b06f336 100644 --- a/.configs/eslint.config.mjs +++ b/.configs/eslint.config.mjs @@ -1,12 +1,16 @@ import js from "@eslint/js"; import globals from "globals"; import json from "@eslint/json"; +import jsonvPlugin from "@cldmv/eslint-plugin-jsonv"; import markdown from "@eslint/markdown"; +import css from "@eslint/css"; import { defineConfig } from "eslint/config"; export default defineConfig([ { ignores: [ + "tmp/**", + "trash/**", "node_modules/**", "dist/**", "build/**", @@ -15,7 +19,22 @@ export default defineConfig([ ".vscode/**", "coverage/**", "reference/**", - "**/package-lock.json" + "*.min.js", + "*.min.css", + "**/package-lock.json", + // Copy file patterns + "*copy/", + "*copy (*)/", + "*copy */", + "*copy.*", + "*copy (*).*", + "*copy *.*", + "**/*copy/", + "**/*copy (*)/", + "**/*copy */", + "**/*copy.*", + "**/*copy (*).*", + "**/*copy *.*" ] }, { @@ -35,7 +54,7 @@ export default defineConfig([ } }, { files: ["**/*.js"], languageOptions: { sourceType: "commonjs" } }, - { files: ["**/*.{js,mjs,cjs}"], languageOptions: { globals: { ...globals.node } } }, + { files: ["**/*.{js,mjs,cjs}"], languageOptions: { globals: { ...globals.node, ...globals.browser } } }, { files: ["tests/**/*.test.vitest.mjs"], languageOptions: { @@ -54,13 +73,17 @@ export default defineConfig([ }, { files: ["**/*.json"], plugins: { json }, language: "json/json", extends: ["json/recommended"] }, { files: ["**/*.jsonc"], plugins: { json }, language: "json/jsonc", extends: ["json/recommended"] }, + { files: ["**/*.json5"], plugins: { json }, language: "json/json5", extends: ["json/recommended"] }, + { files: ["**/*.jsonv"], plugins: { jsonv: jsonvPlugin }, language: "jsonv/jsonv", ...jsonvPlugin.configs.recommended }, { files: ["**/*.md"], plugins: { markdown }, language: "markdown/gfm", extends: ["markdown/recommended"], rules: { + // GitHub alerts like [!NOTE]/[!WARNING] are valid but trip this rule. "markdown/no-missing-label-refs": "off" } - } + }, + { files: ["**/*.css"], plugins: { css }, language: "css/css", extends: ["css/recommended"] } ]); diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..a1bc6f2 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,16 @@ +# Dependencies + generated/build output (not hand-authored) +node_modules/ +dist/ +build/ +coverage/ +tmp/ +trash/ +reference/ +package-lock.json +*.min.js +*.min.css + +# YAML — CI workflows are deliberately 4-space indented; prettier (tabWidth 2, +# and YAML disallows tabs) would reindent every file 4->2 for no real gain. +*.yml +*.yaml diff --git a/package-lock.json b/package-lock.json index aa551ae..3def609 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,11 @@ "git-embedded": "bin/git-embedded.mjs" }, "devDependencies": { + "@cldmv/eslint-plugin-jsonv": "^1.0.3", + "@cldmv/jsonv": "^1.0.2", + "@cldmv/prettier-plugin-jsonv": "^1.0.1", "@cldmv/vitest-runner": "^1.2.0", + "@eslint/css": "^1.4.0", "@eslint/js": "^9.18.0", "@eslint/json": "^2.0.1", "@eslint/markdown": "^8.0.3", @@ -98,6 +102,52 @@ "node": ">=18" } }, + "node_modules/@cldmv/eslint-plugin-jsonv": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@cldmv/eslint-plugin-jsonv/-/eslint-plugin-jsonv-1.0.3.tgz", + "integrity": "sha512-P/AHUOaKnOV98qUfbBKgZ85uz3jVRSM/yjc6yKrAjaS5s5BEqpnVxIbQYcvfnPxopcA/IsCsedUjl9E7s3bM8A==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/shinrai" + }, + "peerDependencies": { + "@cldmv/jsonv": "^1.0.2" + } + }, + "node_modules/@cldmv/jsonv": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@cldmv/jsonv/-/jsonv-1.0.2.tgz", + "integrity": "sha512-YfJtIoiBf43eeiqqtUYcF0RJUJfpS+Ixzdm8yaQnLG7xlOG9xHSMcqfkPvgjoJiA3hPmHbAeAo4dSJZmwS6orQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/shinrai" + } + }, + "node_modules/@cldmv/prettier-plugin-jsonv": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@cldmv/prettier-plugin-jsonv/-/prettier-plugin-jsonv-1.0.1.tgz", + "integrity": "sha512-TsgxoXQhGO7aNABbKSd/xcuwrrNtvhvzVtWkiuH6QHOE346x3iZsHtk1IqHq9xPv8Knv/C+53ScYaFjAodhUSQ==", + "dev": true, + "license": "Apache-2.0", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/shinrai" + }, + "peerDependencies": { + "@cldmv/jsonv": "^1.0.0", + "prettier": "^3.0.0" + } + }, "node_modules/@cldmv/slothlet": { "version": "3.12.2", "resolved": "https://registry.npmjs.org/@cldmv/slothlet/-/slothlet-3.12.2.tgz", @@ -309,6 +359,35 @@ "node": "^20.19.0 || ^22.13.0 || >=24" } }, + "node_modules/@eslint/css": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@eslint/css/-/css-1.4.0.tgz", + "integrity": "sha512-OnRNKgnbX+tufPuZc2kOJS+v1iIARvfJHRNEAVwN77DBpojl+rGjEP8NKTL6pEZ7BR+HtwIuSSdrymEFlANGxg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1", + "@eslint/css-tree": "^4.0.4", + "@eslint/plugin-kit": "^0.7.2" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/css-tree": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@eslint/css-tree/-/css-tree-4.0.5.tgz", + "integrity": "sha512-iPmijIAq4hlIJB86PYmY/fcZORHtjphSqICDbwuw32A/JmkhZQ/K/6TjHE03zqf3n5yABpVcbRAMG8Mi9ojy8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "mdn-data": "2.29.0", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, "node_modules/@eslint/js": { "version": "9.39.4", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz", @@ -2696,6 +2775,13 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdn-data": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.29.0.tgz", + "integrity": "sha512-pVxQFCcaYUEAH853+v7yoI/qzhxXSq1bTb9obMYGYAN1c3Hen+XDCEvr296XhstrwlSTNgOR7mCSD4JPjbJe5A==", + "dev": true, + "license": "CC0-1.0" + }, "node_modules/micromark": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", diff --git a/package.json b/package.json index df4eb16..960fc83 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,11 @@ "marked-terminal": "^7.3.0" }, "devDependencies": { + "@cldmv/eslint-plugin-jsonv": "^1.0.3", + "@cldmv/jsonv": "^1.0.2", + "@cldmv/prettier-plugin-jsonv": "^1.0.1", "@cldmv/vitest-runner": "^1.2.0", + "@eslint/css": "^1.4.0", "@eslint/js": "^9.18.0", "@eslint/json": "^2.0.1", "@eslint/markdown": "^8.0.3",