Skip to content

Commit

Permalink
DEV: Update eslint config (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaylorhq authored Nov 19, 2024
1 parent f289194 commit e841ad4
Show file tree
Hide file tree
Showing 13 changed files with 192 additions and 171 deletions.
1 change: 0 additions & 1 deletion .eslintrc.cjs

This file was deleted.

8 changes: 4 additions & 4 deletions assets/javascripts/discourse/components/param-input-form.gjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Component from "@glimmer/component";
import EmberObject, { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { service } from "@ember/service";
import { dasherize } from "@ember/string";
import { isEmpty } from "@ember/utils";
import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
Expand Down Expand Up @@ -235,7 +235,7 @@ export default class ParamInputForm extends Component {
return null;
}
return moment(new Date(value).toISOString()).format("YYYY-MM-DD");
} catch (err) {
} catch {
this.addError(info.identifier, ERRORS.INVALID_DATE(String(value)));
return null;
}
Expand All @@ -247,7 +247,7 @@ export default class ParamInputForm extends Component {
return moment(new Date(`1970/01/01 ${value}`).toISOString()).format(
"HH:mm"
);
} catch (err) {
} catch {
this.addError(info.identifier, ERRORS.INVALID_TIME(String(value)));
return null;
}
Expand All @@ -259,7 +259,7 @@ export default class ParamInputForm extends Component {
return moment(new Date(value).toISOString()).format(
"YYYY-MM-DD HH:mm"
);
} catch (err) {
} catch {
this.addError(info.identifier, ERRORS.INVALID_TIME(String(value)));
return null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Component from "@glimmer/component";
import { inject as service } from "@ember/service";
import { service } from "@ember/service";
import GroupChooser from "select-kit/components/group-chooser";

export default class GroupInput extends Component {
Expand Down
2 changes: 1 addition & 1 deletion assets/javascripts/discourse/components/query-result.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import { schedule } from "@ember/runloop";
import { inject as service } from "@ember/service";
import { service } from "@ember/service";
import { capitalize } from "@ember/string";
import { ajax } from "discourse/lib/ajax";
import Badge from "discourse/models/badge";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default class QueryRowContent extends Component {
component: componentDefinition.component || TextViewComponent,
ctx,
};
} catch (e) {
} catch {
return "error";
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Component from "@glimmer/component";
import { cached } from "@glimmer/tracking";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { service } from "@ember/service";
import FullscreenCodeModal from "discourse/components/modal/fullscreen-code";

export default class Json extends Component {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { tracked } from "@glimmer/tracking";
import Controller from "@ember/controller";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { service } from "@ember/service";
import { Promise } from "rsvp";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { tracked } from "@glimmer/tracking";
import Controller from "@ember/controller";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { service } from "@ember/service";
import BookmarkModal from "discourse/components/modal/bookmark";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
Expand Down
2 changes: 1 addition & 1 deletion assets/javascripts/discourse/routes/group-reports-index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { inject as service } from "@ember/service";
import { service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import DiscourseRoute from "discourse/routes/discourse";

Expand Down
2 changes: 1 addition & 1 deletion assets/javascripts/discourse/routes/group-reports-show.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { inject as service } from "@ember/service";
import { service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import DiscourseRoute from "discourse/routes/discourse";

Expand Down
3 changes: 3 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import DiscourseRecommended from "@discourse/lint-configs/eslint";

export default [...DiscourseRecommended];
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"private": true,
"devDependencies": {
"@discourse/lint-configs": "1.3.10",
"@discourse/lint-configs": "2.0.1",
"ember-template-lint": "6.0.0",
"eslint": "8.57.1",
"prettier": "2.8.8",
"@babel/plugin-proposal-decorators": "^7.25.7"
"eslint": "9.14.0",
"prettier": "2.8.8"
},
"engines": {
"node": ">= 18",
Expand Down
Loading

0 comments on commit e841ad4

Please sign in to comment.