Skip to content

Commit

Permalink
refactor this code to not use nested template literals
Browse files Browse the repository at this point in the history
  • Loading branch information
thebedigupta committed Oct 14, 2024
1 parent dd71723 commit 2776f9e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/nunjucks-filters/src/customFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,10 @@ function docline(field, fieldName, scopePropName) {
const getPName = (pName) => pName ? `${pName}.` : '';

const buildLineCore = (type, def, pName, fName) => {
return `* @param {${type}} ${pName}${fName}${def !== undefined ? '=' + def : ''}`;
};
let paramName = `${pName}${fName}`;

Check failure on line 153 in apps/nunjucks-filters/src/customFilters.js

View workflow job for this annotation

GitHub Actions / Test NodeJS PR - ubuntu-latest

'paramName' is never reassigned. Use 'const' instead
let defaultValue = def !== undefined ? `=${def}` : '';

Check failure on line 154 in apps/nunjucks-filters/src/customFilters.js

View workflow job for this annotation

GitHub Actions / Test NodeJS PR - ubuntu-latest

'defaultValue' is never reassigned. Use 'const' instead
return `* @param {${type}} ${paramName}${defaultValue}`;
};

Check failure on line 156 in apps/nunjucks-filters/src/customFilters.js

View workflow job for this annotation

GitHub Actions / Test NodeJS PR - ubuntu-latest

Expected indentation of 2 spaces but found 0

const buildLine = (f, fName, pName) => {
const type = getType(f);
Expand Down

0 comments on commit 2776f9e

Please sign in to comment.