Giter Site home page Giter Site logo

typestrict's Introduction

TypeStrict

TypeStrict

Squash bugs before shipping them with TypeScript and ESLint!

ESLint config focused on maximizing type safety

Downloads Software License

Installation

npm install --save-dev @typescript-eslint/eslint-plugin eslint-plugin-sonarjs eslint-config-typestrict

๐Ÿ‘‰ If you still use TSLint please use typestrict@1

Usage

In your .eslintrc.json:

{
  "extends": "typestrict"
  // ... add here your own rules
}

Unfortunately, you need to install plugins that we depend on manually: @typescript-eslint/eslint-plugin, eslint-plugin-sonarjs

Remember to use strict compiler setting in tsconfig.json!

Description

All rules in this config are focused on catching bugs in your code and be as not annoying as possible. They don't care about your code style or formatting.

TypeStrict combines rules from various rule sets: typescript-eslint, sonarJS,

Complete rules list

ESLint

TypeScript ESLint

SonarTS

Contributing

Do you have idea for new rule to be added? You don't agree with one of rules included? Feel free to create issue / PR.

Logo by @codeandcats.

License

MIT by Krzysztof Kaczor

typestrict's People

Contributors

krzkaczor avatar tomsquest avatar whymarrh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

typestrict's Issues

Deprecated TsLint Rules

Hello guys,

The Ts Lint rules no-unused-variable and no-use-before-declare are deprecated.

It results with some warning messages:

no-unused-variable is deprecated. Since TypeScript 2.9. Please use the built-in compiler checks instead.

no-use-before-declare is deprecated. Since TypeScript 2.9. Please use the built-in compiler checks instead.

Thanks

Logo Suggestion

I noticed the logo was an exact copy of the Apple bug emoji.

That's cool, it's a gorgeous emoji, but if you're open to it I wanted to propose a slightly customised version of the well known icon.

I basically took the existing logo and slapped some TypeScript blue on it.

Then I played around with putting it in a No Smoking/Ghost Buster's style cross.

I'd be delighted if you chose to use either of these but absolutely no worries if you're not interested. ๐Ÿ‘

Any plans to support ESLint?

Since the core TypeScript and VS Code team is moving from TSLint to ESLint, and as ESLint is getting help from Microsoft with the TypeScript compatibility (see The future of TypeScript on ESLint) are there any plans for TypeStrict to support ESLint as well, like including an ESLint config with similar rules in addition to tslint.js?

TypeScript Roadmap: January - June 2019 - microsoft/TypeScript#29288:

ESLint already has the more-performant architecture we're looking for from a linter. Additionally, different communities of users often have lint rules (e.g. rules for React Hooks or Vue) that are built for ESLint, but not TSLint.

Given this, our editor team will be focusing on leveraging ESLint rather than duplicating work. For scenarios that ESLint currently doesn't cover (e.g. semantic linting or program-wide linting), we'll be working on sending contributions to bring ESLint's TypeScript support to parity with TSLint. As an initial testbed of how this works in practice, we'll be switching the TypeScript repository over to using ESLint, and sending any new rules upstream.

TypeScript Roadmap: July - December 2019 - microsoft/TypeScript#33118:

ESLint is now a capable linter for TypeScript projects. There is room for improvement in editor scenarios, but we'll focus on core editor functionality and performance for JavaScript/TypeScript. We will monitor TypeScript integration in ESLint and assist the project when needed.

rules require type information

When TSLint runs, I get the following in tslint output

Warning: The 'await-promise' rule requires type information.
Warning: The 'no-floating-promises' rule requires type information.
Warning: The 'no-inferred-empty-object-type' rule requires type information.
Warning: The 'restrict-plus-operands' rule requires type information.
Warning: The 'no-accessor-field-mismatch' rule requires type information.
Warning: The 'no-collection-size-mischeck' rule requires type information.
Warning: The 'no-dead-store' rule requires type information.
Warning: The 'no-element-overwrite' rule requires type information.
Warning: The 'no-gratuitous-expressions' rule requires type information.
Warning: The 'no-ignored-return' rule requires type information.
Warning: The 'no-self-assignment' rule requires type information.
Warning: The 'no-unused-array' rule requires type information.
Warning: The 'no-useless-cast' rule requires type information.
Warning: The 'no-variable-usage-before-declaration' rule requires type information.

How did you manage to solve this problem?

Broken links in the readme

@krzkaczor All of the SonarTS links in the readme are broken (404), see: https://github.com/krzkaczor/TypeStrict#sonarts

The readme in the SonarTS repo says: "TypeScript analysis for SonarQube was migrated to SonarJS plugin. This is a legacy repository used to produce an artifact required for backward compatibility with SonarQube." - see: https://github.com/SonarSource/SonarTS#readme

Is TypeStrict still using the legacy SonarTS or the newer SonarJS? Are there only links broken but the rules are working fine even after the deprecation of SonarTS?

I'll be teaching a TypeScript workshop on Oct 27 and I'd like to recommend TypeStrict so that's why I want to make sure everything is fine. Thanks!

Why the JS file?

Hi, I was wondering why you are defining your main file as js instead of json? I believe you only use js to extend tslint-microsoft-contrib and tslint-sonarts. Then why not just "extend" those libs the same way a user would extend yours, from json?

Branch for v1?

Hi,

The move to eslint was kind of disruptive. In hindsight it would have made more sense to create a new package for eslint and keep this one for tslint. But whatever it's done now.

Could you at least keep an active branch for v1 and link to it from the readme of master? This way there is a place to track the tslint branch?

Thanks.

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.