Skip to content

Commit

Permalink
Prepend unused variables with "_"
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Jan 3, 2024
1 parent cedd0c4 commit f8366ab
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ module.exports = {
plugins: ["@stylistic", "erb", "cypress"],
rules: {
...customizedStylistic.rules,
"no-unused-vars": "warn",
"no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
...cypressRules,
// see https://github.com/eslint-stylistic/eslint-stylistic/issues/254
"@stylistic/quotes": ["error", "double", { avoidEscape: true }],
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/datetimepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function registerFocusHandlers(datetimePicker, element) {
// or when input field receives focus
var isButtonInvokingFocus = false;

element.find(".td-input").on("click focusin", (e) => {
element.find(".td-input").on("click focusin", (_e) => {
try {
if (!isButtonInvokingFocus) {
datetimePicker.show();
Expand Down
2 changes: 1 addition & 1 deletion app/views/assignments/new.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ new TomSelect("#assignment_medium_id_", {
direction: "asc",
},
render: {
no_results: function (data, escape) {
no_results: function (_data, _escape) {
return '<div class="no-results"><%= t("basics.no_results") %></div>';
},
},
Expand Down
2 changes: 1 addition & 1 deletion app/views/submissions/select_tutorial.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ new TomSelect("#submission_tutorial_id-<%= @submission.id %>", {
direction: "asc",
},
render: {
no_results: function (data, escape) {
no_results: function (_data, _escape) {
return '<div class="no-results"><%= t("basics.no_results") %></div>';
},
},
Expand Down
6 changes: 3 additions & 3 deletions spec/cypress/e2e/courses_spec.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe("Courses", function () {
it("can add tag to course", () => {
cy.appFactories([
["create", "course"],
]).then((records) => {
]).then((_records) => {
cy.visit("/courses/1/edit");
cy.get("#new-tag-button").click();
cy.get("#tag_notions_attributes_0_title").type("Geometrie");
Expand All @@ -28,7 +28,7 @@ describe("Courses", function () {
it("can set editor in course", () => {
cy.appFactories([
["create", "course"],
]).then((records) => {
]).then((_records) => {
cy.visit("/courses/1/edit");
cy.get("#course_editor_ids-ts-control").click();
cy.get("#course_editor_ids-ts-control").type("ad");
Expand Down Expand Up @@ -118,7 +118,7 @@ describe("Courses", function () {

cy.appFactories([
["create_list", "lecture", 6, "released_for_all"],
]).then((records) => {
]).then((_records) => {
cy.visit("/main/start");
// cy.get('input[name="search[fulltext]"]').type(records[0][0].title)
cy.contains("Veranstaltungssuche").click();
Expand Down
2 changes: 1 addition & 1 deletion spec/cypress/e2e/submissions_spec.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe("Submissions", () => {
user_id: 1,
lecture_id: 1,
}],
]).then((lectures) => {});
]).then((_lectures) => {});
});
it("can create submission", () => {
cy.appFactories([
Expand Down
10 changes: 5 additions & 5 deletions spec/cypress/e2e/watchlists_spec.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe("Watchlists", () => {
});
it("can create new watchlist in watchlist view", () => {
cy.appFactories([
]).then((data) => {
]).then((_data) => {
cy.get("#watchlistsIcon").click();
cy.get("#openNewWatchlistForm").click();
cy.get("#watchlistNameField").type("Lernliste");
Expand Down Expand Up @@ -96,7 +96,7 @@ describe("Watchlists", () => {
["create", "watchlist", {
user_id: 1,
}],
]).then((data) => {
]).then((_data) => {
cy.visit("watchlists/1");
cy.get("#watchlistVisiblityCheck").should("not.be.checked");
cy.get("#watchlistVisiblityCheck").click();
Expand All @@ -109,7 +109,7 @@ describe("Watchlists", () => {
["create", "watchlist", "with_user", {
public: true,
}],
]).then((data) => {
]).then((_data) => {
cy.visit("watchlists/1");
cy.get("#watchlistButton").should("exist");
});
Expand All @@ -119,7 +119,7 @@ describe("Watchlists", () => {
["create", "watchlist", "with_user", {
public: false,
}],
]).then((data) => {
]).then((_data) => {
cy.visit("watchlists/1");
cy.get(":nth-child(3) > .row > .col-12 > :nth-child(2)").contains("Du bist nicht berechtigt").should("exist");
});
Expand All @@ -132,7 +132,7 @@ describe("Watchlists", () => {
["create_list", "watchlist_entry", 5, "with_medium", {
watchlist_id: 1,
}],
]).then((data) => {
]).then((_data) => {
cy.get("#watchlistsIcon").click();
cy.get("#reverseButton").click();
cy.wait(100);
Expand Down
2 changes: 1 addition & 1 deletion spec/cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* @type {Cypress.PluginConfig}
*/
module.exports = (on, config) => {
module.exports = (_on, _config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
};

0 comments on commit f8366ab

Please sign in to comment.