-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
New rules regarding namespaces used as values #532
Comments
I like it. Probably makes sense as a separate rule (vs. an option on I don't understand this part of the warnings, though:
Are you saying destructuring to a deep namespace is not allowed? If so, if the import was resolved, it would actually know whether I think, to that end, that even if this rule did use the resolver infrastructure for that, it makes sense as a separate rule. |
👍 for a different rule. The idea is good, but I agree that some of the failing examples should be fine: func(foo);
func(...foo);
const {child} = foo; This use seems a bit odd, but not wrong though I think (or please enlighten me). |
Regarding I'll note that |
I agree it should be its own rule, I just proposed the option idea in case that was too much.
Correct.
I do feel this might actually be best as a set of related rules:
Errors are basically static errors that can be known with minimal type context to generate a runtime error (and any sane config will reject them). Warnings are a matter of opinion, but they can increase file size of Rollup bundles if you're not careful (they require a frozen object to be created). |
I like where that's heading, a rule cluster makes sense. Though I think maybe the existing The ones that remain:
make sense separately as style-guide rules (in service of ideal Rollup bundling). |
I like that idea, although I'll bikeshed the name of the catch-all known On Tue, Aug 30, 2016, 11:33 Ben Mosher [email protected] wrote:
|
👍 |
I'll admit I'm not that familiar with writing ESLint rules, though. So I'm On Thu, Sep 1, 2016, 04:50 Ben Mosher [email protected] wrote:
|
The following patterns are considered not warnings:
The following patterns are considered warnings:
Basically, warn if a namespace is used in a way that cannot be validated (aliased, called, destructured as array, passed as argument, etc.). There's no overlap with
namespace.allowComputed
in the above, but that option could be merged into this one, or these merged into anothernamespace
option.The text was updated successfully, but these errors were encountered: