Skip to content

Commit

Permalink
Fix ES Lint issues with Citation collection and model
Browse files Browse the repository at this point in the history
Fix ES Lint issues with Citation collection and model
  • Loading branch information
rushirajnenuji committed Sep 4, 2024
1 parent e7e32ff commit 82cb423
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 76 deletions.
17 changes: 9 additions & 8 deletions src/js/collections/Citations.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
"use strict";

define(["jquery", "underscore", "backbone", "models/CitationModel"], function (
define(["jquery", "underscore", "backbone", "models/CitationModel"], (
$,
_,
Backbone,
CitationModel,
) {
) => {
/**
* @class Citations
* @classdesc Citations represents the Citations list
* found at https://app.swaggerhub.com/apis/nenuji/data-metrics/1.0.0.3.
* For details regarding a single Citation Entity, refer `models/CitationModel`
* @classcategory Collections
* @name Citations
* @extends Backbone.Collection
* @constructor
* @augments Backbone.Collection
* @class
*/
var Citations = Backbone.Collection.extend(
const Citations = Backbone.Collection.extend(
/** @lends Citations.prototype */ {
// eslint-disable-next-line object-shorthand
model: function (attrs, options) {
// We use the inline require here in addition to the define above to
// avoid an issue caused by the circular dependency between
// CitationModel and Citations
var CitationModel = require("models/CitationModel");
const CitationModel = require("models/CitationModel");
return new CitationModel(attrs, options);
},

//The name of this type of collection
// The name of this type of collection
type: "Citations",

// Used for sorting the year in the reverse Chronological order
comparator: function (model) {
comparator(model) {
return -model.get("year_of_publishing"); // Note the minus!
},
},
Expand Down
Loading

0 comments on commit 82cb423

Please sign in to comment.