Skip to content

Commit c7da93a

Browse files
committed
move rules to more specific override
1 parent 58bcd1c commit c7da93a

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

packages/eslint-config-sdk/src/index.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ module.exports = {
167167
},
168168
},
169169
{
170-
// Configuration for test files
170+
// Configuration for files in test directories
171171
env: {
172172
jest: true,
173173
},
@@ -195,6 +195,23 @@ module.exports = {
195195
"jest/no-disabled-tests": "error",
196196
},
197197
},
198+
{
199+
// Configuration only for test files (this won't apply to utils or other files in test directories)
200+
env: {
201+
jest: true,
202+
},
203+
files: ['test.ts', '*.test.ts', '*.test.tsx', '*.test.js', '*.test.jsx'],
204+
rules: {
205+
// Prevent permanent usage of `it.only`, `fit`, `test.only` etc
206+
// We want to avoid debugging leftovers making their way into the codebase
207+
"jest/no-focused-tests": "error",
208+
209+
// Prevent permanent usage of `it.skip`, `xit`, `test.skip` etc
210+
// We want to avoid debugging leftovers making their way into the codebase
211+
// If there's a good reason to skip a test (e.g. bad flakiness), just add an ignore comment
212+
"jest/no-disabled-tests": "error",
213+
},
214+
},
198215
{
199216
// Configuration for config files like webpack/rollup
200217
files: ['*.config.js'],

0 commit comments

Comments
 (0)