Require // @ts-check
to be added to your files
This repository uses CI/CD to automatically publish new releases as described on my Setup versioning and NPM publication using Github Actions and changesets gist.
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-require-ts-check
:
npm install eslint-plugin-require-ts-check --save-dev
Add eslint-plugin-require-ts-check
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": ["require-ts-check"]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"require-ts-check/require-ts-check": "error"
}
}
This rule supports a combination of any of the following options:
Specify the files that should be tested using this rule. This parameter uses the Glob filename matching pattern.
Defaults to all javascript files: [ "**/*.js" ]
"rules": {
"require-ts-check/require-ts-check": ["error", { "include": ["**/my-files/*.*"] }]
}
Specify the files that this rule should ignore. This parameter uses the Glob filename matching pattern.
Defaults to the node_modules
folder: [ "node_modules" ]
"rules": {
"require-ts-check/require-ts-check": ["error", { "exclude": ["**/ignored-files/*.*"] }]
}
-
Install VSCode recommended extensions. This is needed for formatting.
In Mac: Cmd + Shift + P:
Others: Ctrl + Shift + P:
Find the "Extensions: Show recommended extensions" option and install them.
Always remember to format the code when saving if your editor does not do it automatically.
-
Fork the repo
-
Create a new branch based off of
main
-
Add your changes
-
Create a new changelog entry by running
npm run changeset
and fill in the dataThis will create an
.md
file with a random name in the.changeset
folder. This file should contain the changes that were added as part of your contribution. It will later be automatically added to the mainCHANGELOG.md
file when a new release is created. -
Run tests:
npm test
-
Check the code formatting:
npm prettier
-
Run the linter:
npm lint
-
Push your changes and create a PR in the original repository for your new branch pointing to
main
.