Add eslint
- Copy eslint configs from TransPlace's moderation bot
- Modify some settings to better fit this project
diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 0000000..34a9df8
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,48 @@
+{
+ "env": {
+ "browser": false,
+ "es2021": true
+ },
+ "ignorePatterns": ["dist/"],
+ "extends": [
+ "eslint:recommended",
+ "plugin:@typescript-eslint/recommended"
+ ],
+ "parser": "@typescript-eslint/parser",
+ "parserOptions": {
+ "ecmaVersion": "latest",
+ "sourceType": "module"
+ },
+ "plugins": [
+ "@typescript-eslint"
+ ],
+ "rules": {
+ "indent": [
+ "error",
+ 4
+ ],
+ "linebreak-style": [
+ "error",
+ "unix"
+ ],
+ "quotes": [
+ "error",
+ "double"
+ ],
+ "semi": [
+ "error",
+ "always"
+ ],
+ "no-unused-vars": "off",
+ "@typescript-eslint/no-unused-vars": [
+ "warn",
+ {
+ "argsIgnorePattern": "^_",
+ "varsIgnorePattern": "^_",
+ "caughtErrorsIgnorePattern": "^_"
+ }
+ ],
+ "no-trailing-spaces": "error",
+ "@typescript-eslint/no-explicit-any": "error"
+ }
+}