-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Feature: [readonly-parameter-types et. al.] enhance allow
option to allow @types/ built-ins
#8572
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
Comments
readonly-parameter-types
prefer-readonly-parameter-types
Definitely not, no. Please see the rule docs. As for |
Thanks for the quick answer, so its only |
This isn't an enhancement - it's a bug. We don't handle the node special scoped packages in this function Which means we're looking for |
prefer-readonly-parameter-types
allow
option does not support Node.js builtin modules
Yes, I also tried to solve it here in a rough way. So, the only URL scheme which is allowed, is |
What about |
Whilst technically they are URL schemes I don't think we should be thinking about then like that. Instead we should just be treating them as a special namespace case. Eg |
Off-topic but here's a trivia: import { Foo } from "data:text/javascript, export class Foo {};"
console.log(new Foo()); This is valid code :) |
allow
option does not support Node.js builtin modules allow
option to allow @types/ built-ins
Before You File a Proposal Please Confirm You Have Done The Following...
Relevant Package
type-utils
My proposal is suitable for this project
Description
A few lines of context -
Steps to reproduce -
npx eslint src/index.ts
in terminalIs typescript-eslint open to include a config option like
{from: "package", name: "Foo", package: "data:text/javascript, export class Foo {};"}
, or with the other URL schemes(likefile:
), in the eslint config file ?There are 3 URL schemes in total -
node:
,file:
&data:
.I think
node:
will be required to solve #8404. I just want to know about the other 2.Additional Info
No response
The text was updated successfully, but these errors were encountered: