Clone the repo
git clone [email protected]:ninofiliu/esgrep
cd esgrep
Install dependencies with pnpm
pnpm install
ESGrep uses typescript-estree for the parsing, which can convert .js/.ts/.jsx/.tsx files into an abstract syntax tree (AST) in the estree format. Contributors are encouraged to get familiar with these concepts and libs, but thre ESGrep code itself is fairly simple:
The CLI entry point is src/cli/node.ts. During dev, you can run it with tsx:
tsx src/cli/node.ts --format=count 'const isNode = ES_ANY' src/lib.ts
We use jest for testing and run them with
pnpm test
If all looks good, you are welcomed to submit your pull request.
pnpm test
tsx src/cli/node.ts 'const isNode = ES_ANY' src/lib.ts
pnpm build
node dist/cli/node.js 'const isNode = ES_ANY' src/lib.ts
pnpm version (patch|minor|major)
pnpm publish