1.0.3 • Published 1 year ago
@nbai/nudge v1.0.3
nudge linter
The linter take an input directory
and use it to find package.json
within the input and its parents.
If a package.json
is located, nudge lint will check for:
- type === "module"
standard
is independencies
ordevDependencies
it will also use main
attributes defined in package.json
to find files for validation.
for examples:
main
===index.js
nudge will scan project root directory, of course ignoringnode_modules
main
===src/index.js
nudge will scansrc
directory
If everything is fine, nudge will perform the following:
- invoke
standard
to lint the project and quit on error - analyse
.js
source code files intoAST
s and cross check for cases whereasync
functions are called withoutawait
as this is one most observed mistake programmers make.
can we beat the default async check?
Yes.
nudge will only check for function imported or declared locally AS IS
.
async function a1(){...}
async function main(){
a1()//nudge will report error here
let b = a1
b()//nudge does not complain this.
}