Giter Site home page Giter Site logo

Comments (2)

GrandZhuo avatar GrandZhuo commented on May 22, 2024

鉴于以下情况,我们默认忽略了文件中的全局变量:
在工程中有A、B两个lua文件,A中定义了一个全局变量,B require A,并在B中直接使用了A中定义的全局变量,这个时候对B运行luacheck,会认为B中使用了未定义的全局变量,报一个warning,accessing undefined variable XXX。考虑到全局变量可能定义在工程中的其他文件,也有可能是在运行时由lua框架(例如slua等)直接放入到lua虚拟机中,为了避免在这些情况下产生不必要的干扰,我们选择默认忽略了对全局变量的检查。

在VSCode的设置中还有一些关于Code Linting的配置,用以优化使用体验,例如Ignore Error Code、Luacheck Path等。

from luapanda.

weng7654 avatar weng7654 commented on May 22, 2024

可以做一个共享全局变量的检查吗,就是无论A、B 只要存在不存在的全局变量引用,就报错

from luapanda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.