dcodeIO 06f99406be Experimenting with inline-assembler-ish explicit builtins
Starting with explicit loads and stores as part of the respective type namespaces. Might become handy for use with portable code, because these can be polyfilled, while load<T> and store<T> can't.
2018-04-27 00:08:41 +02:00
..
2018-03-13 14:03:57 +01:00
2018-03-13 14:03:57 +01:00
2018-03-13 14:03:57 +01:00
2018-03-13 14:03:57 +01:00
2018-03-13 14:03:57 +01:00

AS lint

Recommended TSLint rules for use with AssemblyScript. Meant to spot the most common issues as you type.

Not a sophisticated checker in its current state.

Usage

Add the following tslint.json to your project:

{
  "extends": "@assemblyscript/lint"
}

Add additional rules if necessary.

Add a script to your package.json:

"scripts": {
  "lint": "tslint -c tslint.json --project ./path/to[/tsconfig.json] --format as"
}

Now, to check your sources, run:

$> npm run lint

If you are using Visual Studio Code, there's also a TSLint extension that highlights issues as you type.

Custom rules

  • as-types checks that all types are annotated or have an initializer.
  • as-variables checks the use of var and let to match their semantic meaning. For reference, var becomes a distinct local or mutable global, while let becomes a shared local.