Skip to content

Refactor re-exports to use export…from syntax#35

Open
sonarqube-agent[bot] wants to merge 1 commit into
mainfrom
remediate-main-20260610-090139-82e6c08c
Open

Refactor re-exports to use export…from syntax#35
sonarqube-agent[bot] wants to merge 1 commit into
mainfrom
remediate-main-20260610-090139-82e6c08c

Conversation

@sonarqube-agent

Copy link
Copy Markdown

This PR was automatically created by the Remediation Agent's Scheduled backlog remediation feature.

Why these issues? These issues follow a consistent, mechanical transformation pattern (converting to export…from syntax) and are isolated to a single file, enabling a cohesive refactoring with minimal risk and high confidence in automated remediation.

Converts 5 re-exported functions from manual import-and-export pattern to direct export…from statements in src/index.ts. This eliminates unnecessary intermediate imports and aligns with modern TypeScript best practices, resolving all SonarQube S7763 warnings in the module.

View Project in SonarCloud


Fixed Issues

typescript:S7763 - Use `export…from` to re-export `buildUnitTableRows`. • MINORView issue

Location: src/index.ts:27

Why is this an issue?

When re-exporting from a module, using separate import and export statements creates unnecessary verbosity and intermediate variables.

What changed

This hunk closes out the re-export of removeSpecialCharacters, insertSpecialCharacters, sanitiseForDb, and sanitiseForTsv using export { ... } from './handleSpecialCharacters/index' syntax, and opens a new export { block for the bulk uploads module. By converting these from the old pattern (where they were imported and then exported in a separate block) into direct export...from statements, this fixes the warnings about removeSpecialCharacters and insertSpecialCharacters being imported just to be re-exported. It also contributes to fixing the warnings for buildTableRows, parseUpdates, and buildUnitTableRows by starting the new export { ... } from './bulkUploads/index' block that is completed in hunk 4.

--- a/src/index.ts
+++ b/src/index.ts
@@ -24,0 +25,4 @@ export {
+  sanitiseForDb,
+  sanitiseForTsv,
+} from "./handleSpecialCharacters/index";
+export {
typescript:S7763 - Use `export…from` to re-export `parseUpdates`. • MINORView issue

Location: src/index.ts:26

Why is this an issue?

When re-exporting from a module, using separate import and export statements creates unnecessary verbosity and intermediate variables.

What changed

This hunk closes out the re-export of removeSpecialCharacters, insertSpecialCharacters, sanitiseForDb, and sanitiseForTsv using export { ... } from './handleSpecialCharacters/index' syntax, and opens a new export { block for the bulk uploads module. By converting these from the old pattern (where they were imported and then exported in a separate block) into direct export...from statements, this fixes the warnings about removeSpecialCharacters and insertSpecialCharacters being imported just to be re-exported. It also contributes to fixing the warnings for buildTableRows, parseUpdates, and buildUnitTableRows by starting the new export { ... } from './bulkUploads/index' block that is completed in hunk 4.

--- a/src/index.ts
+++ b/src/index.ts
@@ -24,0 +25,4 @@ export {
+  sanitiseForDb,
+  sanitiseForTsv,
+} from "./handleSpecialCharacters/index";
+export {
typescript:S7763 - Use `export…from` to re-export `removeSpecialCharacters`. • MINORView issue

Location: src/index.ts:23

Why is this an issue?

When re-exporting from a module, using separate import and export statements creates unnecessary verbosity and intermediate variables.

What changed

This hunk closes out the re-export of removeSpecialCharacters, insertSpecialCharacters, sanitiseForDb, and sanitiseForTsv using export { ... } from './handleSpecialCharacters/index' syntax, and opens a new export { block for the bulk uploads module. By converting these from the old pattern (where they were imported and then exported in a separate block) into direct export...from statements, this fixes the warnings about removeSpecialCharacters and insertSpecialCharacters being imported just to be re-exported. It also contributes to fixing the warnings for buildTableRows, parseUpdates, and buildUnitTableRows by starting the new export { ... } from './bulkUploads/index' block that is completed in hunk 4.

--- a/src/index.ts
+++ b/src/index.ts
@@ -24,0 +25,4 @@ export {
+  sanitiseForDb,
+  sanitiseForTsv,
+} from "./handleSpecialCharacters/index";
+export {
typescript:S7763 - Use `export…from` to re-export `insertSpecialCharacters`. • MINORView issue

Location: src/index.ts:24

Why is this an issue?

When re-exporting from a module, using separate import and export statements creates unnecessary verbosity and intermediate variables.

What changed

This hunk closes out the re-export of removeSpecialCharacters, insertSpecialCharacters, sanitiseForDb, and sanitiseForTsv using export { ... } from './handleSpecialCharacters/index' syntax, and opens a new export { block for the bulk uploads module. By converting these from the old pattern (where they were imported and then exported in a separate block) into direct export...from statements, this fixes the warnings about removeSpecialCharacters and insertSpecialCharacters being imported just to be re-exported. It also contributes to fixing the warnings for buildTableRows, parseUpdates, and buildUnitTableRows by starting the new export { ... } from './bulkUploads/index' block that is completed in hunk 4.

--- a/src/index.ts
+++ b/src/index.ts
@@ -24,0 +25,4 @@ export {
+  sanitiseForDb,
+  sanitiseForTsv,
+} from "./handleSpecialCharacters/index";
+export {
typescript:S7763 - Use `export…from` to re-export `buildTableRows`. • MINORView issue

Location: src/index.ts:25

Why is this an issue?

When re-exporting from a module, using separate import and export statements creates unnecessary verbosity and intermediate variables.

What changed

This hunk closes out the re-export of removeSpecialCharacters, insertSpecialCharacters, sanitiseForDb, and sanitiseForTsv using export { ... } from './handleSpecialCharacters/index' syntax, and opens a new export { block for the bulk uploads module. By converting these from the old pattern (where they were imported and then exported in a separate block) into direct export...from statements, this fixes the warnings about removeSpecialCharacters and insertSpecialCharacters being imported just to be re-exported. It also contributes to fixing the warnings for buildTableRows, parseUpdates, and buildUnitTableRows by starting the new export { ... } from './bulkUploads/index' block that is completed in hunk 4.

--- a/src/index.ts
+++ b/src/index.ts
@@ -24,0 +25,4 @@ export {
+  sanitiseForDb,
+  sanitiseForTsv,
+} from "./handleSpecialCharacters/index";
+export {

Have a suggestion or found an issue? Share your feedback here.


SonarQube Remediation Agent uses AI. Check for mistakes.

Fixed issues:
- AZnd_k0G9LJ6Ep7Rin_0 for typescript:S7763 rule
- AZnd_k0G9LJ6Ep7Rin_1 for typescript:S7763 rule
- AZnd_k0G9LJ6Ep7Rin_2 for typescript:S7763 rule
- AZnd_k0G9LJ6Ep7Rin_3 for typescript:S7763 rule
- AZnd_k0G9LJ6Ep7Rin_4 for typescript:S7763 rule

Generated by SonarQube Agent (task: baf47321-b2d5-44b0-8857-db3fd705ca05)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant