Skip to content

denolibs/deno_template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deno_template

This is the DenoLibs template for Deno compatible modules.

Usage

Press the Use this template button, and edit some files.

Which files?

We also recommend you write some tests in /test/mod.ts. There is a config included for Travis CI in this repository.

Running

The run.bat file in the template is included to make running your module even easier!
Note: [args] are optional arguments you may wish to pass to Deno or your module.

  • Windows (Command Prompt) run [args]
  • Window (PowerShell) .\run [args]
  • Linux (BASH) ./run.bat [args]

There are likely other shells where this script will work, let us know and we'll add them!

Linting (ESLint) - Requires NodeJS & NPM

Included in the template is an ESLint config (.eslintrc.js) that includes ESLint & Prettier support. This requires some dependancies, which are listed in package.json, and are installed with NPM.

To install the dependancies from a command line

$ npm install

To run the ESLint linter from a command line

$ node node_modules/eslint/bin/eslint.js lib/**

For automatic linting, we recommend VSCode the following packages/settings

Packages

Settings (settings.json)

{
  "editor.defaultFormatter": "dbaeumer.vscode-eslint",
  "[typescript]": {
    "editor.formatOnSave": false
  },
  "eslint.enable": true,
  "eslint.validate": [
    { "language": "typescript", "autoFix": true },
  ],
  "eslint.autoFixOnSave": true,
}

This project is based on the open source DenoLibs / deno_template template.