Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: add name to flat config (for tooling) #243

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

brettz9
Copy link
Member

@brettz9 brettz9 commented Jul 24, 2024

ESLint recommends a name for flat configs.

Tools like https://github.com/eslint/config-inspector can use this to indicate the source of rules.

I did not add it to the older, non-flat configs because it will err there.

Copy link

codecov bot commented Jul 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.87%. Comparing base (e0f326f) to head (332c5cd).
Report is 10 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #243   +/-   ##
=======================================
  Coverage   97.87%   97.87%           
=======================================
  Files          17       17           
  Lines         282      282           
=======================================
  Hits          276      276           
  Misses          6        6           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@brettz9
Copy link
Member Author

brettz9 commented Aug 12, 2024

@voxpelli : Could you take a look?

@voxpelli
Copy link
Member

The one thing I'm thinking is whether we should include the @eslint-community/ prefix or not – do we do that elsewhere already?

From https://eslint.org/docs/latest/use/configure/configuration-files#configuration-naming-conventions :

The name should be descriptive of the configuration object’s purpose and scoped with the configuration name or plugin name using / as a separator.

Eg. the config-inspector will color the @eslint-community and eslint-comments differently, making it kind of look like @eslint-community is the name of the module 🤔

Skärmavbild 2024-08-15 kl  09 53 25

I guess we can do this and open an issue in the config inspector to handle @-prefixes.

ESLint itself is also doing something funny with @ itself, the default plugin being named "@": https://github.com/eslint/eslint/blob/21d3766c3f4efd981d3cc294c2c82c8014815e6e/lib/config/default-config.js#L20-L44

voxpelli added a commit to voxpelli/config-inspector that referenced this pull request Aug 15, 2024
@voxpelli
Copy link
Member

Actually tried out "fixing" this in config-inspector, but I think its actually better as is.

When scope and module name is treated as one:

Skärmavbild 2024-08-15 kl  11 19 12

When its split like today:

Skärmavbild 2024-08-15 kl  11 20 11

The latter look better I think

@voxpelli voxpelli merged commit c993b63 into eslint-community:main Aug 15, 2024
19 checks passed
@brettz9 brettz9 deleted the name branch August 15, 2024 09:23
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants