typescript-type-completion-sorting-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Description

When doing completion from TS service, slightly reorder available completions to keep own non-inherited properties from type at the top of completion list:

React (especially useful when inherting from HTMLAttributes)

Before:

(Component own properties are messed with HTML ones)

After:

(Notice component own properites are being displayed at top)

Class

Before

(Mix own & inherited properties)

After:

(Own properties are being displayed at top)

Before:

After:

(Own properties are being displayed at top)

Installation

VS Code

Install extension typescript-sort-completions

Non VS code

npm install typescript-type-completion-sorting-plugin --save-dev

Add to tsconfig.json:

    "plugins": [{
         "name": "typescript-type-completion-sorting-plugin"
    }]

Knwon issues

Non working with JSX elements without closing tag, i.e:

return <MyComp /*trigger completion here*/

Completions won't be broken, but will be reverted to usual, non-filtered completions

Workaround

Enclose expression in brackets:

return (<MyComp /*trigger here*/);

Readme

Keywords

none

Package Sidebar

Install

npm i typescript-type-completion-sorting-plugin@1.0.0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • asvetliakov