eslint-types / eslint-define-config

Provide a defineConfig function for .eslintrc.js files
MIT License
361 stars 26 forks source link

Export rule types #272

Closed linlinyang closed 9 months ago

linlinyang commented 9 months ago

It useful for define rules

Shinigami92 commented 9 months ago

I'm not sure if this is the right place :thinking:
Should maybe the @types/eslint / https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint updated?

jerone commented 9 months ago

I was actually looking for this. I have some rules that are inherited from ESLint and use the same schema. Instead of defining my own schema, I rather use the same from ESLint (here).

Shinigami92 commented 9 months ago

Please tell me which exact interfaces you want to use and why, and why it cant be added to @types/eslint itself. Then I will consider it.

jerone commented 9 months ago

Please tell me which exact interfaces you want to use and why, and why it cant be added to @types/eslint itself. Then I will consider it.

I want to use the eol-last rule schema.

If I understand it correctly, I cannot use the types from @types/eslint, because they are wrapped in their own Linter.RuleEntry.

To write a valid rule in my config, I get something like:

"my-rule/eol-last": ["error", "error", "always"],

(Notice the double "error")

linlinyang commented 9 months ago

I'm not sure if this is the right place 🤔 Should maybe the @types/eslint / https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint updated?

Shinigami92 commented 9 months ago

Here are some example links of how to progress further:

Thanks @linlinyang :+1: