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

tslint-config-silind

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tslint-config-silind

An opinionated TSLint configuration preset for writing scalable, clean and hygienic code

  • 1.0.23
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-71.43%
Maintainers
1
Weekly downloads
 
Created
Source

TSLint Config Silind Tweet

NPM Version Github License Build Status Code Coverage

An opinionated TSLint configuration preset for writing scalable, clean and hygienic code

:warning: This project is deprecated

TSLint has been deprecated.
As a consequence, this project will no longer be maintained.

Read more about TSLint deprecation here

Table of content

Getting Started

Install

Install tslint-config-silind as a dev dependency using npm or yarn

npm:

npm install -D tslint-config-silind

yarn:

yarn add -D tslint-config-silind

Create TSLint configuration (tslint.json)

Create a file tslint.json in your project root, and add the following:

{
  "extends": ["tslint-config-silind"],
  "linterOptions": {
    "exclude": ["node_modules/**/*.ts"]
  }
}

If you already have a tslint.json file in your project, make sure to add tslint-config-silind under extends.

Configuration preset

tslint-config-silind comes pre-configured with the following rules.
These can of course be overridden in tslint.json under rules.

rules: {
  "curly": true,
  "max-classes-per-file": false,
  "variable-name": false,
  "member-ordering": false,
  "ordered-imports": [false],
  "object-literal-sort-keys": [false],
  "no-console": [false],
  "import-name": [false],
  "align": [false],
  "max-line-length": { "options": [120], "severity": "warning" },
  "no-consecutive-blank-lines": { "options": [1], "severity": "warning" },
  "quotemark": [true, "single"],
  "array-type": [true, "array-simple"],
  "prefer-array-literal": { 
    "options": [true, { "allow-type-parameters": true }], 
    "severity": "error" 
  },
  "ter-arrow-parens": { 
    "options": ["as-needed", { "requireForBlockBody": true }], 
    "severity": "warning" 
  },
  "trailing-comma": {
    "options": [
      {
        "multiline": {
          "objects": "always",
          "arrays": "always",
          "functions": "ignore",
          "typeLiterals": "ignore"
        },
        "esSpecCompliant": true
      }
    ],
    "severity": "error"
  }
}

Custom rules

Any custom rule can be disabled and severity level can be set individually
In this example, the rule no-lowlevel-commenting is configured with a severity-level of error:

"no-lowlevel-commenting": { "severity": "error" }

To disable a rule, simply set its value to false:

"no-lowlevel-commenting": false

The following table shows the custom rules that comes with tslint-config-silind.

TS OnlyRule NameDescription
:heavy_check_mark:no-lowlevel-commentingFails in the presence of low-level comments that are not part of JSDocs. Read more
:heavy_check_mark:discreet-ternaryPrevents overuse of the ternary operator Read more
:heavy_check_mark:structured-importRequires import statements to be structured based on content and origin Read more

Contributing

Issues

In the case of a bug report, bugfix or a suggestions, please feel very free to open an issue.

Pull request

Pull requests are always welcome, and I'll do my best to do reviews as fast as I can.

License

This project is licensed under the MIT License

Get Help

Keywords

FAQs

Package last updated on 09 Feb 2020

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