Skip to content

Commit e37d3a0

Browse files
authored
Merge pull request #1347 from cdrini/eslint-trailing-comma
Add eslint trailing comma rule
2 parents 62add6c + 174edf2 commit e37d3a0

63 files changed

Lines changed: 246 additions & 246 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,35 @@ module.exports = {
55
"jquery": true,
66
"es6": true,
77
"node": true,
8-
"jest": true
8+
"jest": true,
99
},
1010
"plugins": [
1111
"testcafe",
12-
"no-jquery"
12+
"no-jquery",
1313
],
1414
"extends": [
1515
"eslint:recommended",
1616
"plugin:testcafe/recommended",
17-
"plugin:no-jquery/deprecated"
17+
"plugin:no-jquery/deprecated",
1818
],
1919
"globals": {
2020
// Browser API
21-
"MediaMetadata": "readonly"
21+
"MediaMetadata": "readonly",
2222
},
2323
"parserOptions": {
2424
"ecmaVersion": 2020,
2525
"ecmaFeatures": { "legacyDecorators": true },
26-
"sourceType": "module"
26+
"sourceType": "module",
2727
},
2828
"rules": {
29-
"comma-dangle": ["error", "only-multiline"],
29+
"comma-dangle": ["error", "always-multiline", {"functions": "only-multiline"}],
3030
"semi": ["error", "always"],
3131
"space-before-blocks": ["error"],
3232
"keyword-spacing": [2, {"before": true, "after": true}],
3333
"indent": ["error", 2, {
3434
// This for some reason causing errors after switch to parser: babel-eslint.
3535
// See https://github.com/babel/babel-eslint/issues/681
36-
"ignoredNodes": ["TemplateLiteral"]
36+
"ignoredNodes": ["TemplateLiteral"],
3737
}],
3838
"no-console": "off", // Used too often behind `debug` options; not dealing with this now
3939
"no-empty": ["error", { "allowEmptyCatch": true }],
@@ -46,6 +46,6 @@ module.exports = {
4646
"no-var": ["error"],
4747
"prefer-const": ["error"],
4848
"space-infix-ops": ["error", { "int32Hint": false }],
49-
"eol-last": ["error", "always"]
50-
}
49+
"eol-last": ["error", "always"],
50+
},
5151
};

babel.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ module.exports = {
66
process.env.NODE_ENV == "development" ? { targets: "last 2 Chrome versions, last 2 Firefox versions, last 2 Safari versions, last 2 Edge versions" } : {
77
targets: "> 2%, ie 11, edge 14, samsung > 9, OperaMini all, UCAndroid > 12, Safari >= 9",
88
useBuiltIns: "usage",
9-
corejs: 3
10-
}
11-
]
9+
corejs: 3,
10+
},
11+
],
1212
],
1313
plugins: [
1414
["@babel/plugin-proposal-decorators", {
1515
version: "2018-09",
16-
decoratorsBeforeExport: true
16+
decoratorsBeforeExport: true,
1717
}],
1818
["@babel/plugin-proposal-class-properties"],
19-
]
19+
],
2020
};

src/BookNavigator/book-navigator.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ export class BookNavigator extends LitElement {
7171
'volumes',
7272
'chapters',
7373
'search',
74-
'bookmarks'
74+
'bookmarks',
7575
];
7676
}
7777

7878
disconnectedCallback() {
7979
this.sharedObserver.removeObserver({
8080
target: this.mainBRContainer,
81-
handler: this.sharedObserverHandler
81+
handler: this.sharedObserverHandler,
8282
});
8383
}
8484

@@ -148,7 +148,7 @@ export class BookNavigator extends LitElement {
148148
item: this.itemMD,
149149
signedIn: this.signedIn,
150150
isAdmin: this.isAdmin,
151-
onProviderChange: () => {}
151+
onProviderChange: () => {},
152152
};
153153
}
154154

@@ -220,7 +220,7 @@ export class BookNavigator extends LitElement {
220220
const method = Object.keys(bookmarks).length ? 'add' : 'remove';
221221
this[`${method}MenuShortcut`]('bookmarks');
222222
this.updateMenuContents();
223-
}
223+
},
224224
});
225225
}
226226

@@ -240,7 +240,7 @@ export class BookNavigator extends LitElement {
240240
this.updateSideMenu('volumes', 'open');
241241
});
242242
}
243-
}
243+
},
244244
});
245245
}
246246

