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

feat: present meta.defaultOptions in the config inspector #110

Merged

Conversation

scottohara
Copy link
Contributor

@scottohara scottohara commented Dec 9, 2024

Implements #108

Utilises the newly available meta.defaultOptions (available since eslint v9.15.0) to introduce three UI changes:

  1. Adds a pair of buttons to the RuleStateItem component for toggling between the configured options and the default options for the rule:

image

  1. When viewing the configured options, any values that match the default are shown in italics and 75% opacity:

image

  1. If any configured options match the defaults, the "has options" indicator dot at the top right corner changes color to blue:

image

@scottohara
Copy link
Contributor Author

I'm guessing the failed lint step in the CI check is because the version of eslint that the CI job uses is older that 9.15.0?

[lint: app/composables/payload.ts#L97](https://github.com/eslint/config-inspector/pull/110/files#annotation_29547707307)
Property 'defaultOptions' does not exist on type 'RuleInfo'.

I did update the version in pnpm-workspace.yaml to ^9.16.0, but its likely that I've missed a critical step somewhere (as I'm not too familiar with pnpm).

Any suggestions on how to resolve this would be most welcome.

@antfu
Copy link
Collaborator

antfu commented Dec 10, 2024

The type was from @typescript-eslint, which seems to be missing that field - no worries at all, I am fixing it.

Thanks a lot for the well implemented PR!

@antfu antfu merged commit 9820d63 into eslint:main Dec 10, 2024
7 checks passed
@antfu antfu changed the title feat: present meta.defaultOptions in the config inspector feat: present meta.defaultOptions in the config inspector Dec 10, 2024
@scottohara scottohara deleted the feat/highlight-redundant-default-options branch December 10, 2024 04:58
@github-actions github-actions bot mentioned this pull request Dec 10, 2024
renovate bot added a commit to mmkal/eslint-plugin-mmkal that referenced this pull request Dec 10, 2024
##### [v0.6.0](https://github.com/eslint/config-inspector/blob/HEAD/CHANGELOG.md#060-2024-12-10)

##### Features

-   present `meta.defaultOptions` in the config inspector ([#110](eslint/config-inspector#110)) ([9820d63](eslint/config-inspector@9820d63))

##### Bug Fixes

-   add gap between number of rules and view switcher ([#105](eslint/config-inspector#105)) ([a3c4a7a](eslint/config-inspector@a3c4a7a))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants