conventionaljs
Conventional tests for your JS and TS.
There is only one rule so far and it's incomplete.
- Make sure AWS Lambda event handler input parameters don't escape the file they are defined in.
Usage
You'll need entente or ts-morph for this.
entente (known entrypoints only at the moment)
const createProject = ;;
ts-morph (find entrypoints in a source tree)
const compilerOptions = allowJs: true checkJs: true noEmit: true resolveJsonModule: true; const project = compilerOptions ;project;project;
Todos
- Make it work with commonjs modules. ts-morph is having a hard time here.
- Make it work when someone hasn't annotated the function with JSDoc. There are few things we can do here around scoring the function based on name
handler
and whether it has 3 params (event, context, callback) or 1-2 params (event, [context]) for async functions. - Make sure it doesn't escape through a renamed reference.