Skip to content

Commit

Permalink
test(check-line-alignment): add test example from #680 (but with "n…
Browse files Browse the repository at this point in the history
…ever")
  • Loading branch information
brettz9 committed Jan 27, 2021
1 parent 780b8b5 commit 06f4521
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2125,6 +2125,18 @@ const fn = ( lorem, sit ) => {}
function quux () {}
// Options: ["never",{"tags":["param","return"]}]
// Message: Expected JSDoc block lines to not be aligned.

/**
* Returns the value stored in the process.env for a given
* environment variable.
*
* @param {string} withPercents '%USERNAME%'
* @param {string} withoutPercents 'USERNAME'
* @return {string} 'bob' || '%USERNAME%'
*/
function quux () {}
// Options: ["never"]
// Message: Expected JSDoc block lines to not be aligned.
````

The following patterns are not considered problems:
Expand Down
42 changes: 42 additions & 0 deletions test/rules/assertions/checkLineAlignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,48 @@ export default {
function quux () {}
`,
},
{
code: `
/**
* Returns the value stored in the process.env for a given
* environment variable.
*
* @param {string} withPercents '%USERNAME%'
* @param {string} withoutPercents 'USERNAME'
* @return {string} 'bob' || '%USERNAME%'
*/
function quux () {}
`,
errors: [
{
line: 6,
message: 'Expected JSDoc block lines to not be aligned.',
type: 'Block',
},
{
line: 7,
message: 'Expected JSDoc block lines to not be aligned.',
type: 'Block',
},
{
line: 8,
message: 'Expected JSDoc block lines to not be aligned.',
type: 'Block',
},
],
options: ['never'],
output: `
/**
* Returns the value stored in the process.env for a given
* environment variable.
*
* @param {string} withPercents '%USERNAME%'
* @param {string} withoutPercents 'USERNAME'
* @return {string} 'bob' || '%USERNAME%'
*/
function quux () {}
`,
},
],
valid: [
{
Expand Down

0 comments on commit 06f4521

Please sign in to comment.