eslint-config-heck 10.2.2 → 11.0.0-beta.2

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/nodeWithBiome.js +106 -154
  2. package/package.json +6 -8
package/nodeWithBiome.js CHANGED
@@ -1,9 +1,12 @@
1
+ import reactX from "@eslint-react/eslint-plugin";
1
2
  import stylistic from "@stylistic/eslint-plugin";
2
3
  import typescriptEslint from "@typescript-eslint/eslint-plugin";
3
4
  import tsParser from "@typescript-eslint/parser";
4
- import importPlugin from "eslint-plugin-import-x";
5
+ import importPlugin, {
6
+ createNodeResolver,
7
+ flatConfigs,
8
+ } from "eslint-plugin-import-x";
5
9
  import jest from "eslint-plugin-jest";
6
- import react from "eslint-plugin-react";
7
10
  import testingLibrary from "eslint-plugin-testing-library";
8
11
  import unicorn from "eslint-plugin-unicorn";
9
12
  import globals from "globals";
@@ -12,8 +15,8 @@ import globals from "globals";
12
15
  export default [
13
16
  {
14
17
  plugins: {
18
+ react: reactX,
15
19
  "@stylistic": stylistic,
16
- react,
17
20
  unicorn,
18
21
  importPlugin,
19
22
  },
@@ -35,8 +38,10 @@ export default [
35
38
  },
36
39
  },
37
40
  settings: {
38
- react: {
41
+ "react-x": {
39
42
  version: "detect",
43
+ importSource: "react",
44
+ polymorphicPropName: "as",
40
45
  },
41
46
  },
42
47
  rules: {
@@ -290,7 +295,9 @@ export default [
290
295
  "unicode-bom": "error",
291
296
 
292
297
  // @stylistic
293
- "@stylistic/jsx-pascal-case": "off",
298
+ "@stylistic/jsx-child-element-spacing": "error",
299
+ "@stylistic/jsx-curly-brace-presence": ["error", "always"],
300
+ "@stylistic/jsx-pascal-case": "error",
294
301
  "@stylistic/max-statements-per-line": "off",
295
302
  "@stylistic/multiline-comment-style": ["error", "separate-lines"],
296
303
  "@stylistic/no-floating-decimal": "off",
@@ -351,158 +358,99 @@ export default [
351
358
  "@stylistic/quote-props": "off",
352
359
  "@stylistic/spaced-comment": ["error", "always"],
353
360
 
354
- // eslint-plugin-react
355
- "react/boolean-prop-naming": "off",
356
- "react/button-has-type": "off",
357
- "react/checked-requires-onchange-or-readonly": "error",
358
- "react/default-props-match-prop-types": "off",
359
- "react/destructuring-assignment": [
360
- "error",
361
- "always",
362
- {
363
- destructureInSignature: "always",
364
- },
365
- ],
366
- "react/display-name": "off",
367
- "react/forbid-component-props": "off",
368
- "react/forbid-dom-props": "off",
369
- "react/forbid-elements": "off",
370
- "react/forbid-foreign-prop-types": "off",
371
- "react/forbid-prop-types": "off",
372
- "react/forward-ref-uses-ref": "error",
373
- "react/function-component-definition": [
374
- "error",
375
- {
376
- namedComponents: "function-declaration",
377
- unnamedComponents: "arrow-function",
378
- },
379
- ],
380
- "react/hook-use-state": [
381
- "error",
382
- {
383
- allowDestructuredState: true,
384
- },
385
- ],
386
- "react/iframe-missing-sandbox": "off",
387
- "react/jsx-boolean-value": "off",
388
- "react/jsx-child-element-spacing": "error",
389
- "react/jsx-closing-bracket-location": "off",
390
- "react/jsx-closing-tag-location": "off",
391
- "react/jsx-curly-brace-presence": ["error", "always"],
392
- "react/jsx-curly-spacing": "off",
393
- "react/jsx-equals-spacing": "off",
394
- "react/jsx-filename-extension": [
395
- "error",
396
- {
397
- extensions: [".jsx", ".tsx"],
398
- },
399
- ],
400
- "react/jsx-first-prop-new-line": "off",
401
- "react/jsx-fragments": "off",
402
- "react/jsx-handler-names": "error",
403
- "react/jsx-key": "off",
404
- "react/jsx-max-depth": "off",
405
- "react/jsx-newline": "off",
406
- "react/jsx-no-bind": [
407
- "error",
408
- {
409
- allowArrowFunctions: true,
410
- },
411
- ],
412
- "react/jsx-no-comment-textnodes": "off",
413
- "react/jsx-no-constructed-context-values": "error",
414
- "react/jsx-no-duplicate-props": "off",
415
- "react/jsx-no-leaked-render": "off",
416
- "react/jsx-no-literals": "off",
417
- "react/jsx-no-script-url": "off",
418
- "react/jsx-no-target-blank": "off",
419
- "react/jsx-no-undef": [
420
- "error",
421
- {
422
- allowGlobals: false,
423
- },
424
- ],
425
- "react/jsx-no-useless-fragment": "off",
426
- "react/jsx-pascal-case": "error",
427
- "react/jsx-props-no-spread-multi": "off",
428
- "react/jsx-props-no-spreading": "off",
429
- "react/jsx-sort-props": "off",
430
- "react/jsx-tag-spacing": "off",
431
- "react/jsx-uses-react": "off",
432
- "react/jsx-uses-vars": "error",
433
- "react/jsx-wrap-multilines": "off",
361
+ // @eslint-react/eslint-plugin
362
+ // X Rules
363
+ "react/error-boundaries": "error",
364
+ "react/exhaustive-deps": "off",
365
+ "react/globals": "error",
366
+ "react/immutability": "error",
434
367
  "react/no-access-state-in-setstate": "error",
435
- "react/no-adjacent-inline-elements": "error",
436
368
  "react/no-array-index-key": "off",
437
- "react/no-arrow-function-lifecycle": "error",
438
- "react/no-children-prop": "off",
439
- "react/no-danger": "off",
440
- "react/no-danger-with-children": "off",
441
- "react/no-deprecated": "warn",
442
- "react/no-did-mount-set-state": "error",
443
- "react/no-did-update-set-state": "error",
369
+ "react/no-children-count": "error",
370
+ "react/no-children-for-each": "error",
371
+ "react/no-children-map": "error",
372
+ "react/no-children-only": "error",
373
+ "react/no-children-to-array": "error",
374
+ "react/no-class-component": "warn",
375
+ "react/no-clone-element": "error",
376
+ "react/no-component-will-mount": "warn",
377
+ "react/no-component-will-receive-props": "warn",
378
+ "react/no-component-will-update": "warn",
379
+ "react/no-context-provider": "warn",
380
+ "react/no-create-ref": "warn",
444
381
  "react/no-direct-mutation-state": "error",
445
- "react/no-find-dom-node": "error",
446
- "react/no-invalid-html-attribute": "error",
447
- "react/no-is-mounted": "error",
448
- "react/no-multi-comp": "off",
449
- "react/no-namespace": "off",
450
- "react/no-object-type-as-default-prop": "error",
451
- "react/no-redundant-should-component-update": "error",
452
- "react/no-render-return-value": "off",
453
- "react/no-set-state": "off",
454
- "react/no-string-refs": "off",
455
- "react/no-this-in-sfc": "error",
456
- "react/no-typos": "error",
457
- "react/no-unescaped-entities": "error",
458
- "react/no-unknown-property": "off",
459
- "react/no-unsafe": "error",
460
- "react/no-unstable-nested-components": "error",
461
- "react/no-unused-class-component-methods": "error",
462
- "react/no-unused-prop-types": "error",
382
+ "react/no-duplicate-key": "error",
383
+ "react/no-forward-ref": "warn",
384
+ "react/no-implicit-children": "error",
385
+ "react/no-implicit-key": "error",
386
+ "react/no-implicit-ref": "error",
387
+ "react/no-leaked-conditional-rendering": "off",
388
+ "react/no-missing-component-display-name": "warn",
389
+ "react/no-missing-context-display-name": "warn",
390
+ "react/no-missing-key": "off",
391
+ "react/no-misused-capture-owner-stack": "error",
392
+ "react/no-nested-component-definitions": "error",
393
+ "react/no-nested-lazy-component-declarations": "error",
394
+ "react/no-set-state-in-component-did-mount": "error",
395
+ "react/no-set-state-in-component-did-update": "error",
396
+ "react/no-set-state-in-component-will-update": "error",
397
+ "react/no-unnecessary-use-prefix": "warn",
398
+ "react/no-unsafe-component-will-mount": "error",
399
+ "react/no-unsafe-component-will-receive-props": "error",
400
+ "react/no-unsafe-component-will-update": "error",
401
+ "react/no-unstable-context-value": "error",
402
+ "react/no-unstable-default-props": "error",
403
+ "react/no-unused-class-component-members": "error",
404
+ "react/no-unused-props": "error",
463
405
  "react/no-unused-state": "error",
464
- "react/no-will-update-set-state": "error",
465
- "react/prefer-es6-class": ["error", "always"],
466
- "react/prefer-exact-props": "off",
467
- "react/prefer-read-only-props": "off",
468
- "react/prefer-stateless-function": "error",
469
- "react/prop-types": "off",
470
- "react/react-in-jsx-scope": "off",
471
- "react/require-default-props": "off",
472
- "react/require-optimization": "off",
473
- "react/require-render-return": "error",
474
- "react/self-closing-comp": "off",
475
- "react/sort-comp": [
476
- "error",
477
- {
478
- order: [
479
- "static-variables",
480
- "instance-variables",
481
- "static-methods",
482
- "lifecycle",
483
- "render",
484
- "everything-else",
485
- ],
486
- groups: {
487
- render: ["render", "/^render.+$/"],
488
- },
489
- },
490
- ],
491
- "react/sort-default-props": "off",
492
- "react/sort-prop-types": [
493
- "error",
494
- {
495
- callbacksLast: true,
496
- ignoreCase: true,
497
- requiredFirst: true,
498
- sortShapeProp: true,
499
- noSortAlphabetically: true,
500
- },
501
- ],
502
- "react/state-in-constructor": "error",
503
- "react/static-property-placement": "off",
504
- "react/style-prop-object": "error",
505
- "react/void-dom-elements-no-children": "off",
406
+ "react/no-use-context": "warn",
407
+ "react/purity": "error",
408
+ "react/refs": "error",
409
+ "react/rules-of-hooks": "error",
410
+ "react/set-state-in-effect": "error",
411
+ "react/set-state-in-render": "error",
412
+ "react/static-components": "error",
413
+ "react/unsupported-syntax": "error",
414
+ "react/use-memo": "error",
415
+ "react/use-state": "error",
416
+ // JSX Rules
417
+ "react/jsx-no-children-prop": "error",
418
+ "react/jsx-no-children-prop-with-children": "error",
419
+ "react/jsx-no-comment-textnodes": "error",
420
+ "react/jsx-no-key-after-spread": "error",
421
+ "react/jsx-no-leaked-dollar": "off",
422
+ "react/jsx-no-leaked-semicolon": "error",
423
+ "react/jsx-no-namespace": "off",
424
+ "react/jsx-no-useless-fragment": "off",
425
+ // RSC Rules
426
+ "react/rsc-function-definition": "error",
427
+ // DOM Rules
428
+ "react/dom-no-dangerously-set-innerhtml": "off",
429
+ "react/dom-no-dangerously-set-innerhtml-with-children": "off",
430
+ "react/dom-no-find-dom-node": "error",
431
+ "react/dom-no-flush-sync": "error",
432
+ "react/dom-no-hydrate": "warn",
433
+ "react/dom-no-missing-button-type": "off",
434
+ "react/dom-no-missing-iframe-sandbox": "off",
435
+ "react/dom-no-render": "warn",
436
+ "react/dom-no-render-return-value": "error",
437
+ "react/dom-no-script-url": "error",
438
+ "react/dom-no-string-style-prop": "error",
439
+ "react/dom-no-unknown-property": "off",
440
+ "react/dom-no-unsafe-iframe-sandbox": "off",
441
+ "react/dom-no-unsafe-target-blank": "off",
442
+ "react/dom-no-use-form-state": "warn",
443
+ "react/dom-no-void-elements-with-children": "off",
444
+ // Web API Rules
445
+ "react/web-api-no-leaked-event-listener": "error",
446
+ "react/web-api-no-leaked-fetch": "error",
447
+ "react/web-api-no-leaked-interval": "error",
448
+ "react/web-api-no-leaked-resize-observer": "error",
449
+ "react/web-api-no-leaked-timeout": "error",
450
+ // Naming Convention Rules
451
+ "react/naming-convention-context-name": "warn",
452
+ "react/naming-convention-id-name": "warn",
453
+ "react/naming-convention-ref-name": "warn",
506
454
 
507
455
  // eslint-plugin-unicorn
508
456
  "unicorn/better-regex": "error",
@@ -645,7 +593,6 @@ export default [
645
593
  "unicorn/prefer-string-trim-start-end": "off",
646
594
  "unicorn/prefer-structured-clone": "error",
647
595
  "unicorn/prefer-switch": "error",
648
-
649
596
  // TODO: off until there is a solution to this: https://github.com/sindresorhus/eslint-plugin-unicorn/issues/1079
650
597
  "unicorn/prefer-ternary": "off",
651
598
  "unicorn/prefer-top-level-await": "off",
@@ -720,6 +667,11 @@ export default [
720
667
  },
721
668
  {
722
669
  files: ["**/*.ts", "**/*.tsx"],
670
+ ...flatConfigs.typescript,
671
+ settings: {
672
+ ...flatConfigs.typescript.settings,
673
+ "import-x/resolver-next": [createNodeResolver()],
674
+ },
723
675
  },
724
676
  {
725
677
  files: ["**/*.ts", "**/*.tsx"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-heck",
3
- "version": "10.2.2",
3
+ "version": "11.0.0-beta.2",
4
4
  "description": "Contains an ESLint configuration for ES2015+, TypeScript, and React.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -28,14 +28,12 @@
28
28
  "license": "MIT",
29
29
  "dependencies": {
30
30
  "@stylistic/eslint-plugin": "5.10.0",
31
- "@typescript-eslint/eslint-plugin": "8.59.4",
32
- "@typescript-eslint/parser": "8.59.4",
33
- "eslint": "9.39.4",
34
- "eslint-import-resolver-typescript": "4.4.4",
31
+ "@typescript-eslint/eslint-plugin": "8.59.3",
32
+ "@typescript-eslint/parser": "8.59.3",
33
+ "@eslint-react/eslint-plugin": "5.8.3",
34
+ "eslint": "10.4.0",
35
35
  "eslint-plugin-import-x": "4.16.2",
36
36
  "eslint-plugin-jest": "29.15.2",
37
- "eslint-plugin-react": "7.37.5",
38
- "eslint-plugin-react-hooks": "7.1.1",
39
37
  "eslint-plugin-testing-library": "7.16.2",
40
38
  "eslint-plugin-unicorn": "64.0.0",
41
39
  "typescript": "6.0.3"
@@ -45,7 +43,7 @@
45
43
  "@testing-library/dom": "10.4.1",
46
44
  "@testing-library/react": "16.3.2",
47
45
  "@types/jest": "30.0.0",
48
- "@types/react": "19.2.15",
46
+ "@types/react": "19.2.14",
49
47
  "globals": "17.6.0",
50
48
  "jest": "30.4.2",
51
49
  "react": "19.2.6",