@nativescript/tslint-rules
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

NativeScript TSLint Rules

Build Status

This project contains tslint rules useful for NativeScript applications.

prefer-mapped-imports rule

Prefer using mapped paths when importing external modules or ES6 import declarations.

Note: This rule is intended for code-sharing NativeScript projects

Options

  • prefix specifies the prefix for the mapped imports (usually "@src/").
  • prefix-mapped-to specifies folder that is mapped to the prefix (usually "src/").
  • base-url specifies the base url of the typescript program (usually ".")`

Sample rule config (tslint.json):

"prefer-mapped-imports": [
    true,
    {
        "prefix": "@prefix/",
        "prefix-mapped-to": "src/",
        "base-url": "."
    }
]

Autofix

The rule will propose a fix if:

  • Has all the configurations in the tslint.json
  • Used in typescript project with baseUrl and path mappings for either web or mobile files.

no-android-resources rule

The rule forbids using constants inside android.R as they cause performance issues.

Package Sidebar

Install

npm i @nativescript/tslint-rules

Weekly Downloads

903

Version

0.0.5

License

Apache-2.0

Unpacked Size

35.3 kB

Total Files

13

Last publish

Collaborators

  • tns-bot
  • rosen-vladimirov
  • stoskov
  • lini
  • walkerrunpdx
  • rigor789
  • nativescript-bot
  • bradmartin
  • tdermendjiev
  • sis0k0