Some examples of how to do TypeScript with only jsdoc comments.
Note: the extra parenthesis are necessary here.
// TypeScript
See the the generated schema below. |
# npm i -g typescript | |
# change directory to your project | |
# Prints out tsconfig.json including extended options if there is any. | |
tsc --showConfig | |
# You can use this flag to discover where TypeScript is spending it’s time when compiling | |
# https://github.com/microsoft/TypeScript/wiki/Performance | |
tsc --extendedDiagnostics |
The package that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
import foo from 'foo'
instead of const foo = require('foo')
to import the package. You also need to put "type": "module"
in your package.json and more. Follow the below guide.await import(…)
from CommonJS instead of require(…)
.Things I found myself researching over and over without taking the time to write them down. Until now.
Table of Contents
/** | |
* Schema for validating JSDoc doclets. | |
* @module jsdoc/schema | |
* @see <https://trac.tools.ietf.org/html/draft-wright-json-schema-validation-01> | |
*/ | |
// JSON schema types | |
const ARRAY = 'array'; | |
const BOOLEAN = 'boolean'; | |
const NULL = 'null'; | |
const NUMBER = 'number'; |
jsDoc cheatsheet #javascript #boilerplate
A collection of [jsDoc] blocks for reference when coding in JavaScript.
'use strict';
/**
* @fileOverview Class handling email-related functions.
* @module Email
Hey everyone - this is not just a one off thing, there are likely to be many other modules in your dependency trees that are now a burden to their authors. I didn't create this code for altruistic motivations, I created it for fun. I was learning, and learning is fun. I gave it away because it was easy to do so, and because sharing helps learning too. I think most of the small modules on npm were created for reasons like this. However, that was a long time ago. I've since moved on from this module and moved on from that thing too and in the process of moving on from that as well. I've written way better modules than this, the internet just hasn't fully caught up.
@broros
otherwise why would he hand over a popular package to a stranger?
If it's not fun anymore, you get literally nothing from maintaining a popular package.
One time, I was working as a dishwasher in a restu
// use this format since .eslintrc is deprecated. | |
// You can logically derive this format. | |
module.exports = { | |
parser: 'babel-eslint', | |
extends: [ | |
'plugin:flowtype/recommended', | |
'plugin:jest/recommended', | |
'plugin:react/recommended', | |
'eslint-config-airbnb', |