Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/configs/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,12 @@ const components = flattenComponents({
},
})

module.exports = components
// We want to avoid setting a jsx-a11y mapping from `Box` to `div` until polymorphic linting is enabled for jsx-a11y.
// However, polymorphic linting is enabled for the github plugin, so we can safely map `Box` to `div` (while also having it properly interpret the `as` prop)
const githubMapping = Object.assign({}, components)
githubMapping['Box'] = 'div'

module.exports = {
jsxA11yMapping: components,
githubMapping,
}
6 changes: 3 additions & 3 deletions src/configs/recommended.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const components = require('./components')
const {jsxA11yMapping, githubMapping} = require('./components')

module.exports = {
parserOptions: {
Expand All @@ -19,10 +19,10 @@ module.exports = {
},
settings: {
github: {
components,
components: githubMapping,
},
'jsx-a11y': {
components,
components: jsxA11yMapping,
},
},
}