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: adds option for allowing empty object patterns as parameter #17365

Merged
merged 5 commits into from Jul 21, 2023

Conversation

Tanujkanti4441
Copy link
Contributor

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[x] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)

Added a new option called allowObjectPatternsAsParameters in rule no-empty-pattern for allowing the empty object pattern in function parameters. Now var foo = ({}) => {} or var foo = ({} = {}) => {} will not give an error when option allowObjectPatternsAsParameters: true is applied.

Is there anything you'd like reviewers to focus on?

related to issue #16931

@Tanujkanti4441 Tanujkanti4441 requested a review from a team as a code owner July 14, 2023 13:28
@eslint-github-bot eslint-github-bot bot added the feature This change adds a new feature to ESLint label Jul 14, 2023
@netlify
Copy link

netlify bot commented Jul 14, 2023

Deploy Preview for docs-eslint canceled.

Name Link
🔨 Latest commit 2290b30
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/64b9053613542f00087cf6f4

@mdjermanovic mdjermanovic added rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion labels Jul 15, 2023
@mdjermanovic mdjermanovic linked an issue Jul 15, 2023 that may be closed by this pull request
1 task
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Can you also update the documentation for this rule:

https://github.com/eslint/eslint/blob/main/docs/src/rules/no-empty.md

@Tanujkanti4441
Copy link
Contributor Author

Thanks for the PR!

Can you also update the documentation for this rule:

https://github.com/eslint/eslint/blob/main/docs/src/rules/no-empty.md

Done!
Hope you meant https://github.com/eslint/eslint/blob/main/docs/src/rules/no-empty-pattern.md

docs/src/rules/no-empty-pattern.md Outdated Show resolved Hide resolved
docs/src/rules/no-empty-pattern.md Outdated Show resolved Hide resolved
@Tanujkanti4441
Copy link
Contributor Author

Tanujkanti4441 commented Jul 18, 2023

@mdjermanovic, have done the changes you suggested.
Thanks for such detailed review.

lib/rules/no-empty-pattern.js Outdated Show resolved Hide resolved
lib/rules/no-empty-pattern.js Outdated Show resolved Hide resolved
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! Leaving open for others to review since this is a new feature.

Copy link
Contributor

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@nzakas nzakas merged commit 1af6eac into eslint:main Jul 21, 2023
22 checks passed
@Tanujkanti4441 Tanujkanti4441 deleted the allow-object-parameter branch July 23, 2023 06:30
bmish added a commit to bmish/eslint that referenced this pull request Jul 23, 2023
* main: (101 commits)
  docs: Migrating `eslint-env` configuration comments (eslint#17390)
  Merge pull request from GHSA-qwh7-v8hg-w8rh
  feat: adds option for allowing empty object patterns as parameter (eslint#17365)
  fix: FlatESLint#getRulesMetaForResults shouldn't throw on unknown rules (eslint#17393)
  docs: fix Ignoring Files section in config migration guide (eslint#17392)
  docs: Update README
  feat: Improve config error messages (eslint#17385)
  fix: Update no-loop-func to not overlap with no-undef (eslint#17358)
  docs: Update README
  docs: Update README
  8.45.0
  Build: changelog update for 8.45.0
  chore: package.json update for @eslint/js release
  docs: add playground links to correct and incorrect code blocks (eslint#17306)
  docs: Expand rule option schema docs (eslint#17198)
  docs: Config Migration Guide (eslint#17230)
  docs: Update README
  fix: Fix suggestion message in `no-useless-escape` (eslint#17339)
  docs: Update README
  chore: update eslint-config-eslint exports (eslint#17336)
  ...
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Jan 18, 2024
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jan 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion contributor pool feature This change adds a new feature to ESLint rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule Change: no-empty-pattern allow parameters
4 participants