DEV: fixes eslint/prettier on github actions (#10601)

DEV: fixes eslint/prettier on github actions (#10601)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8b1dc07..f3fbf97 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -146,19 +146,15 @@ jobs:
 
       - name: ESLint (core)
         if: env.BUILD_TYPE == 'LINT' && env.TARGET == 'CORE'
-        run: yarn eslint --ext .js app/assets/javascripts test/javascripts
+        run: yarn eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern app/assets/javascripts test/javascripts
 
       - name: ESLint (core plugins)
         if: env.BUILD_TYPE == 'LINT' && env.TARGET == 'CORE'
-        run: |
-          yarn eslint --ext .js plugins/**/assets/javascripts plugins/**/test/javascripts
-          yarn eslint --ext .es6 plugins/**/assets/javascripts plugins/**/test/javascripts
+        run: yarn eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern plugins/**/{test,assets}/javascripts
 
       - name: ESLint (all plugins)
         if: env.BUILD_TYPE == 'LINT' && env.TARGET == 'PLUGINS'
-        run: |
-          yarn eslint --ext .js plugins/**/assets/javascripts plugins/**/test/javascripts
-          yarn eslint --ext .es6 plugins/**/assets/javascripts plugins/**/test/javascripts
+        run: yarn eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern plugins/**/{test,assets}/javascripts
 
       - name: Prettier (core and core plugins)
         if: env.BUILD_TYPE == 'LINT' && env.TARGET == 'CORE'
diff --git a/.template-lintrc.js b/.template-lintrc.js
index adf0cca..9148dda 100644
--- a/.template-lintrc.js
+++ b/.template-lintrc.js
@@ -50,6 +50,6 @@ module.exports = {
     "simple-unless": true,
     "style-concatenation": true,
     "table-groups": true,
-    "link-href-attributes": false
-  }
+    "link-href-attributes": false,
+  },
 };
diff --git a/plugins/discourse-details/test/javascripts/acceptance/details-button-test.js.es6 b/plugins/discourse-details/test/javascripts/acceptance/details-button-test.js.es6
index 6119ef1..d8fe217 100644
--- a/plugins/discourse-details/test/javascripts/acceptance/details-button-test.js.es6
+++ b/plugins/discourse-details/test/javascripts/acceptance/details-button-test.js.es6
@@ -1,15 +1,16 @@
+import I18n from "I18n";
 import { acceptance } from "helpers/qunit-helpers";
 import { clearPopupMenuOptionsCallback } from "discourse/controllers/composer";
 import selectKit from "helpers/select-kit-helper";
 
 acceptance("Details Button", {
   loggedIn: true,
-  beforeEach: function() {
+  beforeEach: function () {
     clearPopupMenuOptionsCallback();
-  }
+  },
 });
 
-test("details button", async assert => {
+test("details button", async (assert) => {
   const popupMenu = selectKit(".toolbar-popup-menu-options");
 
   await visit("/");
@@ -109,7 +110,7 @@ test("details button", async assert => {
   );
 });
 
-test("details button surrounds all selected text in a single details block", async assert => {
+test("details button surrounds all selected text in a single details block", async (assert) => {
   const multilineInput = "first line\n\nsecond line\n\nthird line";
   const popupMenu = selectKit(".toolbar-popup-menu-options");
 
diff --git a/plugins/discourse-details/test/javascripts/lib/details-cooked-test.js.es6 b/plugins/discourse-details/test/javascripts/lib/details-cooked-test.js.es6
index ab767fd..3c9f36c 100644
--- a/plugins/discourse-details/test/javascripts/lib/details-cooked-test.js.es6
+++ b/plugins/discourse-details/test/javascripts/lib/details-cooked-test.js.es6
@@ -7,13 +7,13 @@ const defaultOpts = buildOptions({
     enable_emoji: true,
     emoji_set: "emoji_one",
     highlighted_languages: "json|ruby|javascript",
-    default_code_lang: "auto"
+    default_code_lang: "auto",
   },
   censoredWords: "shucks|whiz|whizzer",
-  getURL: url => url
+  getURL: (url) => url,
 });
 
-test("details", assert => {
+test("details", (assert) => {
   const cooked = (input, expected, text) => {
     assert.equal(
       new PrettyText(defaultOpts).cook(input),
diff --git a/plugins/discourse-local-dates/test/javascripts/acceptance/local-dates-composer-test.js.es6 b/plugins/discourse-local-dates/test/javascripts/acceptance/local-dates-composer-test.js.es6
index ecec5d0..5ab6ecf 100644
--- a/plugins/discourse-local-dates/test/javascripts/acceptance/local-dates-composer-test.js.es6
+++ b/plugins/discourse-local-dates/test/javascripts/acceptance/local-dates-composer-test.js.es6
@@ -2,11 +2,11 @@ import { acceptance } from "helpers/qunit-helpers";
 
 acceptance("Local Dates - composer", {
   loggedIn: true,
-  settings: { discourse_local_dates_enabled: true }
+  settings: { discourse_local_dates_enabled: true },
 });
 
-test("composer bbcode", async assert => {
-  const getAttr = attr => {
+test("composer bbcode", async (assert) => {
+  const getAttr = (attr) => {
     return find(".d-editor-preview .discourse-local-date.cooked-date").attr(
       `data-${attr}`
     );
diff --git a/plugins/discourse-local-dates/test/javascripts/lib/date-with-zone-helper-test.js.es6 b/plugins/discourse-local-dates/test/javascripts/lib/date-with-zone-helper-test.js.es6
index 4f33519..40b4bd1 100644
--- a/plugins/discourse-local-dates/test/javascripts/lib/date-with-zone-helper-test.js.es6
+++ b/plugins/discourse-local-dates/test/javascripts/lib/date-with-zone-helper-test.js.es6
@@ -13,22 +13,22 @@ function buildDateHelper(params = {}) {
     hour: params.hour || 10,
     minute: params.minute || 5,
     timezone: params.timezone,
-    localTimezone: PARIS
+    localTimezone: PARIS,
   });
 }
 
-QUnit.test("#format", assert => {
+QUnit.test("#format", (assert) => {
   let date = buildDateHelper({
     day: 15,
     month: 2,
     hour: 15,
     minute: 36,
-    timezone: PARIS
+    timezone: PARIS,
   });
   assert.equal(date.format(), "2020-03-15T15:36:00.000+01:00");
 });
 
-QUnit.test("#repetitionsBetweenDates", assert => {
+QUnit.test("#repetitionsBetweenDates", (assert) => {
   let date;
 
   date = buildDateHelper({
@@ -36,7 +36,7 @@ QUnit.test("#repetitionsBetweenDates", assert => {
     month: 1,
     hour: 15,
     minute: 36,
-    timezone: PARIS
+    timezone: PARIS,
   });
   assert.equal(
     date.repetitionsBetweenDates(
@@ -52,7 +52,7 @@ QUnit.test("#repetitionsBetweenDates", assert => {
     month: 1,
     hour: 15,
     minute: 36,
-    timezone: PARIS
+    timezone: PARIS,
   });
   assert.equal(
     date.repetitionsBetweenDates(
@@ -68,7 +68,7 @@ QUnit.test("#repetitionsBetweenDates", assert => {
     month: 1,
     hour: 15,
     minute: 36,
-    timezone: PARIS
+    timezone: PARIS,
   });
   assert.equal(
     date.repetitionsBetweenDates(
@@ -84,7 +84,7 @@ QUnit.test("#repetitionsBetweenDates", assert => {
     month: 1,
     hour: 15,
     minute: 36,
-    timezone: PARIS
+    timezone: PARIS,
   });
   assert.equal(
     date.repetitionsBetweenDates(
@@ -96,7 +96,7 @@ QUnit.test("#repetitionsBetweenDates", assert => {
   );
 });
 
-QUnit.test("#add", assert => {
+QUnit.test("#add", (assert) => {
   let date;
   let futureLocalDate;
 
@@ -105,7 +105,7 @@ QUnit.test("#add", assert => {
     month: 2,
     hour: 15,
     minute: 36,
-    timezone: PARIS
+    timezone: PARIS,
   });
 
   assert.notOk(date.isDST());
@@ -122,7 +122,7 @@ QUnit.test("#add", assert => {
     month: 3,
     hour: 15,
     minute: 36,
-    timezone: PARIS
+    timezone: PARIS,
   });
   assert.ok(date.isDST());
   futureLocalDate = date.add(1, "year");
@@ -138,7 +138,7 @@ QUnit.test("#add", assert => {
     month: 2,
     hour: 15,
     minute: 36,
-    timezone: PARIS
+    timezone: PARIS,
   });
   assert.notOk(date.isDST());
   futureLocalDate = date.add(1, "week");
@@ -154,7 +154,7 @@ QUnit.test("#add", assert => {
     month: 3,
     hour: 15,
     minute: 36,
-    timezone: PARIS
+    timezone: PARIS,
   });
 
   assert.ok(date.isDST());
diff --git a/plugins/discourse-local-dates/test/javascripts/lib/local-date-builder-test.js.es6 b/plugins/discourse-local-dates/test/javascripts/lib/local-date-builder-test.js.es6

[... diff too long, it was truncated ...]

GitHub sha: 110f6ec6

1 Like

This commit appears in #10601 which was merged by jjaffeux.

This commit has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/travis-tests-failing-due-to-eslint/163268/5