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
[ban-types] Doesn't work with namespaced type #135
Comments
The rule is intentionally simple, but it looks like we made it too simple. The last part of your issue
Or else with the default config this would fail /*
{
types: {
String: {
message: 'Use string instead',
fixWith: 'string'
},
}
*/
namespace Foo {
export type String = 'some string';
}
// error: Use string instead
const x : Foo.String = 'some string'; (i've added the bug tag for this half of the issue) |
in regards to your actual reported issue. I.e. if you supply a key with a |
No, I meant removing |
@bradzacher its not going to error, we have check for namespaces / let e: foo.String; |
Is the goal of this rule to replace the TSLint rule? I arrived at this issue because I found that the ESLint ban-types rule doesn't support regex rules, which I was using in TSLint, and was hoping to start migrating over to ESLint. Is the simplicity of the rule driven by performance requirements, or something else? |
@bradleyayers - with time a lot of the tslint rules build up features that nobody ends up using. When contributors PR rules, we don't look for exact 1:1 parity with tslint, because asking contributors to do a bunch of extra work that nobody has asked for yet (and may never ask for) is a good way to annoy people and turn away contributors. With that being said, we encourage and accept PRs - so if there's something that you think is missing and you'll get value out of, please feel free to raise an issue and/or a PR. |
Repro
Expected Result
Should be reported, and fixed to
React.FC
Actual Result
Not reported
Additional Info
Removing
React.
from the rule and the code makes it work correctlyVersions
@typescript-eslint/eslint-plugin
1.1.0
@typescript-eslint/parser
1.1.0
TypeScript
3.2.4
ESLint
5.12.1
node
10.15.0
yarn
1.13.0
The text was updated successfully, but these errors were encountered: