format-javascript-comment
Advanced tools
Comparing version 0.1.4 to 0.1.5
{ | ||
"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
16174
13
299
60