0.2.0 • Published 4 years ago
eslint-plugin-typescript-package-template v0.2.0
typescript-npm-package-template
Template to kickstart creating a Node.js module using TypeScript and VSCode
Inspired by node-module-boilerplate
Features
- Semantic Release
- Issue Templates
- GitHub Actions
- Codecov
- VSCode Launch Configurations
- TypeScript
- Husky
- Lint Staged
- Commitizen
- Jest
- ESLint
- Prettier
Getting started
Set up your repository
Click the "Use this template" button.
Alternatively, create a new directory and then run:
curl -fsSL https://github.com/ryansonshine/typescript-npm-package-template/archive/main.tar.gz | tar -xz --strip-components=1Replace FULL_NAME, GITHUB_USER, and REPO_NAME in the script below with your own details to personalize your new package:
FULL_NAME="John Smith"
GITHUB_USER="johnsmith"
REPO_NAME="my-cool-package"
sed -i.mybak "s/ryansonshine/$GITHUB_USER/g; s/typescript-npm-package-template\|my-package-name/$REPO_NAME/g; s/Ryan Sonshine/$FULL_NAME/g" package.json package-lock.json README.md
rm *.mybakAdd NPM Token
Add your npm token to your GitHub repository secrets as NPM_TOKEN.
Add Codecov integration
Enable the Codecov GitHub App here.
Remove everything from here and above
my-package-name
My awesome module
Install
npm install my-package-nameUsage
import { myPackage } from 'my-package-name';
myPackage('hello');
//=> 'hello from my package'API
myPackage(input, options?)
input
Type: string
Lorem ipsum.
options
Type: object
using package locally
Run npm link inside the package to expose the package to the global scope.
To unlink the package, run npm unlink <my-package-name>.
inside eslint.* file
{
"plugins":
[
"eslint-plugin-typescript-package-template"
],
rules:
{
"typescript-package-template/async-fun": "error"
// or
"<your-plugin-name>/<your-rule-name>": "error"
}
}}
postfix
Type: string
Default: rainbows
Lorem ipsum.