Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nativescript/nativescript-tslint-rules
A set of TSLint rules for NativeScript projects.
https://github.com/nativescript/nativescript-tslint-rules
nativescript tslint typescript
Last synced: 3 months ago
JSON representation
A set of TSLint rules for NativeScript projects.
- Host: GitHub
- URL: https://github.com/nativescript/nativescript-tslint-rules
- Owner: NativeScript
- License: apache-2.0
- Created: 2019-03-12T10:48:15.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-29T18:14:49.000Z (about 5 years ago)
- Last Synced: 2024-05-23T10:01:50.240Z (8 months ago)
- Topics: nativescript, tslint, typescript
- Language: TypeScript
- Size: 27.3 KB
- Stars: 3
- Watchers: 27
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# NativeScript TSLint Rules
[![Build Status](https://travis-ci.org/NativeScript/nativescript-tslint-rules.svg?branch=master)](https://travis-ci.org/NativeScript/nativescript-tslint-rules)
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](https://docs.nativescript.org/code-sharing/intro)
### 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.