-
Notifications
You must be signed in to change notification settings - Fork 35
chore: [DHIS2-16607] Eslint - max-len rule #4380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…o 125 characters (#4379) * Change ESLint max-len rule from warning to error and increase length to 125 - Updated main .eslintrc: changed severity from 1 to 2 and length from 120 to 125 - Updated packages/rules-engine/.eslintrc: changed severity from 1 to 2 and length from 120 to 125 - Fixed all max-len violations in rules-engine package: - Fixed import statement in rulesEffectsProcessor.ts - Fixed multiple long lines in VariableService.ts by breaking them appropriately Co-Authored-By: [email protected] <[email protected]> * Fix max-len violations in multiple files - Fixed import statements in trackerCapture.epics.ts and trackerCapture.reducerDescriptions.ts - Fixed function signatures in IconButton components and validator files - Fixed SVG attributes and paths in PreviewImage and DropdownChevron components - Reduced max-len errors from 571 to 559 Co-Authored-By: [email protected] <[email protected]> * Fix max-len violations in validator and utility files - Fixed function signatures in phone, number, email, and integerZeroOrPositive validators - Fixed long regex pattern in email validator - Fixed function expressions in batchActionUtils Co-Authored-By: [email protected] <[email protected]> * Fix max-len violations in utility and component files - Fixed import statement in currentSelections.reducerDescription.ts - Fixed function signature in pipe.ts utility - Fixed string literal in StorageController.ts - Fixed array declaration in isCalendarSupported.ts - Fixed static method signature in Pagination component - Fixed hook return statement in useCurrentProgramInfo.ts Co-Authored-By: [email protected] <[email protected]> * Fix max-len violations in hooks and HOC components - Fixed function signature in useCurrentTrackedEntityTypeId hook - Fixed function signature in useAvailableProgramStages hook - Fixed function signatures in withLoadingIndicator HOC - Fixed HOC composition in TextRangeField component - Fixed function signatures and connect call in withStateBoundLoadingIndicator Co-Authored-By: [email protected] <[email protected]> * Fix max-len violations in storage adapter comments - Fixed long comment blocks in DomLocalStorageAdapter.ts - Fixed long comment blocks in IndexedDBAdapter.ts - Broke comments across multiple lines to fit within 125 character limit Co-Authored-By: [email protected] <[email protected]> * Fix max-len violations in date utils and UI components - Fixed long comment in date.utils.ts - Fixed long destructuring assignment in SingleSelectionBoxes component - Fixed long calendar type union in Date.types.ts - Fixed long error props object in DateTimeTime component Co-Authored-By: [email protected] <[email protected]> * Fix max-len violations in UI components and metadata builders - Fixed long className assignment in ShrinkLabel component - Fixed long destructuring and conditional in CoordinateField component - Fixed long className and callback assignments in AgeField component - Fixed long function signature in commonPrerequisitesGetter Co-Authored-By: [email protected] <[email protected]> * Fix max-len violations using find_and_edit across multiple files - Fixed long function signatures in converters and validators - Fixed long destructuring assignments in components and epics - Broke long parameter lists across multiple lines - Fixed long type definitions and callback functions Co-Authored-By: [email protected] <[email protected]> * Fix max-len violations in ternary operators across 29 files - Used find_and_edit to systematically fix long ternary expressions - Broke long conditional statements across multiple lines - Fixed violations in components, hooks, epics, and utility files - Maintained code readability while adhering to 125 character limit Co-Authored-By: [email protected] <[email protected]> * Fix max-len violations using systematic find_and_edit approach - Fixed logical AND expressions across 90 files - Fixed logical OR expressions across 21 files - Fixed long function calls and parentheses expressions across 85 files - Broke long expressions across multiple lines while maintaining readability - Total of 196 files successfully edited with automated approach Co-Authored-By: [email protected] <[email protected]> * Fix max-len violation in AppLoader init.ts - Break long string literal across multiple lines using concatenation - Line 185 reduced from 128 to under 125 characters Co-Authored-By: [email protected] <[email protected]> * Fix max-len violations in 161 files (126-135 character lines) - Break long lines across multiple lines while maintaining readability - Target lines that were slightly over the 125 character limit - Follow existing code formatting patterns and indentation - Continue systematic approach to fix remaining max-len violations Co-Authored-By: [email protected] <[email protected]> * Fix max-len violations in 79 files (136-145 character lines) - Break long lines across multiple lines while maintaining readability - Target lines that were 136-145 characters over the 125 character limit - Follow existing code formatting patterns and indentation - Continue systematic approach to fix remaining max-len violations Co-Authored-By: [email protected] <[email protected]> * Fix max-len violations in 52 files (146-160 character lines) - Break long lines across multiple lines while maintaining readability - Target lines that were 146-160 characters over the 125 character limit - Follow existing code formatting patterns and indentation - Continue systematic approach to fix remaining max-len violations Co-Authored-By: [email protected] <[email protected]> * Fix max-len violations in 33 files (161-200 character lines) - Break long lines across multiple lines while maintaining readability - Target lines that were 161-200 characters over the 125 character limit - Follow existing code formatting patterns and indentation - Continue systematic approach to fix remaining max-len violations Co-Authored-By: [email protected] <[email protected]> * Fix max-len violations in 16 files (200+ character lines) - Break extremely long lines across multiple lines while maintaining readability - Target lines that were over 200 characters, the longest violations - Follow existing code formatting patterns and indentation - Complete systematic approach to fix all max-len violations Co-Authored-By: [email protected] <[email protected]> * Fix TypeScript compilation errors introduced by automated line breaking - Correct import statements that were incorrectly split with string concatenation - Fix JSX syntax error in MultiSelectionCheckedIcon component - Restore proper import paths for all affected files - Ensure TypeScript compiler can process files for linter to run Co-Authored-By: [email protected] <[email protected]> * Remove trailing spaces from all source files - Fix no-trailing-spaces ESLint violations across 361 files - Clean up whitespace formatting to meet linting standards - Final cleanup before PR creation Co-Authored-By: [email protected] <[email protected]> * Fix additional max-len violations and formatting issues Co-Authored-By: [email protected] <[email protected]> * Fix long import statements to resolve max-len violations Co-Authored-By: [email protected] <[email protected]> * Fix parsing errors in import statements by removing string concatenation Co-Authored-By: [email protected] <[email protected]> * Fix parsing error and some max-len violations in icon components Co-Authored-By: [email protected] <[email protected]> * feat: temp --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: [email protected] <[email protected]> Co-authored-by: henrikmv <[email protected]> Co-authored-by: henrikmv <[email protected]>
|
🚀 Deployed on https://deploy-preview-4380.capture.netlify.dhis2.org |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request updates the ESLint configuration to enforce stricter line length rules, changing from warnings to errors and increasing the maximum line length to 125 characters. The changes focus on resolving existing ESLint max-length violations across the codebase without affecting functionality.
Key changes include:
- Updated ESLint configuration to enforce 125-character line length as errors instead of warnings
- Split long import statements, function parameters, and strings to comply with new rules
- Added strategic eslint-disable comments for cases where line breaks would affect i18n functionality
- Improved i18n string concatenation to ensure proper extraction to .pot files
Reviewed Changes
Copilot reviewed 300 out of 405 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Multiple component files | Split long import statements and function parameters across multiple lines |
| Various i18n usage files | Split concatenated i18n strings or added eslint-disable comments for untranslatable content |
| Configuration and helper files | Reformatted long object properties, API field specifications, and query parameters |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...re-core/components/WorkingLists/EventWorkingLists/helpers/eventFilters/getApiEventFilters.ts
Show resolved
Hide resolved
...ules/capture-core/components/WidgetsRelationship/common/useRelationships/useRelationships.ts
Show resolved
Hide resolved
...pture-core/components/WidgetsRelationship/common/RelationshipsWidget/useRelationshipTypes.ts
Show resolved
Hide resolved
simonadomnisoru
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall is looks good @henrikmv 👏 ! I only made a few small comments that I hope you can have a look at
...e_modules/capture-core/components/WidgetTwoEventWorkspace/OverflowMenu/Modal/UnlinkModal.tsx
Outdated
Show resolved
Hide resolved
...nts/WidgetsRelationship/common/RelationshipsWidget/DeleteRelationship/DeleteRelationship.tsx
Outdated
Show resolved
Hide resolved
...omponents/WidgetsRelationship/common/RelationshipsWidget/LinkedEntityTableBody.component.tsx
Outdated
Show resolved
Hide resolved
.../capture-core/components/WidgetTwoEventWorkspace/OverflowMenu/Modal/UnlinkAndDeleteModal.tsx
Show resolved
Hide resolved
|
|
🎉 This PR is included in version 104.3.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |




DHIS2-16607
This pull changes the ESLint Max Length rule from
warningtoerror. The main goal is to resolve existing ESLint max-length issues without introducing any changes to functionality.ESLint configuration updates:
.eslintrcandpackages/rules-engine/.eslintrc.Challenges
i18nproved difficult without affecting the.potfile or introducing unwanted whitespace.i18nfragments where natural.eslint-disablecomments were used to ignore max-length violations.Other important changes
i18n(e.g.i18n.t('string1' + 'string2')) prevents them from appearing in the.potfile.+, which explains the new entries in the.potfile.