Repository navigation
Use @mapbox/eslint-config-docs - #196
Conversation
colleenmcginnis
left a comment
There was a problem hiding this comment.
@katydecorah looks good! I am curious about a couple of the changes (mostly so I can avoid mistakes in the future).
| const doc = getWindow().document; | ||
| this.styleTag = doc.createElement('style'); | ||
| this.styleTag.innerHTML = theme; | ||
| this.styleTag.innerHTML = `${theme}`; |
There was a problem hiding this comment.
Curious about the reason for this rule. 🤓
There was a problem hiding this comment.
This rule is also from https://github.com/mapbox/eslint-config-mapbox/blob/master/xss.js
If we were dealing with user input, we'd want to escape this value, but was able to wrap in a template literal instead.
| return class Redirect extends React.Component { | ||
| componentDidMount() { | ||
| window.location.href = target; | ||
| window.location.href = escape(target); |
There was a problem hiding this comment.
This rule is from https://github.com/mapbox/eslint-config-mapbox/blob/master/xss.js - this adds a layer of protection by escaping the url. This prevent hacks! (Which are unlikely in this environment since we define the target but it's good practice.
* master: Use @mapbox/eslint-config-docs (#196)
npm install @mapbox/eslint-config-docs --save-dev && npx install-peerdeps --dev @mapbox/eslint-config-docs"@mapbox/eslint-config-docs"to extends while removing an extended modules already present in eslint-config-docsRef https://github.com/mapbox/documentation/issues/272