Skip to content

Conversation

@hazzard993
Copy link
Contributor

@hazzard993 hazzard993 commented Nov 11, 2020

Thought I'd take a look at this page since self parameter questions are the most common questions we get

Some users might look for an FAQ section before asking

  • Moved docs/advanced/functions-and-the-self-parameter to docs/the-self-parameter
  • Added section "Why is it there by default", rewording the top of the document
  • Added information about noImplicitSelf
  • Updated wording of the Assignment Errors section to describe the error as being an incompatibility between two types
  • Updated Assignment Errors to quote the errors instead of having them in code comments
  • Adjusted some wording to keep it ~5 minute read

@hazzard993 hazzard993 changed the title Add discord in side bar and update self parameter information Update self parameter information Nov 11, 2020

## Removing it

### `noImplicitSelf`
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should leave it as the last option, since more likely users would want to disable this behavior for Lua declarations, which are generally not affected by noImplicitSelf

Comment on lines 11 to 13
Telling TypeScript not to allow `this` to be used will eliminate that parameter from its containing context.

Other workarounds are available for removing this too.
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to mention that disabling it should be done only when it's required for interop, but not for regular code

sidebars.json Outdated
},
{
"type": "category",
"label": "FAQ",
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think we'll have more FAQ in the future? If we don't, I think it could be a top-level page, probably after "caveats" in the sidebar

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we might, but good idea to keep it top level for now

@Perryvw Perryvw merged commit 9366a3a into TypeScriptToLua:source Dec 12, 2020
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.

3 participants