-
-
Notifications
You must be signed in to change notification settings - Fork 26
Conversation
0b31fba
to
1912cbf
Compare
I'm sorry I just responding so lately 🙇 I'm not yet sure I would like to support this plugin:
eslint-define-config is designed to still be able to define such rules and plugins, you just don't get auto-completion TLDR: if your issue description gets (I would say) 5 votes (:+1:) I will consider merging/supporting this plugin :slightly_smiling_face: |
Yes, this plugin has been released than a week ago.
The plugin takes care of security and takes into account such things as comments of object values, spread operators, etc. Okay. Let's come back to this conversation later. |
This plugin has 1.1k+ stars now, let's make it happen? :) |
Actually we are working on something, so we do not need internal support anymore in But (sadly) I'm a bit exhausted right now of work, open-source and coding This feature would solve support for any plugins out there and work a bit like This perfection plugin would fit absolutely best to try out the feature for that 👍 |
1912cbf
to
4e16449
Compare
Didn't see the message. I rebased my PR and updated plugin. Just in case you change your mind. |
Hey @azat-io, could we do a test with your plugin? 🙂 I released a v2.0.0-alpha.0 in #238 (comment) So I would like to try out to add rule types to your plugin and then we can see if it works If it works as I would like, then I can slowly remove all the other plugins and ask for their own support |
Sounds cool, let's give it a try |
with v2.0.0-beta.1 you now can support with your own types 🚀 You can have a look into https://github.com/eslint-types/define-config-plugin-types/blob/main/scripts/generate-plugin-dts.ts to find out how to generate these types |
Can I generate plugin types? |
As you are the author and owner of https://github.com/azat-io/eslint-plugin-perfectionist, I suggest to add the eslint-define-config support directly into your repo/package, instead of adding it to https://github.com/eslint-types/define-config-plugin-types. So you can have a look into https://github.com/eslint-types/define-config-plugin-types/blob/main/scripts/generate-plugin-dts.ts and see how I generate types out of You can either take this script and adjust to your needs, or directly add types into your rules. So for example: you could add following into your https://github.com/azat-io/eslint-plugin-perfectionist/blob/main/rules/sort-array-includes.ts export interface Schema0 {
type?: 'alphabetical' | 'line-length'| 'natural';
order?: 'asc' | 'desc';
// ... further stuff
}
export type SortArrayIncludesRuleOptions = [Schema0?]; Then you create a import type { SortArrayIncludesRuleOptions } from './rules/sort-array-includes';
declare module 'eslint-define-config' {
export interface CustomExtends {
'plugin:eslint-plugin-perfectionist/recommended-alphabetical': void;
'plugin:eslint-plugin-perfectionist/recommended-line-length': void;
'plugin:eslint-plugin-perfectionist/recommended-natural': void;
}
export interface CustomPlugins {
'eslint-plugin-perfectionist': void;
}
export interface CustomRuleOptions {
/**
* enforce sorted arrays before include method
*/
'eslint-plugin-perfectionist/sort-array-includes': SortArrayIncludesRuleOptions;
// more rules ...
}
// It's also possible that you have `CustomParsers`, `CustomParserOptions` and/or `CustomSettings`.
} A user/dev of "exports": {
// ...
"./define-config-support.d.ts": {
"types": "./dist/define-config-support.d.ts",
},
// ... |
Hi!
I created ESLint Plugin Perfectionist:
https://github.com/azat-io/eslint-plugin-perfectionist
This PR adds support for its types.