eslint-plugin-primer-react 5.0.0 → 5.1.0-rc.858aa4e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-primer-react",
3
- "version": "5.0.0",
3
+ "version": "5.1.0-rc.858aa4e",
4
4
  "description": "ESLint rules for Primer React",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -20,4 +20,12 @@ const components = flattenComponents({
20
20
  },
21
21
  })
22
22
 
23
- module.exports = components
23
+ // We want to avoid setting a jsx-a11y mapping from `Box` to `div` until polymorphic linting is enabled for jsx-a11y.
24
+ // 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)
25
+ const githubMapping = Object.assign({}, components)
26
+ githubMapping['Box'] = 'div'
27
+
28
+ module.exports = {
29
+ jsxA11yMapping: components,
30
+ githubMapping,
31
+ }
@@ -1,4 +1,4 @@
1
- const components = require('./components')
1
+ const {jsxA11yMapping, githubMapping} = require('./components')
2
2
 
3
3
  module.exports = {
4
4
  parserOptions: {
@@ -19,10 +19,10 @@ module.exports = {
19
19
  },
20
20
  settings: {
21
21
  github: {
22
- components,
22
+ components: githubMapping,
23
23
  },
24
24
  'jsx-a11y': {
25
- components,
25
+ components: jsxA11yMapping,
26
26
  },
27
27
  },
28
28
  }