-
-
Save colinsullivan/27bb7be5e1ad9f8dc693b28cafbbd5ac to your computer and use it in GitHub Desktop.
Fix Create React App warnings when using Mapbox react wrapper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This causes the CRA builder to honor the local `eslintConfig` in the project's `package.json` | |
# https://create-react-app.dev/docs/setting-up-your-editor/#experimental-extending-the-eslint-config | |
EXTEND_ESLINT=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"eslintConfig": { | |
"extends": "react-app", | |
"rules": { | |
"react/style-prop-object": ["warn", { | |
"allow": ["Mapbox"] | |
}] | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return <Mapbox | |
style="mapbox://styles/mymaps/asdfsadfdsafsdfafe" | |
//...etc. | |
/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Mapbox component accepts a
style
attribute that is a string. Ordinarily this triggers a warning in the default eslint config provided by CRA: