Lint Mapbox GL styles.
Yes, the style spec has gl-style-validate, but this module solves two issues:
- The style spec tool uses an older version of Node, so it can be difficult to execute in projects that use newer versions.
- The style spec tool does not find every error you might want to find. For example, the style spec tool does not raise errors for
paint
orlayout
property ids at the top level of a layer.
This tool takes the same inputs and creates compatible outputs to the style spec's gl-style-validate
tool.
- Install.
- Execute on one or more styles:
mapbox-gl-style-lint styles/*.json
- Clone this repo.
- Install dependencies (
yarn install
). - Start build tool (
yarn watch
). - Start the test suite (
yarn test
). - Make changes in
src
.