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

Add a Typescript variant #120

Open
zaicevas opened this issue Jan 24, 2022 · 7 comments
Open

Add a Typescript variant #120

zaicevas opened this issue Jan 24, 2022 · 7 comments

Comments

@zaicevas
Copy link

Some community ESLint plugins (e.g. https://github.com/testing-library/eslint-plugin-testing-library) use typescript. I think it'd be a great idea to have a typescript variant of the generated boilerplate. It'd be something similar to CRA: npx create-react-app my-app --template typescript.

I am not too familiar with yeoman, so I am not sure if it ought to be a different generator or some kind of a parameter could be passed. In any case, is that something that is of interest to others?

@bmish
Copy link
Member

bmish commented Jan 27, 2022

I do think it would be nice for us to support both ESM plugins and TypeScript plugins. The plugin generator could ask:

What type of plugin do you want to generate?
- CommonJS (default)
- ESM
- TypeScript

And then the rule generator would presumably detect what kind of plugin is present to generate the appropriate rule format.

But I think both of these new types depend on there existing a simple, single, standardized/recommended way of writing plugins in each of these manners. We need to find some good, minimal examples of plugins written with ESM and/or TypeScript to base these off of (let us know if you have some).

@sam3k
Copy link

sam3k commented Feb 9, 2023

Are we talking about this template in generator-eslint? If so, I wonder if it makes sense to just provide a TS template for plugins? What about rules?

@bmish bmish added enhancement and removed triage labels Feb 10, 2023
@bmish
Copy link
Member

bmish commented Feb 10, 2023

Yes, I think we would need separate templates for each type of plugin we can generate:

  • plugin (existing, CJS)
  • plugin-esm
  • plugin-ts
  • rule (existing, CJS)
  • rule-esm
  • rule-ts

@sam3k
Copy link

sam3k commented Feb 11, 2023

Imho, it would be really nice to provide TypeScript templates nowadays considering the popularity; but not sure if this goes against our policies.

@bmish
Copy link
Member

bmish commented Feb 11, 2023

@JoshuaKGoldberg @bradzacher is there a standard template for new TypeScript plugins/rules anywhere or could we put one together to use in this generator?

@JoshuaKGoldberg
Copy link

Not that I know of, but it'd be great to have one here! I'd be happy to help - lmk if you want a review or for me to just do it 😄

@bradzacher
Copy link

Nah a plugin template it's not something we've invested in just because it's not something people need too too much.

I don't think we've even really written docs about it?
We have a little stuff that Josh has written here https://typescript-eslint.io/custom-rules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Feedback Needed
Development

No branches or pull requests

5 participants