Skip to content

Repository files navigation

eslint-plugin-mapbox

This eslint plugin contains custom eslint rules.

Usage

    npm install --save-dev @mapbox/eslint-plugin-mapbox

Example of eslint.config.cjs for eslint version 9:

    const mapbox = require('@mapbox/eslint-plugin-mapbox');
    module.exports = [
        ...mapbox.configs.recommended,
    ]

Example of eslint config file for eslint version 8:

    module.exports = {
    extends: 'eslint:recommended',
    env: {
        es6: true
    },
    parserOptions: {
        ecmaVersion: 2020
    },
    plugins: ['jsonc', '@mapbox/mapbox'],
    rules: {
        ... other rules
        '@mapbox/mapbox/detect-token': 'error'
    },
    overrides: [
        {
        files: ['*.json', '*.jsonc'],
        parser: 'jsonc-eslint-parser',
        rules: {

            ... other rules
            '@mapbox/mapbox/detect-token'': 'error',
        }
        }
    ]
    };

Rules

detect-token : Detects potential sensitive tokens in .ts, .tsx, .js, .jsx and .json files

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

47 watching

Forks

Releases

Packages

Used by

Contributors

Languages