Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Conversation

@weirdpattern
Copy link
Collaborator

This includes

New rule no-namespace
Corresponding test
Corresponding documentation
Update to README.md to include the new rule

@weirdpattern
Copy link
Collaborator Author

Hi @dannyfritz, could you please reference this PR from #5

@dannyfritz dannyfritz mentioned this pull request Jan 13, 2017
31 tasks
@weirdpattern
Copy link
Collaborator Author

thinking about splitting this into two separate rules by removing the allowLegacyExternalModule, will work on this tonight...

# Conflicts:
#	docs/rules/no-namespace.md
#	lib/rules/no-namespace.js
#	tests/lib/rules/no-namespace.js
@weirdpattern
Copy link
Collaborator Author

Ok, this is ready for review

Copy link
Collaborator

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

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

Thanks so much for this, @weirdpattern!

The implementation is looking really good, just some docs changes to get this over the line.

@@ -0,0 +1,95 @@
# Disallows the use of `internal modules` and `namespaces`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we please call them "custom TypeScript modules" just to be 100% clear in differentiating them from ES2015 modules. "Internal" feels too vague here.

@@ -0,0 +1,95 @@
# Disallows the use of `internal modules` and `namespaces`.

Internal modules (`module foo {}`) and namespaces (`namespace foo {}`) are considered outdated
Copy link
Collaborator

Choose a reason for hiding this comment

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

Again "custom TypeScript modules"

Internal modules (`module foo {}`) and namespaces (`namespace foo {}`) are considered outdated
ways to organize TypeScript code. ES2015 module syntax is now preferred.

This rule still allows the use of external modules (`declare module 'foo' {}`).
Copy link
Collaborator

Choose a reason for hiding this comment

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

the use of "TypeScript module declarations to describe external APIs"


This rule aims to standardise the way TypeScript modules are declared.

## Options
Copy link
Collaborator

Choose a reason for hiding this comment

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

It does not feel right to have a rule called "no-" and then have the exceptions enabled by default.

Please change the defaults for both exceptions to false.

}

/**
* Determines if node is either a declaration.
Copy link
Collaborator

Choose a reason for hiding this comment

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

"either a declaration"....or?

@@ -0,0 +1,117 @@
/**
* @fileoverview Disallows the use of internal modules and namespaces.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Again please could we amend the use of "internal vs external" in this file to something more TypeScript specific. I do not feel it is clear enough what internal and external denote.

@weirdpattern
Copy link
Collaborator Author

will work on these later today!
thanks for the review

@weirdpattern
Copy link
Collaborator Author

@JamesHenry this is ready, thanks!

@JamesHenry JamesHenry merged commit 8cefa97 into bradzacher:master Jan 16, 2017
@JamesHenry
Copy link
Collaborator

Thanks a lot!

@weirdpattern weirdpattern deleted the no-namespace branch January 16, 2017 12:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants