@zendeskgarden/eslint-config 31.0.0 → 32.0.0

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": "@zendeskgarden/eslint-config",
3
- "version": "31.0.0",
3
+ "version": "32.0.0",
4
4
  "description": "Garden ESLint config",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Zendesk Garden <garden@zendesk.com>",
package/plugins/react.js CHANGED
@@ -19,6 +19,9 @@ module.exports = {
19
19
  }
20
20
  },
21
21
  rules: {
22
+ // enforces using semantic DOM elements over the ARIA role property.
23
+ 'jsx-a11y/prefer-tag-over-role': 2,
24
+
22
25
  // enforces consistent naming for boolean props
23
26
  'react/boolean-prop-naming': 1,
24
27
  // forbid "button" element without an explicit "type" attribute
@@ -117,8 +120,6 @@ module.exports = {
117
120
  'react/jsx-props-no-multi-spaces': 2,
118
121
  // prevent JSX prop spreading
119
122
  'react/jsx-props-no-spreading': 0,
120
- // enforce default props alphabetical sorting
121
- 'react/jsx-sort-default-props': 0,
122
123
  // enforce props alphabetical sorting
123
124
  'react/jsx-sort-props': 0,
124
125
  // validate whitespace in and around the JSX opening and closing brackets
@@ -161,6 +162,8 @@ module.exports = {
161
162
  'react/no-multi-comp': 0,
162
163
  // enforces the absence of a namespace in React elements (e.g. `<svg:circle />`)
163
164
  'react/no-namespace': 2,
165
+ // disallow usage of referential-type variables as default param in functional components
166
+ 'react/no-object-type-as-default-prop': 0,
164
167
  // flag shouldComponentUpdate when extending PureComponent
165
168
  'react/no-redundant-should-component-update': 2,
166
169
  // prevent usage of the return value of React.render
@@ -209,6 +212,8 @@ module.exports = {
209
212
  'react/self-closing-comp': 2,
210
213
  // enforce component methods order
211
214
  'react/sort-comp': 0,
215
+ // enforce default props alphabetical sorting
216
+ 'react/sort-default-props': 0,
212
217
  // enforce propTypes declarations alphabetical sorting
213
218
  'react/sort-prop-types': 0,
214
219
  // state initialization in an ES6 class component should be in a constructor
@@ -7,6 +7,7 @@
7
7
 
8
8
  const bestPractices = require('../rules/best-practices').rules;
9
9
  const possibleErrors = require('../rules/possible-errors').rules;
10
+ const stylisticIssues = require('../rules/stylistic-issues').rules;
10
11
 
11
12
  module.exports = {
12
13
  plugins: ['@typescript-eslint'],
@@ -14,6 +15,7 @@ module.exports = {
14
15
  rules: {
15
16
  // Disable ESLint rules that are handled by TypeScript
16
17
  'dot-notation': 0,
18
+ 'key-spacing': 0,
17
19
  'no-implied-eval': 0,
18
20
  'no-return-await': 0,
19
21
  'no-throw-literal': 0,
@@ -23,6 +25,8 @@ module.exports = {
23
25
  '@typescript-eslint/await-thenable': 2,
24
26
  // enforce dot notation whenever possible
25
27
  '@typescript-eslint/dot-notation': bestPractices['dot-notation'],
28
+ // enforce consistent spacing between keys and values in object literal properties
29
+ '@typescript-eslint/key-spacing': stylisticIssues['key-spacing'],
26
30
  // requires that `.toString()` is only called on objects which provide useful information when stringified
27
31
  '@typescript-eslint/no-base-to-string': 2,
28
32
  // requires expressions of type void to appear in statement position