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

noahdarveau/namespace eslint plugin #2690

Merged
merged 6 commits into from
Jan 23, 2025
Merged

Conversation

noahdarveau-MSFT
Copy link
Contributor

For more information about how to contribute to this repo, visit this page.

Description

Summarize the changes, including the goals and reasons for this change. Be sure to call out any technical or behavior changes that reviewers should be aware of.

If this Pull Request should close/resolve any issues when merged, use the special syntax for that here.

Main changes in the PR:

  1. Added an eslint plugin rule that will throw an error whenever a namespace is used in the codebase. The error message informs the developer that namespaces should not be used as they are not treeshakable and modules should be used instead. It also instructs the developer that if it is ABSULUTELY necessary to use a namespace, they can ignore the eslint rule and add a comment explaining why a namespace is necessary to in this situation.

Validation

Validation performed:

  1. Manually tested the functionality of the plugin.

@noahdarveau-MSFT noahdarveau-MSFT requested a review from a team as a code owner January 21, 2025 23:27
@@ -13,5 +13,6 @@ module.exports = {
],
'no-inner-declarations': 'off',
'strict-null-checks/all': 'warn',
'recommend-no-namespaces/recommend-no-namespaces': 'warn',
Copy link
Contributor

@AE-MS AE-MS Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know there weren't a lot of items before you got here but please consider alphabetizing this and the plugins list above. #Closed

"name": "eslint-plugin-recommend-no-namespaces",
"version": "0.1.0",
"license": "MIT",
"author": "Noah",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noah

lol

category: 'Best Practices',
recommended: true,
},
fixable: true,
Copy link
Contributor

@AE-MS AE-MS Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this rule definition need to have a fix section in the create part in order to make it fixable? Is this a rule we really want to enable auto-fixing on? #Closed

Copy link
Contributor

@AE-MS AE-MS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

Copy link
Contributor

@AE-MS AE-MS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@noahdarveau-MSFT noahdarveau-MSFT merged commit 9ec9c03 into main Jan 23, 2025
39 checks passed
@noahdarveau-MSFT noahdarveau-MSFT deleted the noahdarveau/eslint-plugin branch January 23, 2025 22:10
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.

3 participants