New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

format-javascript-comment

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

format-javascript-comment - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

lib/getRange.js

4

package.json
{
"name": "format-javascript-comment",
"main": "./lib/format-comment",
"version": "0.1.4",
"main": "./lib/index",
"version": "0.1.5",
"author": "Jan Amann <jan@amann.me>",

@@ -6,0 +6,0 @@ "description": "Format your JavaScript comments",

@@ -16,3 +16,3 @@ # Format JavaScript comment for Atom

function whatToDo(itKeepsOnRaining, targetCity = 'Chicago') {
if (itKeepsOnRaining) return `Levee's goin' to break; Going to ${targetCity}.`;
if (itKeepsOnRaining) return `Levee's goin to break; Going to ${targetCity}`;
else return 'Sit on the levee and moan';

@@ -33,3 +33,3 @@ }

function whatToDo(itKeepsOnRaining, targetCity = 'Chicago') {
if (itKeepsOnRaining) return `Levee's goin' to break; Going to ${targetCity}.`;
if (itKeepsOnRaining) return `Levee's goin to break; Going to ${targetCity}`;
else return 'Sit on the levee and moan';

@@ -46,2 +46,4 @@ }

- JSDoc tags always start on a new line (` * @param {string} name Some description.`)
- If no selection is made, the selection is automatically created by examining the surrounding lines.
- If some selection is made, only the lines that are within the selection will be processed. However, lines can be selected partially.

@@ -51,8 +53,11 @@ ## How?

2. (Partially) select the lines the comment encompasses.
3. Open command pallette (Cmd+Shift+P) and (partially) type "format comment".
3. Open command palette (Cmd+Shift+P) and (partially) type "format comment".
4. Press enter.
## TODO
- Better way to find the selection automatically if no selection is provided
- Configurable line length
- Retain blank spaces
- Retain blank lines
- Ignore JSDoc first and last line
- Ignore non-comment lines
- Create a selection range across all modified lines at the end
- Support multiple cursors

@@ -6,3 +6,3 @@ /* eslint-disable max-len */

describe('FormatComment', () => {
describe('formatCommentLines', () => {
describe('// comments', () => {

@@ -9,0 +9,0 @@ it('turns one line into two lines', () => {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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