Settings

Theme

Show HN: GeoLint, an ESLint-style linter for GeoJSON

github.com

1 points by appleappleapple · 3 comments · 1 min read

Reader

Hello all! I make map-based web apps in my downtime to try to get some use out of my degree (which I’ve mostly shelved since becoming a SWE) and frequently work with GeoJSON to do so. I tried my hand at building a linter for GeoJSON data that can help determine when data is bloated, has inconsistent properties, or has missing or duplicated data. It can be configured to your definition of bloated as needed, and it also supports setting a baseline to help flag unexpected results.

It’s aptly called GeoLint and I hope it might be useful to folks working with GeoJSON, especially people who have workflows/pipelines setup to generate it automatically and want more rigorous checks on the output beyond formatting. You can define budgets for things like file size, feature count, and vertex count, add consistency checks, and keep a baseline so CI can flag unexpected regressions in generated output. Based on my benchmarking, it’s pretty quick!

Would love feedback from folks who work with GeoJSON on a regular basis on if this is useful to them, and if not, what kind of features they’d like to see in a tool like this. Thanks!

1 thread
nateb2022

Currently using https://github.com/placemark/check-geojson for this usecase right now.

Noticed your code includes a custom JSON parser, which seems to silently overwrite duplicate keys, which is absolutely something a linter should warn about.

And instead of using fast-glob, I'd recommend https://superchupu.dev/tinyglobby or better yet, use node:fs and node:fs/promises which are built in to modern node already.

And I noticed your package.json includes some bizarre fields,

  - "types": "./dist/index.d.ts" is unnecessary since you're an ESM module and require Node >22
  - "./package.json": "./package.json" is a Node 12-14 ESM workaround
  • appleappleappleOP

    Good looking out, great suggestions. This is one of my first times building an npm package so I appreciate the detailed look here

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection