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

Have you heard of Canonical? #66

Open
gajus opened this issue Nov 17, 2023 · 4 comments
Open

Have you heard of Canonical? #66

gajus opened this issue Nov 17, 2023 · 4 comments

Comments

@gajus
Copy link

gajus commented Nov 17, 2023

Don't want to spam, but just wanted to make you aware of https://github.com/gajus/eslint-plugin-canonical

{
  "extends": [
    "canonical/auto"
  ]
}

setups auto formatting using over 1,000+ ESLint rules. I've been maintaining this for 8 years.

The point of posting it here is to see if our efforts overlap and if you'd like to consolidate. @davidjbradshaw

@davidjbradshaw
Copy link
Owner

Hi,

Sorry for the slow reply, your project is new to me. I've mainly based this on the stuff listed at awesome-eslint. My aim has been to use recommend configs as much as possible, in order to avoid casting my own opinion on to the rules.

Are you also sniffing for installed packages, or is it up to the user to configure which bits they need?

@gajus
Copy link
Author

gajus commented Feb 14, 2024

It is entirely automatic.

I just realized I linked to plugin accidentally as opposed to the config https://github.com/gajus/eslint-config-canonical

@davidjbradshaw
Copy link
Owner

Just had a deeper look, it seems we have the same aim, but a slightly different approach.

My aim, and I guess yours aim as well, is to have a single ESLint config that covers every project that you can throw at it, rather than ending up with a different config in every project.

Looking at both projects, we have a slightly different set of eslint plugins, I expect we both have ones that the other hasn't come across before. At least looking at your list there are a few that are new to me.

I see you are maintaining your own ruleset for each plugin, where as I mainly use the recommended configs with as few as modifications as possible. These are mainly where two plugins over lap. I have to ask how are you maintaining all those config files? Are they automatically produced?

Then the biggest difference if I am reading your project correctly is that you load in everything, where as my project inspects package.json to see which JS packages your using and then only installs the eslint plugins that the project being listed actual needs. This is done to improve the performance of eslint.

Have a look at these two files, that show how the dynamic loading works.

https://github.com/davidjbradshaw/eslint-config-adjunct/blob/master/configs.js
https://github.com/davidjbradshaw/eslint-config-adjunct/blob/master/lib/missing.js

Going forward eslint changing to their new flat config format is a major headache for me, as this is a breaking change for my config and a single plugin switching format files breaks everything currently. I've not yet had time to workout a proper workaround for this.

How where you thinking these two projects should be consolidated?

@davidjbradshaw
Copy link
Owner

@gajus still interested in chatting about merging our two cofigs?

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

No branches or pull requests

2 participants