这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@trillium
Copy link
Contributor

@trillium trillium commented Jan 13, 2025

Issue

When tag-data.json is automatically regenerated it doesn't follow the formatting of the repo. This leads to the local file differing from the upstream file every time the dev server is run.

Changes

  • Add a step to run the resulting json object through prettier before writing to disk.

Before:

  writeFileSync('./app/tag-data.json', tagCount)
{"markdown":1,"code":1,"features":1,"next-js":6,"math":1,"ols":1,"github":1,"guide":5,"tailwind":3,"hello":1,"holiday":1,"canada":1,"images":1,"feature":2,"writings":1,"book":1,"reflection":1,"multi-author":1}

After:

  const formatted = await prettier.format(JSON.stringify(tagCount, null, 2), { parser: 'json' })
  writeFileSync('./app/tag-data.json', formatted)
{
  "markdown": 1,
  "code": 1,
  "features": 1,
  "next-js": 6,
  "math": 1,
  "ols": 1,
  "github": 1,
  "guide": 5,
  "tailwind": 3,
  "holiday": 1,
  "canada": 1,
  "images": 1,
  "feature": 2,
  "writings": 1,
  "book": 1,
  "reflection": 1,
  "multi-author": 1
}

@vercel
Copy link

vercel bot commented Jan 13, 2025

@trillium is attempting to deploy a commit to the timlrx's projects Team on Vercel.

A member of the Team first needs to authorize it.

@trillium trillium changed the title fix: Add outline focus-visible styles for buttons, links fix: Lint tag-data.json when regenerated during dev/build step Jan 13, 2025
@trillium trillium force-pushed the ts.lint-tag-data-on-create branch from 07592de to 38b7d8d Compare January 13, 2025 22:35
@vercel
Copy link

vercel bot commented Jan 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tailwind-nextjs-starter-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 3:50pm

@timlrx
Copy link
Owner

timlrx commented Jan 14, 2025

Thanks! I was getting annoyed by this as well.

@timlrx timlrx merged commit a5102b8 into timlrx:main Jan 14, 2025
2 checks passed
@trillium trillium deleted the ts.lint-tag-data-on-create branch January 14, 2025 17:51
bhiwagade-rahul pushed a commit to bhiwagade-rahul/tailwind-nextjs-starter-blog that referenced this pull request Sep 22, 2025
fix: Lint tag-data.json when regenerated during dev/build step
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants