-
-
Notifications
You must be signed in to change notification settings - Fork 208
fix: disallow extra properties in rule options #751
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
fix: disallow extra properties in rule options #751
Conversation
🦋 Changeset detectedLatest commit: 2f1eb39 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThe update refines the JSON schema validation for the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed everything up to 7aa6758 in 1 minute and 0 seconds. Click for details.
- Reviewed
13lines of code in1files - Skipped
0files when reviewing. - Skipped posting
1draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. eslint-plugin-prettier.js:169
- Draft comment:
Setting 'additionalProperties' to false here enforces strict validation for the second options object, preventing unnoticed typos. Ensure that allowing extra properties in the nested 'fileInfoOptions' (line 164-167) is intentional. - Reason this comment was not posted:
Comment looked like it was already resolved.
Workflow ID: wflow_GnEnsGcPuBrDPpsq
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
commit: |
7aa6758 to
300cbc7
Compare
| datasource | package | from | to | | ---------- | ---------------------- | ----- | ----- | | npm | eslint-plugin-prettier | 5.4.0 | 5.5.4 | ## [v5.5.4](https://github.com/prettier/eslint-plugin-prettier/blob/HEAD/CHANGELOG.md#554) ##### Patch Changes - [#755](prettier/eslint-plugin-prettier#755) [`723f7a8`](prettier/eslint-plugin-prettier@723f7a8) Thanks [@kbrilla](https://github.com/kbrilla)! - fix: add 'oxc', 'oxc-ts' and 'hermes' parsers to `parserBlocklist` - [#751](prettier/eslint-plugin-prettier#751) [`cf52b30`](prettier/eslint-plugin-prettier@cf52b30) Thanks [@andreww2012](https://github.com/andreww2012)! - fix: disallow extra properties in rule options ## [v5.5.3](https://github.com/prettier/eslint-plugin-prettier/releases/tag/v5.5.3) republish the latest version **Full Changelog**: prettier/eslint-plugin-prettier@v5.5.2...v5.5.3 ## [v5.5.2](https://github.com/prettier/eslint-plugin-prettier/releases/tag/v5.5.2) ### Changelog #### 5.5.1 ##### Patch Changes - [#748](prettier/eslint-plugin-prettier#748) [`bfd1e95`](prettier/eslint-plugin-prettier@bfd1e95) Thanks [@JounQin](https://github.com/JounQin)! - fix: use `prettierRcOptions` directly for prettier 3.6+ #### 5.5.0 ##### Minor Changes - [#743](prettier/eslint-plugin-prettier#743) [`92f2c9c`](prettier/eslint-plugin-prettier@92f2c9c) Thanks [@dotcarmen](https://github.com/dotcarmen)! - feat: support non-js languages like `css` for `@eslint/css` and `json` for `@eslint/json` #### 5.4.1 ##### Patch Changes - [#740](prettier/eslint-plugin-prettier#740) [`c21521f`](prettier/eslint-plugin-prettier@c21521f) Thanks [@JounQin](https://github.com/JounQin)! - fix(deps): bump `synckit` to v0.11.7 to fix potential `TypeError: Cannot read properties of undefined (reading 'message')` error #### 5.4.0 ##### Minor Changes - [#736](prettier/eslint-plugin-prettier#736) [`59a0cae`](prettier/eslint-plugin-prettier@59a0cae) Thanks [@yashtech00](https://github.com/yashtech00)! - refactor: migrate `worker.js` to `worker.mjs` #### 5.3.1 ##### Patch Changes - [#734](prettier/eslint-plugin-prettier#734) [`dcf2c80`](prettier/eslint-plugin-prettier@dcf2c80) Thanks [@JounQin](https://github.com/JounQin)! - ci: enable `NPM_CONFIG_PROVENANCE` env #### 5.3.0 ##### Minor Changes - [#674](prettier/eslint-plugin-prettier#674) [`6fe0c90`](prettier/eslint-plugin-prettier@6fe0c90) Thanks [@irsooti](https://github.com/irsooti)! - feat(types): prefer `Config` over `FlatConfig` when they're equal #### 5.2.6 ##### Patch Changes - [#723](prettier/eslint-plugin-prettier#723) [`1451176`](prettier/eslint-plugin-prettier@1451176) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): bump `synckit` to `v0.11.0` #### 5.2.5 ##### Patch Changes - [#721](prettier/eslint-plugin-prettier#721) [`4f5513d`](
The plugin rule currently allows extra properties to be passed in the second options object, which should not be allowed because they're not used by the rule, and this only makes it easier for typos in rule options to go unnoticed.
This PR simply disallows extra properties in this rule's schema.
Important
Disallows extra properties in the second options object of the
prettierrule schema ineslint-plugin-prettier.js.prettierrule schema ineslint-plugin-prettier.js.usePrettierrc,fileInfoOptions) are allowed, preventing unnoticed typos.This description was created by
for 7aa6758. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit
prettierrule by restricting allowed options to only explicitly defined properties, preventing the use of any additional unexpected settings.