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

@bonniernews/eslint-plugin-typescript-rules

Package Overview
Dependencies
Maintainers
31
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bonniernews/eslint-plugin-typescript-rules

ESLint Plugin for preventing non ecmascript compatible patterns in Typescript

  • 0.9.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
increased by16.28%
Maintainers
31
Weekly downloads
 
Created
Source

Eslint plugin typescript rules

Tests

A plugin for enforcing some Javascript best practices when using Typescript as "typed" Javascript. This plugin can also be used together with Javascript to prevent the usage of Class extends.

Usage

Install eslint and the plugin npm i eslint eslint-plugin-typescript-rules --save-dev

Add typescript-rules to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": ["typescript-rules"]
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "typescript-rules/disallow-class-extends": "error",
    "typescript-rules/disallow-abstract-class": "error",
    "typescript-rules/disallow-non-es-compatible": "error"
  }
}

This plugin exports a recommended configuration that includes all the rules enabled.

To enable this configuration use the extends property in your .eslintrc config file:

{
  "extends": [
    "eslint:recommended",
    "plugin:typescript-rules/recommended"
  ]
}

Rules

Name                      Description
disallow-abstract-classPrevent usage of abstract classes.
disallow-class-extendsPrevent extending classes. Unless it's an Error class.
disallow-non-es-compatiblePrevent usage of non EcmaScript compatible functionality when using Typescript, such as decorators, enums, private methods and properties.

License

Released under the MIT license.

Keywords

FAQs

Package last updated on 11 Jan 2024

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