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

no-unstable-api-use: handle syntax that accesses properties #726

Open
ajafff opened this issue Dec 20, 2020 · 0 comments
Open

no-unstable-api-use: handle syntax that accesses properties #726

ajafff opened this issue Dec 20, 2020 · 0 comments

Comments

@ajafff
Copy link
Member

ajafff commented Dec 20, 2020

declare const p :  {
  /** @deprecated */
  then<T>(cb: (v: any) => T): Promise<T>;
};

await p; // should report deprecated 'then' property

declare const i: {
  /** @deprecated */
  [Symbol.iterator](): IterableIterator<any>;
  /** @experimental */
  [Symbol.asyncIterator](): AsyncIterableIterator<any>
}

for (const _ of i) {} // should report deprecated 'Symbol.iterator' property
for await (const _ of i) {} // should report experimental 'Symbol.asyncIterator' property

declare const i2: {
  [Symbol.iterator](): {
    /** @deprecated */
    next(): IteratorResult<any>
  }
}

for (const _ of i2) {} // should report deprecated 'next' property on iterator

This is certainly possible, but I doubt this is worth the effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant