Skip to content

Lua style guide

Patrik Juvonen edited this page Jan 8, 2019 · 3 revisions

Multi Theft Auto Lua Style Guide

Roughly following a template provided by airbnb/javascript.

Table of Contents

  1. Types
  2. References
  3. Tables
  4. Strings
  5. Functions
  6. Classes
  7. Variables
  8. Comparison Operators & Equality
  9. Blocks
  10. Control Statements
  11. Comments
  12. Whitespace
  13. Commas
  14. Semicolons
  15. Naming Conventions
  16. Events
  17. Testing
  18. Performance
  19. Resources

Types

  • 1.1 Rule description goes here. example-rule-tag

    • string
    • number
    • boolean
    • nil
    • function
    • thread
    • table
    • userdata

    -- ...

⬆ back to top

References

  • 2.1 Rule description goes here. example-rule-tag

⬆ back to top

Tables

  • 3.1 Rule description goes here. example-rule-tag

    Why? Explanation goes here.

    -- bad
    -- ...
    
    -- good
    -- ...

⬆ back to top

Strings

  • 4.1 Rule description goes here. example-rule-tag

⬆ back to top

Functions

  • 5.1 Rule description goes here. example-rule-tag

⬆ back to top

Classes

  • 6.1 Rule description goes here. example-rule-tag

⬆ back to top

Variables

  • 7.1 Rule description goes here. example-rule-tag

⬆ back to top

Comparison Operators & Equality

  • 8.1 Rule description goes here. example-rule-tag

⬆ back to top

Blocks

  • 9.1 Rule description goes here. example-rule-tag

⬆ back to top

Control Statements

  • 10.1 Rule description goes here. example-rule-tag

⬆ back to top

Comments

  • 11.1 Rule description goes here. example-rule-tag

⬆ back to top

Whitespace

  • 12.1 Rule description goes here. example-rule-tag

⬆ back to top

Commas

  • 13.1 Rule description goes here. example-rule-tag

⬆ back to top

Semicolons

  • 14.1 Rule description goes here. example-rule-tag

⬆ back to top

Naming Conventions

  • 15.1 Rule description goes here. example-rule-tag

⬆ back to top

Events

  • 16.1 Rule description goes here. example-rule-tag

⬆ back to top

Testing

  • 17.1 Rule description goes here. example-rule-tag

⬆ back to top

Performance

⬆ back to top

Resources

Learning Lua

Read This

Tools

Further Reading

Books

Blogs

⬆ back to top