@dmitryrechkin/eslint-standard 1.3.2 → 1.3.4

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/eslint.config.mjs +39 -7
  2. package/package.json +1 -1
package/eslint.config.mjs CHANGED
@@ -492,7 +492,7 @@ export default function ({
492
492
  'security/detect-child-process': 'warn',
493
493
  'security/detect-disable-mustache-escape': 'error',
494
494
  'security/detect-no-csrf-before-method-override': 'error',
495
- 'security/detect-object-injection': 'warn',
495
+ 'security/detect-object-injection': 'off', // Too many false positives with TypeScript enums
496
496
  'security/detect-possible-timing-attacks': 'warn',
497
497
  'security/detect-pseudoRandomBytes': 'error',
498
498
 
@@ -513,10 +513,7 @@ export default function ({
513
513
  'promise/prefer-await-to-callbacks': 'warn',
514
514
 
515
515
  // Import plugin rules
516
- 'import/no-unresolved': ['error', {
517
- ignore: ['\\.ts$', '\\.tsx$'],
518
- caseSensitive: false
519
- }],
516
+ 'import/no-unresolved': 'off', // Too many false positives with TypeScript
520
517
  'import/named': 'error',
521
518
  'import/default': 'error',
522
519
  'import/namespace': 'error',
@@ -625,7 +622,15 @@ export default function ({
625
622
  cases: {
626
623
  camelCase: true, // For folders: userAuth, licenseActivation
627
624
  pascalCase: true, // For class files: UserService.ts
628
- }
625
+ },
626
+ ignore: [
627
+ /.*API.*\.test\.ts$/, // Allow API in test files
628
+ /.*HTTP.*\.test\.ts$/, // Allow HTTP in test files
629
+ /.*URL.*\.test\.ts$/, // Allow URL in test files
630
+ /.*JSON.*\.test\.ts$/, // Allow JSON in test files
631
+ /.*XML.*\.test\.ts$/, // Allow XML in test files
632
+ /.*SQL.*\.test\.ts$/ // Allow SQL in test files
633
+ ]
629
634
  }],
630
635
  'unicorn/import-style': 'error',
631
636
  'unicorn/new-for-builtins': 'error',
@@ -766,7 +771,13 @@ export default function ({
766
771
  'functional/no-loop-statements': 'warn', // Encourage functional alternatives
767
772
  'functional/immutable-data': ['warn', {
768
773
  ignoreImmediateMutation: true,
769
- ignoreAccessorPattern: ['**.current', '**.ref']
774
+ ignoreAccessorPattern: [
775
+ '**.current',
776
+ '**.ref',
777
+ 'this.**', // Allow mutations to class properties
778
+ 'this[*].**', // Allow mutations to class indexed properties
779
+ 'global.**' // Allow mutations to global objects (test mocking)
780
+ ]
770
781
  }],
771
782
  'functional/no-throw-statements': 'off', // Allow throwing errors
772
783
  'functional/no-try-statements': 'off', // Allow try-catch
@@ -780,5 +791,26 @@ export default function ({
780
791
  ...rules,
781
792
  },
782
793
  },
794
+ // Test file specific overrides
795
+ {
796
+ files: ['**/*.test.{js,jsx,ts,tsx}', '**/*.spec.{js,jsx,ts,tsx}', '**/tests/**/*.{js,jsx,ts,tsx}'],
797
+ rules: {
798
+ // Disable function scoping rule for test helpers
799
+ 'unicorn/consistent-function-scoping': 'off',
800
+
801
+ // Allow test URLs and API endpoints without triggering secrets detection
802
+ 'no-secrets/no-secrets': 'off',
803
+
804
+ // Allow only universally understood abbreviations
805
+ 'id-length': ['warn', {
806
+ min: 3,
807
+ exceptions: ['id', 'fn']
808
+ }],
809
+
810
+ // Relax rules that are too strict for tests
811
+ 'unicorn/no-null': 'warn', // APIs often legitimately use null
812
+ 'functional/no-loop-statements': 'warn', // Loops can be clearer than functional alternatives in tests
813
+ },
814
+ },
783
815
  ];
784
816
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dmitryrechkin/eslint-standard",
3
3
  "description": "This package provides a shared ESLint configuration which includes TypeScript support and a set of specific linting rules designed to ensure high-quality and consistent code style across projects.",
4
- "version": "1.3.2",
4
+ "version": "1.3.4",
5
5
  "main": "eslint.config.mjs",
6
6
  "bin": {
7
7
  "eslint-standard": "./src/cli/index.mjs"