From 0a188269789857cefc00c4a2ff49d85bd5a1ae30 Mon Sep 17 00:00:00 2001 From: alexbcberio Date: Thu, 6 Jan 2022 15:02:26 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Add=20eslint/prettier=20configur?= =?UTF-8?q?ation=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintignore | 1 + .eslintrc | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++ .prettierrc | 14 ++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 .eslintignore create mode 100644 .eslintrc create mode 100644 .prettierrc diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9009dcd --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +.eslintrc \ No newline at end of file diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..76556ef --- /dev/null +++ b/.eslintrc @@ -0,0 +1,62 @@ +{ + "root": true, + "env": { + "node": true + }, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 2021, + "sourceType": "module" + }, + "plugins": ["@typescript-eslint", "prettier"], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "prettier" + ], + "rules": { + "no-promise-executor-return": ["error"], + "no-template-curly-in-string": ["error"], + "require-atomic-updates": ["error"], + "accessor-pairs": ["error"], + "array-callback-return": ["error"], + "class-methods-use-this": ["error"], + "consistent-return": ["error"], + "curly": ["error", "all"], + "default-case": ["error"], + "default-case-last": ["error"], + "default-param-last": ["error"], + "dot-location": ["error", "property"], + "dot-notation": ["error"], + "eqeqeq": ["error"], + "max-classes-per-file": ["error", 1], + "no-alert": ["error"], + // TODO: log using pino and enable this rule later on + // "no-console": ["error"], + "no-constructor-return": ["error"], + "no-else-return": ["error"], + "no-empty-function": ["error"], + "no-empty-pattern": ["error"], + "no-magic-numbers": ["warn"], + "no-multi-spaces": ["error"], + "no-multi-str": ["error"], + "no-new": ["error"], + "no-return-assign": ["error"], + "no-return-await": ["error"], + "no-self-compare": ["error"], + "no-unused-expressions": ["error"], + "no-useless-concat": ["error"], + "no-useless-return": ["error"], + "require-await": ["error"], + "no-label-var": ["error"], + "no-undefined": ["error"], + "no-use-before-define": ["error"], + "no-duplicate-imports": ["error"], + "no-useless-computed-key": ["error"], + "no-useless-constructor": ["error"], + "no-var": ["error"], + "object-shorthand": ["error"], + "prefer-const": ["error"], + "prefer-template": ["error"] + } +} diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..f5c56bc --- /dev/null +++ b/.prettierrc @@ -0,0 +1,14 @@ +{ + "$schema": "http://json.schemastore.org/prettierrc", + "printWidth": 80, + "tabWidth": 2, + "useTabs": false, + "semi": true, + "singleQuote": false, + "quoteProps": "as-needed", + "trailingComma": "es5", + "bracketSpacing": true, + "htmlWhitespaceSensitivity": "css", + "endOfLine": "lf", + "embeddedLanguageFormatting": "off" +}