Skip to content

Commit

Permalink
docs(check-line-alignment): add example with multiline type; #743
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed May 18, 2021
1 parent 03d3f40 commit 4c6fda7
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2320,6 +2320,15 @@ const fn = ( lorem, sit ) => {}
const fn = ( lorem, sit ) => {}
// "jsdoc/check-line-alignment": ["error"|"warn", "never",{"customSpacings":{"postName":3}}]
// Message: Expected JSDoc block lines to not be aligned.

/**
* @param {{
* ids: number[]
* }} params
*/
const myMethod = ({ids}) => {}
// "jsdoc/check-line-alignment": ["error"|"warn", "always"]
// Message: Expected JSDoc block lines to be aligned.
````

The following patterns are not considered problems:
Expand Down
32 changes: 32 additions & 0 deletions test/rules/assertions/checkLineAlignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,38 @@ export default {
const fn = ( lorem, sit ) => {}
`,
},
{
/* eslint-disable no-tabs */
code: `
/**
* @param {{
* ids: number[]
* }} params
*/
const myMethod = ({ids}) => {}
`,
errors: [
{
line: 2,
message: 'Expected JSDoc block lines to be aligned.',
type: 'Block',
},
],
options: ['always'],
output: `
/**
* @param {{
* ids: number[]
* }} params
*/
const myMethod = ({ids}) => {}
`,
/* eslint-enable no-tabs */
parser: require.resolve('@babel/eslint-parser'),
parserOptions: {
ecmaVersion: 2_021,
},
},
],
valid: [
{
Expand Down

0 comments on commit 4c6fda7

Please sign in to comment.