# Linting and Code Navigation in the code editor

**URL:** <https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465>\
**Category:** Announcements\
**Created:** [January 19, 2023, 9:54am UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465 "2023-01-19T09:54:35Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![gmvbif](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/gmvbif/32/21830_2.png) [@gmvbif](https://forum.defold.com/u/gmvbif)\
**Post date:** [January 21, 2023, 8:18am UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/21 "2023-01-21T08:18:20Z")

</div>

Looks like there is somethins wrong with bundling when you have this dependecy included. I tried it on empty project and it gives a lot of errors and some other stuff in console.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [January 21, 2023, 8:47am UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/22 "2023-01-21T08:47:52Z")

</div>

I think it might be helpful if you post platform you’re using and also the errors you get?

---

<div class="post-metadata">

**Author:** ![gmvbif](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/gmvbif/32/21830_2.png) [@gmvbif](https://forum.defold.com/u/gmvbif)\
**Post date:** [January 21, 2023, 9:03am UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/23 "2023-01-21T09:03:37Z")

</div>

I am using MacOs 12.6 and latest stable editor\engine. Tested on the template mobile project.

[condole.txt](https://forum.defold.com/uploads/short-url/go9hAQIb7gH9PoHoPWi4MaWQuBs.txt) (97.1 KB)  
[errors.txt](https://forum.defold.com/uploads/short-url/rPYECMSiryauI5NJgFSw3lifj9G.txt) (3.7 KB)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [January 21, 2023, 2:28pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/24 "2023-01-21T14:28:48Z")

</div>

That’s a bit odd. The files of the LSP server should be excluded completely, but apparently that is somehow not working.

---

<div class="post-metadata">

**Author:** ![Pawel](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pawel/32/24623_2.png) [@Pawel](https://forum.defold.com/u/Pawel)\
**Post date:** [January 21, 2023, 4:48pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/25 "2023-01-21T16:48:28Z")

</div>

Tested it (Ubuntu 20.04), works seamlessly and is a great additional to the built-in Editor! 😉

---

<div class="post-metadata">

**Author:** ![vlaaad](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/vlaaad/32/10538_2.png) [@vlaaad](https://forum.defold.com/u/vlaaad)\
**Post date:** [January 24, 2023, 7:33am UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/26 "2023-01-24T07:33:20Z")

</div>

I can reproduce the issue. While we work on a fix, you can create a `.defignore` file in the root folder and add `/build/plugins` line there as a workaround.

---

<div class="post-metadata">

**Author:** ![WhiteBoxDev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/whiteboxdev/32/36080_2.png) [@WhiteBoxDev](https://forum.defold.com/u/WhiteBoxDev)\
**Post date:** [January 25, 2023, 3:38am UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/27 "2023-01-25T03:38:39Z")

</div>

Thank you, that fixed the problem.

Edit: Wow this is really useful. 😮

Edit Edit: Wow this is catching intricate bugs just a month before deploying to Steam! Glad this exists.

---

<div class="post-metadata">

**Author:** ![jorpak](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jorpak/32/30815_2.png) [@jorpak](https://forum.defold.com/u/jorpak)\
**Post date:** [January 25, 2023, 5:47pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/28 "2023-01-25T17:47:21Z")

</div>

This is awesome 😄

---

<div class="post-metadata">

**Author:** ![Pawel](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pawel/32/24623_2.png) [@Pawel](https://forum.defold.com/u/Pawel)\
**Post date:** [January 25, 2023, 8:13pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/29 "2023-01-25T20:13:29Z")

</div>

Yeah, that’s why I many times, even when used to code in Defold Editor, had to open my projects in VSCode once in a while just to check out such hints from linters and code checkers. Having this now directly in Defold makes life way easier! 🤩

---

<div class="post-metadata">

**Author:** ![WhiteBoxDev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/whiteboxdev/32/36080_2.png) [@WhiteBoxDev](https://forum.defold.com/u/WhiteBoxDev)\
**Post date:** [January 26, 2023, 3:06pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/30 "2023-01-26T15:06:15Z")

</div>

Unable to bundle my project in Windows Debug mode (create .exe) unless I remove this extension. Anyone else have this problem?

---

<div class="post-metadata">

**Author:** ![vlaaad](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/vlaaad/32/10538_2.png) [@vlaaad](https://forum.defold.com/u/vlaaad)\
**Post date:** [January 26, 2023, 3:22pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/31 "2023-01-26T15:22:55Z")

</div>

Have you tried adding `build/plugins` to `.defignore`?

---

<div class="post-metadata">

**Author:** ![totebo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/totebo/32/36087_2.png) [@totebo](https://forum.defold.com/u/totebo)\
**Post date:** [January 26, 2023, 3:39pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/32 "2023-01-26T15:39:12Z")

</div>

> [@vlaaad](#):
>
> [https://github.com/defold/lua-language-server/releases/download/v0.0.3/release.zip](https://github.com/defold/lua-language-server/releases/download/v0.0.3/release.zip)

Just got around to trying this now. My heavily refactored code has so many loose ends, feels great to finally clean it up! Thanks so much for releasing this, a wonderful addition to Defold.

---

<div class="post-metadata">

**Author:** ![anon95708182](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/a/ce7236/32.png) [@anon95708182](https://forum.defold.com/u/anon95708182)\
**Post date:** [February 8, 2023, 1:19pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/33 "2023-02-08T13:19:36Z")

</div>

I have tried the extension for the first time - this is great! It has picked up quite a few issues down to my sloppy coding. Thank you!

Just a quick question. The linter will pick up any unused argument in common functions:

 ![Screenshot 2023-02-08 at 14.15.11](https://forum-defold.b-cdn.net/uploads/default/original/3X/5/d/5d970195db851910d86a1c81412d7d63abaa7cd6.png)  
What is the recommendation: delete them or ignore the linter?

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [February 8, 2023, 1:22pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/34 "2023-02-08T13:22:33Z")

</div>

> [@anon95708182](#):
>
> What is the recommendation: delete them or ignore the linter?

If I’m not mistaken you can rename them to \_ (underscore) and they will be automatically ignored.

---

<div class="post-metadata">

**Author:** ![anon95708182](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/a/ce7236/32.png) [@anon95708182](https://forum.defold.com/u/anon95708182)\
**Post date:** [February 8, 2023, 1:26pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/35 "2023-02-08T13:26:27Z")

</div>

Ah, so I’ll leave them in with an underscore - thank you!

---

<div class="post-metadata">

**Author:** ![WhiteBoxDev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/whiteboxdev/32/36080_2.png) [@WhiteBoxDev](https://forum.defold.com/u/WhiteBoxDev)\
**Post date:** [February 9, 2023, 3:02pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/36 "2023-02-09T15:02:34Z")

</div>

Does this mean the interpreter won’t allocate space for them? (Memory or performance benefits, even if small?)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [February 9, 2023, 3:04pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/37 "2023-02-09T15:04:34Z")

</div>

> [@WhiteBoxDev](#):
>
> Does this mean the interpreter won’t allocate space for them?

No, it’s only to get Luacheck to not complain about them.

> **[\_ - List of warnings — luacheck 0.26.0 documentation](https://luacheck.readthedocs.io/en/stable/warnings.html#unused-hint-214)**
>
> Warnings produced by Luacheck are categorized using three-digit warning codes. Warning codes can be displayed in CLI output using --codes CLI option or codes config option. Errors also have codes starting with zero; unlike warnings, they can not be...

---

<div class="post-metadata">

**Author:** ![anon95708182](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/a/ce7236/32.png) [@anon95708182](https://forum.defold.com/u/anon95708182)\
**Post date:** [February 9, 2023, 4:59pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/38 "2023-02-09T16:59:33Z")

</div>

Just a quick observation.

Quote from the link:

_“Unused hint” (214)_

_If a function argument starts with an underscore `_`, it recevies an “unused hint”, meaning that it’s intended to be left unused. If it is used, a 214 warning is generated._

The preceding underscore does not silence the linter as expected, only the complete replacement with an underscore does:

 ![Screenshot 2023-02-09 at 16.56.49](https://forum-defold.b-cdn.net/uploads/default/original/3X/2/a/2aaad9f48edcc136ca5f3c5fc9b155c2b26eea4c.png)

 ![Screenshot 2023-02-09 at 16.56.57](https://forum-defold.b-cdn.net/uploads/default/original/3X/d/b/db30408d570a57228fa03a476694f099c297fb28.png)

---

<div class="post-metadata">

**Author:** ![vlaaad](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/vlaaad/32/10538_2.png) [@vlaaad](https://forum.defold.com/u/vlaaad)\
**Post date:** [February 10, 2023, 8:52am UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/39 "2023-02-10T08:52:12Z")

</div>

You can also configure Luacheck to ignore this warning by creating `.luacheckrc` file in the root of the project with the following content:

```lua
unused_args = false

```

---

<div class="post-metadata">

**Author:** ![anon95708182](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/a/ce7236/32.png) [@anon95708182](https://forum.defold.com/u/anon95708182)\
**Post date:** [February 10, 2023, 9:36am UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/40 "2023-02-10T09:36:22Z")

</div>

Thank you @vlaaad! Added the file and the warnings are gone. 🥳  
It is a bit odd that “unused hint” doesn’t seem to work as stated in the luacheck docs.

[Previous page](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465.md?page=1)

[Next page](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465.md?page=3)
