eslint-plugin-crisp 1.2.10 → 1.2.12

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/README.md CHANGED
@@ -60,8 +60,9 @@ Each item has emojis denoting:
60
60
 
61
61
  | Name | Description | 🟠 | 🟢 | 🟣 |
62
62
  | :- | :- | :- | :- | :- |
63
- | [arrow-parens](https://eslint.org/docs/latest/rules/arrow-parens) | Requires parentheses around arrow function arguments | 🟠 | 🟢 | 🟣 |
63
+ | [array-callback-return](https://eslint.org/docs/latest/rules/array-callback-return) | Enforces `return` statements in callbacks of arrow function | 🟠 | 🟢 | 🟣 |
64
64
  | [arrow-body-style](https://eslint.org/docs/latest/rules/arrow-body-style) | Requires braces around arrow function bodies | | 🟢 | 🟣 |
65
+ | [arrow-parens](https://eslint.org/docs/latest/rules/arrow-parens) | Requires parentheses around arrow function arguments | 🟠 | 🟢 | 🟣 |
65
66
  | [brace-style](https://eslint.org/docs/latest/rules/brace-style) | Enforces one true brace style for blocks | 🟠 | 🟢 | 🟣 |
66
67
  | [comma-dangle](https://eslint.org/docs/latest/rules/comma-dangle) | Disallows trailing commas | 🟠 | 🟢 | 🟣 |
67
68
  | [comma-spacing](https://eslint.org/docs/latest/rules/comma-spacing) | Enforces consistent spacing before and after commas | | 🟢 | 🟣 |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-crisp",
3
- "version": "1.2.10",
3
+ "version": "1.2.12",
4
4
  "description": "Custom ESLint Rules for Crisp",
5
5
  "author": "Crisp IM SAS",
6
6
  "main": "index.js",
package/recommended-ts.js CHANGED
@@ -31,8 +31,9 @@ export default function configRecommendedTS(pluginCrisp) {
31
31
  "@typescript-eslint/no-unused-vars": "warn",
32
32
 
33
33
  // General JS rules
34
- "arrow-parens": ["error", "always"],
34
+ "array-callback-return": ["error", { checkForEach: true }],
35
35
  "arrow-body-style": ["error", "always"],
36
+ "arrow-parens": ["error", "always"],
36
37
  "brace-style": [
37
38
  "error",
38
39
  "1tbs",
@@ -48,8 +48,9 @@ export default function configRecommendedVue(pluginCrisp) {
48
48
 
49
49
  rules: {
50
50
  // General JS rules
51
- "arrow-parens": ["error", "always"],
51
+ "array-callback-return": ["error", { checkForEach: true }],
52
52
  "arrow-body-style": ["error", "always"],
53
+ "arrow-parens": ["error", "always"],
53
54
  "brace-style": [
54
55
  "error",
55
56
  "1tbs",
package/recommended.js CHANGED
@@ -40,6 +40,7 @@ export default function configRecommended(pluginCrisp) {
40
40
 
41
41
  rules: {
42
42
  // General JS rules
43
+ "array-callback-return": ["error", { checkForEach: true }],
43
44
  "arrow-parens": ["error", "always"],
44
45
  "brace-style": [
45
46
  "error",
@@ -44,7 +44,8 @@ export default {
44
44
 
45
45
  if (
46
46
  index === 1 &&
47
- /Object\.(keys|values|entries)\(/.test(match[1])
47
+ (/Object\.(keys|values|entries)\(/.test(match[1]) ||
48
+ /Array\.(from)\(/.test(match[1]))
48
49
  ) {
49
50
  // Ignore `Object.keys(foo || {})` (and others) as it cannot be \
50
51
  // safely transformed to optional chaining