You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A file with comments but without code is considered empty. More finesse would be appreciated.
Example: I would like to disallow empty files in general, but I would like to allow *.test.ts(x) files to contain only comments
Use case:
// File: useScreenSizeHint.test.ts// No need to write tests here, useScreenSizeHint.ts source code is already tested by ScreenSizeHintProvider.test.tsx
ESLint configuration:
rules: {'unicorn/no-empty-file': 'error'},overrides: [{files: ['**/*.test.ts','**/*.test.tsx'],rules: {// Empty test files with comments are legit'unicorn/no-empty-file': ['error',{allow: ['comments']}]},}]
The text was updated successfully, but these errors were encountered:
no-empty-file
isn't configurableA file with comments but without code is considered empty. More finesse would be appreciated.
Example: I would like to disallow empty files in general, but I would like to allow *.test.ts(x) files to contain only comments
Use case:
ESLint configuration:
The text was updated successfully, but these errors were encountered: