Skip to content
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

refact: remove namespaces in favor of modules #236

Merged
merged 4 commits into from
Aug 8, 2024

Conversation

danielpza
Copy link
Member

@danielpza danielpza commented Aug 8, 2024

Removing typescript only namespaces in favor of using modules per typescript recommendation. This should produce more compliant code and output more readable javascript

From typescript

It is also worth noting that, for Node.js applications, modules are the default and we recommended modules over namespaces in modern code.

Starting with ECMAScript 2015, modules are native part of the language, and should be supported by all compliant engine implementations. Thus, for new projects modules would be the recommended code organization mechanism.

See the diff without whitespace changes

@danielpza danielpza marked this pull request as ready for review August 8, 2024 05:49
@danielpza danielpza force-pushed the use-modules-instead-of-namespaces branch from e49012d to a68654c Compare August 8, 2024 14:59
@danielpza danielpza requested a review from nonara August 8, 2024 15:05
@danielpza danielpza force-pushed the use-modules-instead-of-namespaces branch from 241bd9f to f2ffa3b Compare August 8, 2024 15:16
@danielpza danielpza merged commit af66d1c into master Aug 8, 2024
10 checks passed
@danielpza danielpza deleted the use-modules-instead-of-namespaces branch August 8, 2024 15:27
danielpza added a commit that referenced this pull request Aug 8, 2024
Removing typescript only namespaces in favor of using modules per
typescript recommendation. This should produce more compliant code and
output more readable javascript

[From
typescript](https://www.typescriptlang.org/docs/handbook/namespaces-and-modules.html#using-modules)

> It is also worth noting that, for Node.js applications, modules are
the default and we recommended modules over namespaces in modern code.

> Starting with ECMAScript 2015, modules are native part of the
language, and should be supported by all compliant engine
implementations. Thus, for new projects modules would be the recommended
code organization mechanism.

See [the
diff](https://github.com/LeDDGroup/typescript-transform-paths/pull/236/files?diff=unified&w=1)
without whitespace changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant