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

eslint-plugin-typescript

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-typescript - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

.travis.yml

37

docs/rules/type-annotation-spacing.md
# Enforces spacing around type annotations (type-annotation-spacing)
Please describe the origin of the rule here.
Type annotations in TypeScript tend to have a very specific format, where the colon appears directly after the identifier or function, followed by a space, followed by the type. For example:
```ts
var foo: string = "bar";
function foo(a: string): string {
// code
}
```
This convention is carried through TypeScript documentation and is the most common convention used for TypeScript code.
## Rule Details
This rule aims to...
This rule aims to enforce specific spacing patterns around type annotations. As such, it will warn when there is a space before the colon or a space is missing after the colon of a type annotation.
The following patterns are considered warnings:
```js
```ts
var foo:string = "bar";
// fill me in
function foo(a : string):string {
// code
}
```

@@ -21,17 +32,11 @@

```js
var foo: string = "bar";
// fill me in
function foo(a: string): string {
// code
}
```
### Options
If there are any options, describe them here. Otherwise, delete this section.
## When Not To Use It
Give a short description of when it would be appropriate to turn off this rule.
## Further Reading
If there are other links that describe the issue this rule addresses, please include them here in a bulleted list.
If you don't want to enforce spacing for your type annotations, you can safely turn this rule off.
{
"name": "eslint-plugin-typescript",
"version": "0.0.1",
"version": "0.1.0",
"description": "TypeScript plugin for ESLint",

@@ -24,3 +24,3 @@ "keywords": [

"mocha": "^2.4.5",
"typescript-eslint-parser": "~0.1.1"
"typescript-eslint-parser": "^0.4.0"
},

@@ -27,0 +27,0 @@ "engines": {

@@ -53,6 +53,2 @@ # eslint-plugin-typescript

* `typescript/type-annotation-spacing` - enforces one space after the colon and zero spaces before the colon of a type annotation.
* `typescript/explicit-member-accessibility` - enforces accessibility modifiers on class properties and methods.
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