Skip to content

Commit

Permalink
eslintrc: lint npf.js
Browse files Browse the repository at this point in the history
overrides have been added to make modification minimal

TODO: improve npf.js more drastically to remove need for overrides
  • Loading branch information
AprilSylph committed Nov 5, 2021
1 parent 9b1c655 commit 769387e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 11 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,17 @@
"parserOptions": {
"ecmaVersion": 12
},
"rules": {
},
"overrides": [
{
"files": ["src/lib/npf.js"],
"rules": {
"camelcase": "off",
"no-cond-assign": "off",
"no-extend-native": "off"
}
}
],
"ignorePatterns": [
"lib/"
"*.min.js"
]
}
4 changes: 2 additions & 2 deletions src/lib/npf.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

const keyBy = (array, input) => array.reduce((accumulator, currentValue) => Object.assign(accumulator, { [currentValue[input]]: currentValue }), {});
Object.prototype.tap = function(f) { f(this); return this; };
Object.prototype.tap = function (f) { f(this); return this; };

export const renderContent = ({ content: blocks, layout }) => {
const content = new DocumentFragment();
Expand Down Expand Up @@ -35,7 +35,7 @@ export const renderContent = ({ content: blocks, layout }) => {
askContent.append(...renderRow(row));
} else if (row.blocks.find(i => i > truncate_after) !== undefined) {
details = details || document.createElement('details').tap(d => {
d.append(document.createElement('summary').tap(s => s.textContent = 'Keep reading'));
d.append(document.createElement('summary').tap(s => { s.textContent = 'Keep reading'; }));
content.append(d);
});
details.append(...renderRow(row));
Expand Down

0 comments on commit 769387e

Please sign in to comment.