Like our markdown linters, all Mapbox documentation repositories use a shared ESLint configuration. Our configuration covers everything from enforcing React best practices to improving accessibility, including:
eslint-config-mapboxis a shared ESLint config for Mapbox engineering teams which serves as the base for our configuration.
eslint-plugin-reactincludes React specific linting rules.
eslint-plugin-jsx-a11ychecks accessibility rules on JSX elements.
eslint-plugin-esallows us to disallow unsupported ECMAScript syntax.
eslint-config-prettierturns off all rules that are unnecessary or might conflict with Prettier.
eslint-plugin-docsis a private plugin that I’ve been developing to create custom ESLint rules for our documentation sites. So far the plugin makes sure that when you import
mapbox-glthat you must include a special component to handle the loading of the map.
ESLint plugins will help keep your code consistent and improve the quality, but they are also excellent teaching tools. When I come across a plugin, I take joy in reading each rule to learn the benefits of enabling or disabling it.
Did you enjoy this post? Support RAICES. RAICES promotes justice by providing free and low-cost legal services to underserved immigrant children, families, and refugees.