@viclafouch/eslint-config-viclafouch 3.7.1 → 3.8.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.
Files changed (2) hide show
  1. package/.eslintrc-base.js +49 -9
  2. package/package.json +3 -1
package/.eslintrc-base.js CHANGED
@@ -35,8 +35,34 @@ module.exports = {
35
35
  'react/prop-types': 'off',
36
36
  'simple-import-sort/imports': 'error',
37
37
  'react/jsx-props-no-spreading': 0,
38
+ 'no-return-await': 2,
38
39
  'import/prefer-default-export': 0,
40
+ 'react/jsx-boolean-value': 2,
41
+ 'react/self-closing-comp': 2,
42
+ 'react/hook-use-state': 2,
43
+ 'react/default-props-match-prop-types': 2,
44
+ 'react/no-unused-prop-types': 2,
45
+ 'react/no-unused-prop-types': 2,
46
+ 'promise/prefer-await-to-then': 2,
47
+ 'require-await': 2,
48
+ 'react/sort-prop-types': [
49
+ 2,
50
+ {
51
+ requiredFirst: true,
52
+ callbacksLast: true,
53
+ sortShapeProp: true
54
+ }
55
+ ],
56
+ 'curly': 2,
39
57
  'arrow-body-style': ['error', 'always'],
58
+ 'no-restricted-syntax': [
59
+ 'error',
60
+ {
61
+ selector:
62
+ "JSXElement > JSXExpressionContainer > LogicalExpression[operator!='??']",
63
+ message: 'Please use ternary operator instead',
64
+ },
65
+ ],
40
66
  'react/function-component-definition': [
41
67
  2,
42
68
  { namedComponents: 'arrow-function' }
@@ -64,16 +90,30 @@ module.exports = {
64
90
  'error',
65
91
  {
66
92
  groups: [
67
- // Packages. `react` related packages come first.
68
- // Things that start with a letter (or digit or underscore), or `@` followed by a letter.
69
- ['^react', '^next', '^@mui(/.*|$)', '^@?\\w'],
70
- // Absolute imports and Relative imports.
71
93
  [
72
- '^(utils|services|hooks|hoc|types|contexts|dictionary|components)(/.*|$)',
73
- '^\\.'
74
- ],
75
- // for scss imports.
76
- ['^[^.]']
94
+ // Anything that starts with react
95
+ // e.g: import { useState } from 'react'
96
+ // e.g: import { useFela } from 'react-fela'
97
+ '^react',
98
+ // Anything that starts with next
99
+ // e.g: import { useRouter } from 'next/router'
100
+ '^next',
101
+ // Anything that starts with a letter
102
+ // e.g: import Downshift from 'downshift'
103
+ '^[a-z]',
104
+ // Anything that starts with @
105
+ // e.g: import { yupResolver } from '@hookform/resolvers/yup'
106
+ '^@',
107
+ // Anything that starts with a dot
108
+ // e.g: import { matchIsDate } from './utils/date
109
+ '^\\.',
110
+ // Side effect imports from lib
111
+ // e.g: import 'react-toastify/dist/ReactToastify.css'
112
+ '^\\u0000',
113
+ // Side effect import that starts with a dot
114
+ // e.g: import './setup-config'
115
+ '^\\u0000\\.'
116
+ ]
77
117
  ]
78
118
  }
79
119
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viclafouch/eslint-config-viclafouch",
3
- "version": "3.7.1",
3
+ "version": "3.8.0",
4
4
  "description": "ESLint and Prettier Config from Victor de la Fouchardiere",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -35,6 +35,7 @@
35
35
  "eslint-plugin-import": "^2.26.0",
36
36
  "eslint-plugin-jsx-a11y": "^6.6.1",
37
37
  "eslint-plugin-prettier": "^4.2.1",
38
+ "eslint-plugin-promise": "^6.0.1",
38
39
  "eslint-plugin-react": "^7.31.7",
39
40
  "eslint-plugin-react-hooks": "^4.6.0",
40
41
  "eslint-plugin-simple-import-sort": "^8.0.0",
@@ -53,6 +54,7 @@
53
54
  "eslint-plugin-import": "^2.26.0",
54
55
  "eslint-plugin-jsx-a11y": "^6.6.1",
55
56
  "eslint-plugin-prettier": "^4.2.1",
57
+ "eslint-plugin-promise": "^6.0.1",
56
58
  "eslint-plugin-react": "^7.31.7",
57
59
  "eslint-plugin-react-hooks": "^4.6.0",
58
60
  "eslint-plugin-simple-import-sort": "^8.0.0",