Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@oursky/tslint-oursky

Package Overview
Dependencies
Maintainers
6
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oursky/tslint-oursky

This is a tslint config that does 2 things.

  • 0.12.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
6
Weekly downloads
 
Created
Source

tslint-oursky

This is a tslint config that does 2 things.

  1. Include opinionated non-stylistic rules that prevent you from making mistakes.
  2. Include some custom useful rules.

Rule version

The included rules are as of tslint@v5.11.0

Example

{
  "extends": [
    "@oursky/tslint-oursky"
  ],
  "rules": {
    "oursky-ban-imports": [true, ["react-native", ["Text", "Image", "*", "default"]]]
  }
}

Custom rules

oursky-ban-imports

This rule allows you to ban imports from specific modules.

If you want to ban namespace import import * as a from "m";, use *.

If you want to ban default import import a from "m";, use default.

This rule is not enabled by default because we do not know what you want to ban.

For example,

"oursky-ban-imports": [true,
  ["react-native", ["Text", "Image", "*", "default"]],
  ["react", ["Component", "*", "default"]]
]

The above configuration bans Text and Image from react-native, Component from react.

oursky-no-inline-function-children

This rule disallows inline function as JSX children.

This rule is enabled by default.

oursky-no-enum

This rule disallows the usage of enum.

The rationale of banning enum is that enum is not a EMCAScript language feature. If you use this in your library, you need to be aware of what it compiles to and tell that to the users of your library. Instead of using enum, use union type to represent an enumeration. If you enable the strictest compiler options and use union type, you can have exhaustive switch statement.

Example Playground

You have to manually enable strictness options because the link does not remember selected options.

This rule is enabled by default.

oursky-no-static-literal

This rule disallows static non-primitive literals in JSX.

This rationale is that static non-primitive literals break React.PureComponent or React.pure

This rule is enabled by default.

FAQs

Package last updated on 09 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc