1.0.3 • Published 2 years 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"
standardis independenciesordevDependencies
it will also use main attributes defined in package.json to find files for validation.
for examples:
main===index.jsnudge will scan project root directory, of course ignoringnode_modulesmain===src/index.jsnudge will scansrcdirectory
If everything is fine, nudge will perform the following:
- invoke
standardto lint the project and quit on error - analyse
.jssource code files intoASTs and cross check for cases whereasyncfunctions are called withoutawaitas 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.
}