@dmitryrechkin/eslint-standard 1.3.1 → 1.3.3
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/eslint.config.mjs +39 -4
- package/package.json +1 -1
package/eslint.config.mjs
CHANGED
|
@@ -298,7 +298,7 @@ export default function ({
|
|
|
298
298
|
format: ['PascalCase'],
|
|
299
299
|
leadingUnderscore: 'forbid',
|
|
300
300
|
custom: {
|
|
301
|
-
regex: 'Interface$',
|
|
301
|
+
regex: '(^Type[A-Z]|Interface$)',
|
|
302
302
|
match: true
|
|
303
303
|
}
|
|
304
304
|
},
|
|
@@ -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': '
|
|
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
|
|
|
@@ -625,7 +625,15 @@ export default function ({
|
|
|
625
625
|
cases: {
|
|
626
626
|
camelCase: true, // For folders: userAuth, licenseActivation
|
|
627
627
|
pascalCase: true, // For class files: UserService.ts
|
|
628
|
-
}
|
|
628
|
+
},
|
|
629
|
+
ignore: [
|
|
630
|
+
/.*API.*\.test\.ts$/, // Allow API in test files
|
|
631
|
+
/.*HTTP.*\.test\.ts$/, // Allow HTTP in test files
|
|
632
|
+
/.*URL.*\.test\.ts$/, // Allow URL in test files
|
|
633
|
+
/.*JSON.*\.test\.ts$/, // Allow JSON in test files
|
|
634
|
+
/.*XML.*\.test\.ts$/, // Allow XML in test files
|
|
635
|
+
/.*SQL.*\.test\.ts$/ // Allow SQL in test files
|
|
636
|
+
]
|
|
629
637
|
}],
|
|
630
638
|
'unicorn/import-style': 'error',
|
|
631
639
|
'unicorn/new-for-builtins': 'error',
|
|
@@ -766,7 +774,13 @@ export default function ({
|
|
|
766
774
|
'functional/no-loop-statements': 'warn', // Encourage functional alternatives
|
|
767
775
|
'functional/immutable-data': ['warn', {
|
|
768
776
|
ignoreImmediateMutation: true,
|
|
769
|
-
ignoreAccessorPattern: [
|
|
777
|
+
ignoreAccessorPattern: [
|
|
778
|
+
'**.current',
|
|
779
|
+
'**.ref',
|
|
780
|
+
'this.**', // Allow mutations to class properties
|
|
781
|
+
'this[*].**', // Allow mutations to class indexed properties
|
|
782
|
+
'global.**' // Allow mutations to global objects (test mocking)
|
|
783
|
+
]
|
|
770
784
|
}],
|
|
771
785
|
'functional/no-throw-statements': 'off', // Allow throwing errors
|
|
772
786
|
'functional/no-try-statements': 'off', // Allow try-catch
|
|
@@ -780,5 +794,26 @@ export default function ({
|
|
|
780
794
|
...rules,
|
|
781
795
|
},
|
|
782
796
|
},
|
|
797
|
+
// Test file specific overrides
|
|
798
|
+
{
|
|
799
|
+
files: ['**/*.test.{js,jsx,ts,tsx}', '**/*.spec.{js,jsx,ts,tsx}', '**/tests/**/*.{js,jsx,ts,tsx}'],
|
|
800
|
+
rules: {
|
|
801
|
+
// Disable function scoping rule for test helpers
|
|
802
|
+
'unicorn/consistent-function-scoping': 'off',
|
|
803
|
+
|
|
804
|
+
// Allow test URLs and API endpoints without triggering secrets detection
|
|
805
|
+
'no-secrets/no-secrets': 'off',
|
|
806
|
+
|
|
807
|
+
// Allow only universally understood abbreviations
|
|
808
|
+
'id-length': ['warn', {
|
|
809
|
+
min: 3,
|
|
810
|
+
exceptions: ['id', 'fn']
|
|
811
|
+
}],
|
|
812
|
+
|
|
813
|
+
// Relax rules that are too strict for tests
|
|
814
|
+
'unicorn/no-null': 'warn', // APIs often legitimately use null
|
|
815
|
+
'functional/no-loop-statements': 'warn', // Loops can be clearer than functional alternatives in tests
|
|
816
|
+
},
|
|
817
|
+
},
|
|
783
818
|
];
|
|
784
819
|
}
|
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.
|
|
4
|
+
"version": "1.3.3",
|
|
5
5
|
"main": "eslint.config.mjs",
|
|
6
6
|
"bin": {
|
|
7
7
|
"eslint-standard": "./src/cli/index.mjs"
|