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

Duplicated namespaces are not fixed by ESLint plugin #27

Open
atachh opened this issue May 24, 2021 · 0 comments
Open

Duplicated namespaces are not fixed by ESLint plugin #27

atachh opened this issue May 24, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@atachh
Copy link
Contributor

atachh commented May 24, 2021

In case a node has two or more magic namespace comments, both the @tilework/mosaic/no-duplicate-namespaces and @tilework/mosaic/use-namespace ESLint rules are not working as expected.

Example flow:
Given this code (both namespaces are incorrect):

/** @namespace Hello/World */
/** @namespace Hello/World */
export const myFunction = () => 'hello world'; 

When the ESLint finished running, the actual output is:

/** @namespace PackageName/Valid/Namespace/myFunction */
/** @namespace Hello/World */
export const myFunction = () => 'hello world'; 

The invalid namespace is still present and neither of @tilework/mosaic/no-duplicate-namespaces or @tilework/mosaic/use-namespace ESLint rules treat this as an error.

Expected output:

/** @namespace PackageName/Valid/Namespace/myFunction */
export const myFunction = () => 'hello world'; 

Proposed solution:
ESLint rule @tilework/mosaic/no-duplicate-namespaces should throw an error if more than one namespace is present on a single node, and should remove one of them.

@atachh atachh added the enhancement New feature or request label May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant