New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@crazyfactory/tslint-rules

Package Overview
Dependencies
Maintainers
10
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@crazyfactory/tslint-rules

<!--[![Greenkeeper badge](https://badges.greenkeeper.io/crazyfactory/tslint-rules.svg)](https://greenkeeper.io/) --> [![Build Status](https://travis-ci.org/crazyfactory/tslint-rules.svg)](https://travis-ci.org/crazyfactory/tslint-rules) [![GitHub issues](

  • 1.9.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
10
Created
Source

tslint-rules

Build Status GitHub issues codecov devDependencies Status dependencies Status

Contains lint rules for Crazy Factory

  • Typescript 3.x
  • packs it for npm usage
  • uses jest for testing
  • uses travis and semantic-release for deployment
  • uses linting, coverage and git hooks to increase code quality.
  • is configured to support wallaby

Usage

Initially you should:

  • npm install @crazyfactory/tslint-rules
  • update tslint.json (add rules directory)
  • enable rules in tslint.json

Rules

create-async-actions

  • In ts-react-boilerplate, we use createAsyncActions to create Redux async actions. Four actions are created from calling it - BASE, BASE_PENDING, BASE_FULFILLED, and BASE_REJECTED as an example when createAsyncActions("BASE", "BASE_PENDING", "BASE_FULFILLED", "BASE_REJECTED" is called. Still, as you see, we need to provide string literal as arugments due to typescript limitation, if we provide any string variable, the type will be deduced to just string. This rule enforces 2nd, 3rd, and 4th argument to be the concatenation of the first argument string and _PENDING, _FULFILLED, and _REJECTED respectively.

enum-sort-keys

import-react

  • Specify how you should import react. Either import * or import React.
  • Rule options:
    • type: "default" | "star". Default is star

hex-format

  • Requires literal string in hex format to be uppercase/lowercase and/or of specific lengths.
  • Rule options:
    • case: "uppercase" | "lowercase". Default is lowercase
    • allowedLengths: number[]. Default is [4, 7]

interface-sort-keys

jsx-space-before-trailing-slash

  • Requires or bans space before /> part of jsx.
  • Rule options:
    • ["always", "never"]. Default is always.

language

  • Requires that string argument called by Translator object is in the reference.json

  • Rule options:

    • path: path to reference.json

    reference.json needs to be in the following format:

      {
        "reference": [
          {
            "base": "Translation String Here"
          }
        ]
      }
    
    • callerNames: string[]: Name of translator object type, default is ["Translator"]

no-dup-actions

FAQs

Package last updated on 23 Oct 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