@robinblomberg/eslint-config-robinblomberg 0.17.0-beta4 → 0.17.0-beta6

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/index.js +179 -11
  2. package/package.json +5 -3
package/index.js CHANGED
@@ -11,7 +11,6 @@ module.exports = defineConfig({
11
11
  es2024: true,
12
12
  node: true,
13
13
  },
14
- extends: ['plugin:sonarjs/recommended', 'plugin:unicorn/recommended'],
15
14
  globals: {
16
15
  globalThis: true,
17
16
  },
@@ -400,6 +399,33 @@ module.exports = defineConfig({
400
399
  'require-await': off,
401
400
  semi: off,
402
401
  'space-before-function-paren': off,
402
+ 'unicorn/prefer-module': off,
403
+ },
404
+ },
405
+ // Taken from `storybook/recommended`:
406
+ {
407
+ files: [
408
+ '*.stories.@(ts|tsx|js|jsx|mjs|cjs)',
409
+ '*.story.@(ts|tsx|js|jsx|mjs|cjs)',
410
+ ],
411
+ rules: {
412
+ 'import/no-anonymous-default-export': off,
413
+ 'storybook/await-interactions': error,
414
+ 'storybook/context-in-play-function': error,
415
+ 'storybook/default-exports': error,
416
+ 'storybook/hierarchy-separator': warn,
417
+ 'storybook/no-redundant-story-name': warn,
418
+ 'storybook/prefer-pascal-case': warn,
419
+ 'storybook/story-exports': error,
420
+ 'storybook/use-storybook-expect': error,
421
+ 'storybook/use-storybook-testing-library': error,
422
+ },
423
+ },
424
+ // Taken from `storybook/recommended`:
425
+ {
426
+ files: ['.storybook/main.@(js|cjs|mjs|ts)'],
427
+ rules: {
428
+ 'storybook/no-uninstalled-addons': error,
403
429
  },
404
430
  },
405
431
  {
@@ -730,7 +756,15 @@ module.exports = defineConfig({
730
756
  requireConfigFile: false,
731
757
  sourceType: 'module',
732
758
  },
733
- plugins: ['import', 'jsdoc', 'sort-keys', 'sonarjs', 'unicorn'],
759
+ plugins: [
760
+ 'import',
761
+ 'jsdoc',
762
+ 'sort-exports',
763
+ 'sort-keys',
764
+ 'sonarjs',
765
+ 'storybook',
766
+ 'unicorn',
767
+ ],
734
768
  root: true,
735
769
  rules: {
736
770
  'accessor-pairs': warn,
@@ -1104,7 +1138,8 @@ module.exports = defineConfig({
1104
1138
  'no-multi-spaces': warn,
1105
1139
  'no-multi-str': warn,
1106
1140
  'no-multiple-empty-lines': [warn, { max: 1, maxEOF: 0 }],
1107
- 'no-negated-condition': warn,
1141
+ // Replaced by `unicorn/no-negated-condition`:
1142
+ 'no-negated-condition': off,
1108
1143
  'no-negated-in-lhs': warn,
1109
1144
  'no-nested-ternary': off,
1110
1145
  'no-new': warn,
@@ -1322,8 +1357,38 @@ module.exports = defineConfig({
1322
1357
  semi: [warn, 'always'],
1323
1358
  'semi-spacing': [warn, { after: true, before: false }],
1324
1359
  'semi-style': [warn, 'last'],
1325
- 'sonarjs/cognitive-complexity': 0,
1326
- 'sonarjs/no-nested-switch': 0,
1360
+ 'sonarjs/cognitive-complexity': off,
1361
+ 'sonarjs/elseif-without-else': off,
1362
+ 'sonarjs/max-switch-cases': off,
1363
+ 'sonarjs/no-all-duplicated-branches': warn,
1364
+ 'sonarjs/no-collapsible-if': warn,
1365
+ 'sonarjs/no-collection-size-mischeck': warn,
1366
+ 'sonarjs/no-duplicate-string': warn,
1367
+ 'sonarjs/no-duplicated-branches': warn,
1368
+ 'sonarjs/no-element-overwrite': warn,
1369
+ 'sonarjs/no-empty-collection': warn,
1370
+ 'sonarjs/no-extra-arguments': warn,
1371
+ 'sonarjs/no-gratuitous-expressions': warn,
1372
+ 'sonarjs/no-identical-conditions': warn,
1373
+ 'sonarjs/no-identical-expressions': warn,
1374
+ 'sonarjs/no-identical-functions': warn,
1375
+ 'sonarjs/no-ignored-return': warn,
1376
+ 'sonarjs/no-inverted-boolean-check': off,
1377
+ 'sonarjs/no-nested-switch': off,
1378
+ 'sonarjs/no-nested-template-literals': warn,
1379
+ 'sonarjs/no-one-iteration-loop': warn,
1380
+ 'sonarjs/no-redundant-boolean': warn,
1381
+ 'sonarjs/no-redundant-jump': warn,
1382
+ 'sonarjs/no-same-line-conditional': warn,
1383
+ 'sonarjs/no-small-switch': warn,
1384
+ 'sonarjs/no-unused-collection': warn,
1385
+ 'sonarjs/no-use-of-empty-return-value': warn,
1386
+ 'sonarjs/no-useless-catch': warn,
1387
+ 'sonarjs/non-existent-operator': warn,
1388
+ 'sonarjs/prefer-immediate-return': warn,
1389
+ 'sonarjs/prefer-object-literal': warn,
1390
+ 'sonarjs/prefer-single-boolean-return': warn,
1391
+ 'sonarjs/prefer-while': warn,
1327
1392
  'sort-imports': [
1328
1393
  off,
1329
1394
  {
@@ -1366,12 +1431,115 @@ module.exports = defineConfig({
1366
1431
  'template-curly-spacing': [warn, 'never'],
1367
1432
  'template-tag-spacing': [warn, 'never'],
1368
1433
  'unicode-bom': [warn, 'never'],
1369
- 'unicorn/no-nested-ternary': 0,
1370
- 'unicorn/no-null': 0,
1371
- 'unicorn/number-literal-case': 0,
1372
- 'unicorn/prefer-at': 0,
1373
- 'unicorn/prefer-number-properties': 0,
1374
- 'unicorn/prevent-abbreviations': 0,
1434
+ 'unicorn/better-regex': warn,
1435
+ 'unicorn/catch-error-name': warn,
1436
+ 'unicorn/consistent-destructuring': warn,
1437
+ 'unicorn/consistent-function-scoping': warn,
1438
+ 'unicorn/custom-error-definition': off,
1439
+ 'unicorn/empty-brace-spaces': warn,
1440
+ 'unicorn/error-message': warn,
1441
+ 'unicorn/escape-case': warn,
1442
+ 'unicorn/expiring-todo-comments': warn,
1443
+ 'unicorn/explicit-length-check': warn,
1444
+ 'unicorn/filename-case': warn,
1445
+ 'unicorn/import-style': warn,
1446
+ 'unicorn/new-for-builtins': warn,
1447
+ 'unicorn/no-abusive-eslint-disable': warn,
1448
+ 'unicorn/no-array-callback-reference': warn,
1449
+ 'unicorn/no-array-for-each': warn,
1450
+ 'unicorn/no-array-method-this-argument': warn,
1451
+ 'unicorn/no-array-push-push': warn,
1452
+ 'unicorn/no-array-reduce': warn,
1453
+ 'unicorn/no-await-expression-member': warn,
1454
+ 'unicorn/no-console-spaces': warn,
1455
+ 'unicorn/no-document-cookie': warn,
1456
+ 'unicorn/no-empty-file': warn,
1457
+ 'unicorn/no-for-loop': warn,
1458
+ 'unicorn/no-hex-escape': warn,
1459
+ 'unicorn/no-instanceof-array': warn,
1460
+ 'unicorn/no-invalid-remove-event-listener': warn,
1461
+ 'unicorn/no-keyword-prefix': off,
1462
+ 'unicorn/no-lonely-if': warn,
1463
+ 'unicorn/no-negated-condition': warn,
1464
+ 'unicorn/no-nested-ternary': off,
1465
+ 'unicorn/no-new-array': warn,
1466
+ 'unicorn/no-new-buffer': warn,
1467
+ 'unicorn/no-null': off,
1468
+ 'unicorn/no-object-as-default-parameter': warn,
1469
+ 'unicorn/no-process-exit': warn,
1470
+ 'unicorn/no-static-only-class': warn,
1471
+ 'unicorn/no-thenable': warn,
1472
+ 'unicorn/no-this-assignment': warn,
1473
+ 'unicorn/no-typeof-undefined': warn,
1474
+ 'unicorn/no-unnecessary-await': warn,
1475
+ 'unicorn/no-unreadable-array-destructuring': warn,
1476
+ 'unicorn/no-unreadable-iife': warn,
1477
+ 'unicorn/no-unused-properties': off,
1478
+ 'unicorn/no-useless-fallback-in-spread': warn,
1479
+ 'unicorn/no-useless-length-check': warn,
1480
+ 'unicorn/no-useless-promise-resolve-reject': warn,
1481
+ 'unicorn/no-useless-spread': warn,
1482
+ 'unicorn/no-useless-switch-case': warn,
1483
+ 'unicorn/no-useless-undefined': warn,
1484
+ 'unicorn/no-zero-fractions': warn,
1485
+ 'unicorn/number-literal-case': off,
1486
+ 'unicorn/numeric-separators-style': warn,
1487
+ 'unicorn/prefer-add-event-listener': warn,
1488
+ 'unicorn/prefer-array-find': warn,
1489
+ 'unicorn/prefer-array-flat-map': warn,
1490
+ 'unicorn/prefer-array-flat': warn,
1491
+ 'unicorn/prefer-array-index-of': warn,
1492
+ 'unicorn/prefer-array-some': warn,
1493
+ 'unicorn/prefer-at': warn,
1494
+ 'unicorn/prefer-blob-reading-methods': warn,
1495
+ 'unicorn/prefer-code-point': warn,
1496
+ 'unicorn/prefer-date-now': warn,
1497
+ 'unicorn/prefer-default-parameters': warn,
1498
+ 'unicorn/prefer-dom-node-append': warn,
1499
+ 'unicorn/prefer-dom-node-dataset': warn,
1500
+ 'unicorn/prefer-dom-node-remove': warn,
1501
+ 'unicorn/prefer-dom-node-text-content': warn,
1502
+ 'unicorn/prefer-event-target': warn,
1503
+ 'unicorn/prefer-export-from': warn,
1504
+ 'unicorn/prefer-includes': warn,
1505
+ 'unicorn/prefer-json-parse-buffer': off,
1506
+ 'unicorn/prefer-keyboard-event-key': warn,
1507
+ 'unicorn/prefer-logical-operator-over-ternary': warn,
1508
+ 'unicorn/prefer-math-trunc': warn,
1509
+ 'unicorn/prefer-modern-dom-apis': warn,
1510
+ 'unicorn/prefer-modern-math-apis': warn,
1511
+ 'unicorn/prefer-module': warn,
1512
+ 'unicorn/prefer-native-coercion-functions': warn,
1513
+ 'unicorn/prefer-negative-index': warn,
1514
+ 'unicorn/prefer-node-protocol': error,
1515
+ 'unicorn/prefer-number-properties': off,
1516
+ 'unicorn/prefer-object-from-entries': warn,
1517
+ 'unicorn/prefer-optional-catch-binding': warn,
1518
+ 'unicorn/prefer-prototype-methods': warn,
1519
+ 'unicorn/prefer-query-selector': warn,
1520
+ 'unicorn/prefer-reflect-apply': warn,
1521
+ 'unicorn/prefer-regexp-test': warn,
1522
+ 'unicorn/prefer-set-has': warn,
1523
+ 'unicorn/prefer-set-size': warn,
1524
+ 'unicorn/prefer-spread': warn,
1525
+ 'unicorn/prefer-string-replace-all': warn,
1526
+ 'unicorn/prefer-string-slice': warn,
1527
+ 'unicorn/prefer-string-starts-ends-with': warn,
1528
+ 'unicorn/prefer-string-trim-start-end': warn,
1529
+ 'unicorn/prefer-switch': warn,
1530
+ 'unicorn/prefer-ternary': warn,
1531
+ 'unicorn/prefer-top-level-await': warn,
1532
+ 'unicorn/prefer-type-error': warn,
1533
+ 'unicorn/prevent-abbreviations': off,
1534
+ 'unicorn/relative-url-style': warn,
1535
+ 'unicorn/require-array-join-separator': warn,
1536
+ 'unicorn/require-number-to-fixed-digits-argument': warn,
1537
+ 'unicorn/require-post-message-target-origin': off,
1538
+ 'unicorn/string-content': off,
1539
+ 'unicorn/switch-case-braces': warn,
1540
+ 'unicorn/template-indent': warn,
1541
+ 'unicorn/text-encoding-identifier-case': warn,
1542
+ 'unicorn/throw-new-error': warn,
1375
1543
  'use-isnan': warn,
1376
1544
  'valid-typeof': [warn, { requireStringLiterals: true }],
1377
1545
  'vars-on-top': warn,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinblomberg/eslint-config-robinblomberg",
3
- "version": "0.17.0-beta4",
3
+ "version": "0.17.0-beta6",
4
4
  "author": "Robin Blomberg",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -26,8 +26,10 @@
26
26
  "eslint-plugin-unicorn": "^48.0.1"
27
27
  },
28
28
  "devDependencies": {
29
- "@robinblomberg/eslint-config-robinblomberg": "0.17.0-beta3",
30
- "@types/node": "*"
29
+ "@robinblomberg/eslint-config-robinblomberg": "0.17.0-beta5",
30
+ "@types/node": "*",
31
+ "eslint-plugin-sort-exports": "^0.8.0",
32
+ "eslint-plugin-storybook": "^0.6.13"
31
33
  },
32
34
  "peerDependencies": {
33
35
  "eslint": "^8.43.0",