eslint-plugin-typescript-space-curly

1.0.2 • Public • Published

Description

This package is a typescript-eslint plugin that adds rules for inner spacing for curly braces in interfaces and literal object types.

Installation

Run the command npm install eslint-plugin-typescript-space-curly.

Inside .eslintrc.js, add this line in your plugins : 'typescript-space-curly' And finally add the rules to your rules : 'typescript-space-curly/interface-curly-inner-spacing': 'error', 'typescript-space-curly/literal-object-type-curly-inner-spacing': 'error'

Uses

interface MyInterface = {property: string} will give 2 errors:

'A space is required after '{'. and 'A space is required before '}'. Applying the fix will turn the code into interface MyInterface = { property: string }

The same applies to let fooObject: {property: string} , since it is a literal object type.

/eslint-plugin-typescript-space-curly/

    Package Sidebar

    Install

    npm i eslint-plugin-typescript-space-curly

    Weekly Downloads

    5

    Version

    1.0.2

    License

    ISC

    Unpacked Size

    3.27 kB

    Total Files

    3

    Last publish

    Collaborators

    • ramyjfawaz