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

Enable the 'noUnusedParameters' TypeScript setting #764

Closed

Conversation

paulmelnikow
Copy link
Contributor

@paulmelnikow paulmelnikow commented Mar 28, 2019

This removes noUnusedParameters: false, one of the tasks in the checklist at #758.

After reading these documents, it seems like either _ or e.g. _unusedRequest is a good replacement name which silences the errors for these parameters

Looking forward to comments, and curious if you have another way in mind.

Checklist

  • I have read the documentation.
  • I have included a pull request description of my changes.
  • I have included some tests.
  • If it's a new feature, I have included documentation updates.

This removes `noUnusedParameters: false`, one of the tasks in the checklist at sindresorhus#758.

After reading these documents, it seems like either `_` or e.g. `_unusedRequest` is a good replacement name which silences the errors for these parameters

- microsoft/TypeScript#24249
- microsoft/TypeScript#9458
@@ -14,11 +14,11 @@ test.before('setup', async () => {

// HTTPS Handlers

https.on('/', (request, response) => {
https.on('/', (_unusedRequest, response) => {
Copy link
Owner

Choose a reason for hiding this comment

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

I think just _request would be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'll change it if you'd like. I went with this because with _request, it seems likely that if in the future the code were changed and did start to use the parameter, the programmer likely would not know to remove the underscore. Whereas if you start calling things on _unusedRequest it screams that the name should be changed.

@sindresorhus
Copy link
Owner

Sorry, this was made moot by #765.

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

Successfully merging this pull request may close these issues.

2 participants