DEV: apply coding standards (#2)

DEV: apply coding standards (#2)

diff --git a/.eslintrc b/.eslintrc
index 9905e43..7898fbf 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,105 +1,3 @@
 {
-  "env": {
-    "jasmine": true,
-    "node": true,
-    "mocha": true,
-    "browser": true,
-    "builtin": true
-  },
-  "parserOptions": {
-    "ecmaVersion": 7,
-    "sourceType": "module"
-  },
-  "globals":
-    {"Ember":true,
-    "jQuery":true,
-    "$":true,
-    "RSVP":true,
-    "Discourse":true,
-    "Em":true,
-    "Handlebars":true,
-    "I18n":true,
-    "bootbox":true,
-    "module":true,
-    "moduleFor":true,
-    "moduleForComponent":true,
-    "Pretender":true,
-    "sandbox":true,
-    "controllerFor":true,
-    "test":true,
-    "ok":true,
-    "not":true,
-    "expect":true,
-    "equal":true,
-    "visit":true,
-    "andThen":true,
-    "click":true,
-    "currentPath":true,
-    "currentRouteName":true,
-    "currentURL":true,
-    "fillIn":true,
-    "keyEvent":true,
-    "triggerEvent":true,
-    "count":true,
-    "exists":true,
-    "visible":true,
-    "invisible":true,
-    "asyncRender":true,
-    "selectDropdown":true,
-    "asyncTestDiscourse":true,
-    "fixture":true,
-    "find":true,
-    "sinon":true,
-    "moment":true,
-    "start":true,
-    "_":true,
-    "alert":true,
-    "containsInstance":true,
-    "deepEqual":true,
-    "notEqual":true,
-    "define":true,
-    "require":true,
-    "requirejs":true,
-    "hasModule":true,
-    "Blob":true,
-    "File":true},
-  "rules": {
-    "block-scoped-var": 2,
-    "dot-notation": 0,
-    "eqeqeq": [
-      2,
-      "allow-null"
-    ],
-    "guard-for-in": 2,
-    "no-bitwise": 2,
-    "no-caller": 2,
-    "no-cond-assign": 0,
-    "no-debugger": 2,
-    "no-empty": 0,
-    "no-eval": 2,
-    "no-extend-native": 2,
-    "no-extra-parens": 0,
-    "no-irregular-whitespace": 2,
-    "no-iterator": 2,
-    "no-loop-func": 2,
-    "no-multi-str": 2,
-    "no-new": 2,
-    "no-plusplus": 0,
-    "no-proto": 2,
-    "no-script-url": 2,
-    "no-sequences": 2,
-    "no-shadow": 2,
-    "no-undef": 2,
-    "no-unused-vars": 2,
-    "no-with": 2,
-    "no-this-before-super": 2,
-    "semi": 2,
-    "strict": 0,
-    "valid-typeof": 2,
-    "wrap-iife": [
-      2,
-      "inside"
-    ]
-  },
-  "parser": "babel-eslint"
+  "extends": "eslint-config-discourse"
 }
diff --git a/.gitignore b/.gitignore
index e69de29..2d83702 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,3 @@
+node_modules
+yarn-error.log
+.rubocop-https---raw-githubusercontent-com-discourse-*
diff --git a/.template-lintrc.js b/.template-lintrc.js
new file mode 100644
index 0000000..a558b8e
--- /dev/null
+++ b/.template-lintrc.js
@@ -0,0 +1,4 @@
+module.exports = {
+  plugins: ["ember-template-lint-plugin-discourse"],
+  extends: "discourse:recommended",
+};
diff --git a/assets/javascripts/initializers/inline-footnotes.js.es6 b/assets/javascripts/initializers/inline-footnotes.js.es6
index dcbb6b3..bf43ec3 100644
--- a/assets/javascripts/initializers/inline-footnotes.js.es6
+++ b/assets/javascripts/initializers/inline-footnotes.js.es6
@@ -2,14 +2,9 @@ import { withPluginApi } from "discourse/lib/plugin-api";
 import { iconHTML } from "discourse-common/lib/icon-library";
 
 function showFootnote() {
-  let id = $(this)
-    .prev()
-    .find("a")[0].href;
+  let id = $(this).prev().find("a")[0].href;
   id = "#" + id.split("#")[1];
-  let html = $(this)
-    .parents(".cooked")
-    .find(id)
-    .html();
+  let html = $(this).parents(".cooked").find(id).html();
 
   $("#footnote-tooltip").remove();
 
@@ -35,7 +30,7 @@ function showFootnote() {
       "</div></div>"
   );
 
-  $(window).on("click.footnote", e => {
+  $(window).on("click.footnote", (e) => {
     if ($(e.target).closest("#footnote-tooltip").length === 0) {
       $("#footnote-tooltip").remove();
       $(window).off("click.footnote");
@@ -49,7 +44,7 @@ function showFootnote() {
   let left = pos.left - $tooltip.width() / 2 + $elip.width() + 3;
   if (left < 0) {
     $("#footnote-tooltip .footnote-tooltip-pointer").css({
-      "margin-left": left * 2 + "px"
+      "margin-left": left * 2 + "px",
     });
     left = 0;
   }
@@ -61,14 +56,14 @@ function showFootnote() {
     left = topicWidth - $tooltip.width();
 
     $("#footnote-tooltip .footnote-tooltip-pointer").css({
-      "margin-left": (oldLeft - left) * 2 + "px"
+      "margin-left": (oldLeft - left) * 2 + "px",
     });
   }
 
   $tooltip.css({
     top: pos.top + 5 + "px",
     left: left + "px",
-    visibility: "visible"
+    visibility: "visible",
   });
 
   return false;
@@ -100,13 +95,13 @@ export default {
       return;
     }
 
-    withPluginApi("0.8.9", api => {
+    withPluginApi("0.8.9", (api) => {
       api.decorateCooked(
-        $elem => {
+        ($elem) => {
           inlineFootnotes($elem);
         },
         { id: "inline-footnotes" }
       );
     });
-  }
+  },
 };
diff --git a/assets/javascripts/lib/discourse-markdown/footnotes.js.es6 b/assets/javascripts/lib/discourse-markdown/footnotes.js.es6
index 5dcb32d..e9b93b5 100644
--- a/assets/javascripts/lib/discourse-markdown/footnotes.js.es6
+++ b/assets/javascripts/lib/discourse-markdown/footnotes.js.es6
@@ -8,7 +8,7 @@ export function setup(helper) {
     "hr.footnotes-sep",
     "li.footnote-item",
     "a.footnote-backref",
-    "sup.footnote-ref"
+    "sup.footnote-ref",
   ]);
 
   helper.whiteList({
@@ -16,7 +16,7 @@ export function setup(helper) {
       if ((tag === "a" || tag === "li") && name === "id") {
         return !!value.match(/^fn(ref)?\d+$/);
       }
-    }
+    },
   });
 
   helper.registerPlugin(window.markdownitFootnote);
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..9df2b90
--- /dev/null
+++ b/package.json
@@ -0,0 +1,7 @@
+{
+  "author": "Discourse",
+  "license": "MIT",
+  "devDependencies": {
+    "eslint-config-discourse": "latest"
+  }
+}
diff --git a/yarn.lock b/yarn.lock
new file mode 100644
index 0000000..aece863
--- /dev/null
+++ b/yarn.lock
@@ -0,0 +1,1595 @@
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
+# yarn lockfile v1
+
+
+"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4":
+  version "7.10.4"
+  resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a"
+  integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==
+  dependencies:
+    "@babel/highlight" "^7.10.4"
+
+"@babel/generator@^7.11.5":
+  version "7.11.6"
+  resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.11.6.tgz#b868900f81b163b4d464ea24545c61cbac4dc620"
+  integrity sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==
+  dependencies:
+    "@babel/types" "^7.11.5"
+    jsesc "^2.5.1"
+    source-map "^0.5.0"
+
+"@babel/helper-function-name@^7.10.4":
+  version "7.10.4"
+  resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz#d2d3b20c59ad8c47112fa7d2a94bc09d5ef82f1a"
+  integrity sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==
+  dependencies:
+    "@babel/helper-get-function-arity" "^7.10.4"
+    "@babel/template" "^7.10.4"
+    "@babel/types" "^7.10.4"
+
+"@babel/helper-get-function-arity@^7.10.4":
+  version "7.10.4"
+  resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz#98c1cbea0e2332f33f9a4661b8ce1505b2c19ba2"
+  integrity sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==
+  dependencies:
+    "@babel/types" "^7.10.4"
+
+"@babel/helper-split-export-declaration@^7.11.0":
+  version "7.11.0"
+  resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz#f8a491244acf6a676158ac42072911ba83ad099f"

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

GitHub sha: 7374397f

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