Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Docs: Add guidance for third party ESLint plugins and type checking #5444

Closed
Assignees
JoshuaKGoldberg
Labels
documentationDocumentation ("docs") that needs adding/updatinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.team assignedA member of the typescript-eslint team should work on this.
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Before You File a Documentation Request Please Confirm You Have Done The Following...

Suggested Changes

Forking fromjsx-eslint/eslint-plugin-jsx-a11y#812 (comment): ESLint plugins want to be able to use type checking in their rules. For example,eslint-plugin-jsx-a11y'sjsx-a11y/alt-text wants to be able to determine whether a spread provides a prop such asalt to an image that would make it obviously inaccessible.

// Is this statically known to be inaccessible?// We need type information to know!<imgsrc="something.jpg"{...myProps}/>

Copyingjsx-eslint/eslint-plugin-jsx-a11y#812 (comment):

A couple of implementation detail points that make being type-aware tricky:

  • If the rule uses the typescript-eslint tooling to be type-aware, it'll be locked into TypeScript (i.e. Flow and any future competitors won't work for its type checking)
  • In my (and other typescript-eslint maintainers') experience, it's generally confusing for users when rules provide different -even better!- results when the config changes to allow type checking

Those concerns might be small and not more important than getting better info. Either way, this scenario is something we probably need to make explicit docs for on typescript-eslint.io.

Out of curiosity@ljharb, have you seen other plugins add type-aware linting the way this issue is suggesting before?

Copyingjsx-eslint/eslint-plugin-jsx-a11y#812 (comment):

eslint-plugin-react and eslint-plugin-import have lots of examples to look at.

The one trick tho will be that we'll probably need to add the infrastructure for testing with the TS parser.


We'll want to document, at the very least:

I would mention other maintainers on those repos to ask for input too, but...@ljharb are you the only one? Are there other people we should loop in? 😂

Affected URL(s)

https://typescript-eslint.io/docs/development/custom-rules should probably link to this new page

Maybehttps://typescript-eslint.io/docs/development/custom-plugins or some similar URL?

Metadata

Metadata

Labels

documentationDocumentation ("docs") that needs adding/updatinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.team assignedA member of the typescript-eslint team should work on this.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp