@nbai/nudge

1.0.3 • Public • Published

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 in dependencies or devDependencies

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 ignoring node_modules
  • main === src/index.js nudge will scan src 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 into ASTs and cross check for cases where async functions are called without await 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.
}

Readme

Keywords

none

Package Sidebar

Install

npm i @nbai/nudge

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

11.8 kB

Total Files

9

Last publish

Collaborators

  • nextbillion.ai