Coder Social home page Coder Social logo

mapbox-gl-style-linter's Introduction

mapbox-gl-style-linter

Lint Mapbox GL styles.

Why? Doesn't the style spec do this?

Yes, the style spec has gl-style-validate, but this module solves two issues:

  1. The style spec tool uses an older version of Node, so it can be difficult to execute in projects that use newer versions.
  2. 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 or layout 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.

Usage

  1. Install.
  2. Execute on one or more styles:
    mapbox-gl-style-lint styles/*.json

Development

  1. Clone this repo.
  2. Install dependencies (yarn install).
  3. Start build tool (yarn watch).
  4. Start the test suite (yarn test).
  5. Make changes in src.

mapbox-gl-style-linter's People

Contributors

aparlato avatar ebrelsford avatar

Stargazers

Christos avatar Yoni Nachmany avatar Seth Fitzsimmons avatar Chris Amico avatar Jonah Adkins avatar

Watchers

 avatar Eric Rodenbeck avatar Friedrich Hartmann avatar James Cloos avatar Alan McConchie avatar Edward Mac Gillavry avatar  avatar  avatar  avatar  avatar

Forkers

pescej kateler

mapbox-gl-style-linter's Issues

Make sure line-dash-array is formatted appropriately

We had an issue in a style repo where a style had an incorrectly formatted line-dash-array property using an array with a single value in it: [1].

This didn't cause issues rendering the style as a vector style, but converted to raster it created some breakages.

Consider flag for enforcing HSL

We should consider adding flags to enforce certain conventions a user might care about. For example, we often prefer for our styles to use only HSL values. We might also allow for enforcing other color spaces as well.

Do we want to consider optional flags for common conventions like this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.