GithubHelp home page GithubHelp logo

floneu / sonarts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sonarsource/sonarts

0.0 2.0 0.0 6.18 MB

Static code analyzer for TypeScript

License: GNU Lesser General Public License v3.0

Shell 0.76% JavaScript 0.63% TypeScript 60.40% HTML 7.02% Java 31.19%

sonarts's Introduction

SonarTS Build Status NPM version Quality Gate Coverage

Static code analyzer for TypeScript detecting bugs and suspicious patterns in your code.

Follow us on twitter

To analyze pure JavaScript code, see SonarJS

How does it work?

Rules

Bug Detection ๐Ÿ›

Rules in this category aim to find places in code which has a high chance to be bugs, i.e. don't work as indented. Most of the time this is a result of bad copy-paste (no-identical-conditions) or improvident API usage (no-misleading-array-reverse). Some rules are raising issues on unused values (no-useless-increment), which is at best wasted code and at worst a bug.

Code Smell Detection ๐Ÿท

Code Smells issues, or Maintainability issues, are raised for places of code which might be costly to change in the future (cognitive-complexity). These rules also help to keep the high code quality and readability (no-commented-code, no-identical-functions, use-primitive-type). And finally some rules report issues on different suspicious code patters (no-dead-store, no-gratuitous-expressions).

Prerequisites

Node.js (>=6.x).

Use in TSLint

  • If you don't have TSLint yet configured for your project follow these instructions.
  • Install tslint-sonarts
npm install tslint-sonarts      # install in your project
npm install tslint-sonarts -g   # or install globally
  • Add tslint-sonarts to your tslint.json extends property:
{
  "extends": ["tslint:recommended", "tslint-sonarts"]
}
  • Some of the rules in SonarTS require type information. So in order to provide as much value as possible run TSLint with type-checker, for example:
tslint --project ./tsconfig.json 'src/**/*.{ts,tsx}'

Use in SonarQube

SonarTS is available as plugin for SonarQube. SonarQube is an open source platform for continuous inspection of code quality. Thanks to the platform, SonarTS provides additional features:

  • Code coverage import
  • Duplication detection
  • Various metrics
  • More rules

See the documentation here and example project here.

Also available online on โ˜๏ธ SonarCloud

Contributing

You want to participate to the development of our TypeScript analyzer? Have a look at our contributor guide!

sonarts's People

Contributors

vilchik-elena avatar inverno avatar stas-vilchik avatar saberduck avatar michalb-sonar avatar wohops avatar henryju avatar hosszubalazs avatar dbmeneses avatar timmikeladze avatar viperx77 avatar

Watchers

James Cloos avatar Florian Neumann avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.