@@ -311,7 +311,7 @@ export class BookNavigator extends LitElement {
311311
*/
312312
updateMenuContents() {
313313
const {
314-
search, downloads, visualAdjustments, share, bookmarks, volumes, chapters
314+
search, downloads, visualAdjustments, share, bookmarks, volumes, chapters,
315315
} = this.menuProviders;
316316
const availableMenus = [volumes, chapters, search, bookmarks, visualAdjustments, share].filter((menu) => !!menu);
317317

@@ -460,7 +460,7 @@ export class BookNavigator extends LitElement {
460460
window.archive_analytics?.send_event(
461461
'BookReader',
462462
`contextmenu-${this.bookIsRestricted ? 'restricted' : 'unrestricted'}`,
463-
e.target?.classList?.value
463+
e.target?.classList?.value,
464464
);
465465
if (!this.bookIsRestricted) {
466466
return;
@@ -479,7 +479,7 @@ export class BookNavigator extends LitElement {
479479
this.sharedObserverHandler = { handleResize: this.handleResize.bind(this) };
480480
this.sharedObserver?.addObserver({
481481
target: this.mainBRContainer,
482-
handler: this.sharedObserverHandler
482+
handler: this.sharedObserverHandler,
483483
});
484484
}
485485

src/BookNavigator/bookmarks/bookmarks-loginCTA.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import buttonStyles from '../assets/button-base.js';
44
class BookmarksLogin extends LitElement {
55
static get properties() {
66
return {
7-
url: { type: String }
7+
url: { type: String },
88
};
99
}
1010

src/BookNavigator/bookmarks/bookmarks-provider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default class BookmarksProvider {
2727
this.component.modal = modal;
2828
this.component.loginOptions = {
2929
loginClicked: this.bookmarksLoginClicked,
30-
loginUrl
30+
loginUrl,
3131
};
3232
this.bindEvents();
3333

src/BookNavigator/bookmarks/ia-bookmarks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class IABookmarks extends LitElement {
6262
editedBookmark: { type: Object },
6363
deleteModalConfig: { type: Object},
6464
modal: { attribute: false },
65-
loginOptions: { type: Object, attribute: false }
65+
loginOptions: { type: Object, attribute: false },
6666
};
6767
}
6868

src/BookNavigator/search/search-provider.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let searchState = {
1313
export default class SearchProvider {
1414
constructor({
1515
onProviderChange,
16-
bookreader
16+
bookreader,
1717
}) {
1818
/* search menu events */
1919
this.onBookSearchInitiated = this.onBookSearchInitiated.bind(this);
@@ -72,7 +72,7 @@ export default class SearchProvider {
7272
errorMessage: '',
7373
};
7474
const updateMenuFor = {
75-
searchCanceled: true
75+
searchCanceled: true,
7676
};
7777
this.updateMenu(updateMenuFor);
7878

src/BookNavigator/sharing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default class SharingProvider {
66
constructor({
77
item,
88
baseHost,
9-
bookreader
9+
bookreader,
1010
}) {
1111
const { identifier, creator, title } = item?.metadata;
1212
const creatorToUse = Array.isArray(creator) ? creator[0] : creator;

src/BookNavigator/viewable-files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import '@internetarchive/ia-item-navigator/dist/src/menus/viewable-files';
99
const sortTypes = {
1010
title_asc: 'title_asc',
1111
title_desc: 'title_desc',
12-
default: 'default'
12+
default: 'default',
1313
};
1414
export default class ViewableFilesProvider {
1515
/**

src/BookNavigator/visual-adjustments/visual-adjustments.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class IABookVisualAdjustments extends LitElement {
4343
get activeOptions() {
4444
return this.options.reduce(
4545
(results, option) => (option.active ? [...results, option.id] : results),
46-
[]
46+
[],
4747
);
4848
}
4949

@@ -71,7 +71,7 @@ export class IABookVisualAdjustments extends LitElement {
7171
bubbles: true,
7272
composed: true,
7373
detail,
74-
})
74+
}),
7575
);
7676
}
7777

@@ -93,7 +93,7 @@ export class IABookVisualAdjustments extends LitElement {
9393
changeActiveStateFor(optionName) {
9494
const updatedOptions = [...this.options];
9595
const checkedOption = updatedOptions.find(
96-
(option) => option.id === optionName
96+
(option) => option.id === optionName,
9797
);
9898
checkedOption.active = !checkedOption.active;
9999
this.options = updatedOptions;

0 commit comments

Comments
 (0)