Skip to content

Commit

Permalink
🔧 Add eslint/prettier configuration files
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbcberio committed Jan 6, 2022
1 parent d609321 commit 0a18826
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.eslintrc
62 changes: 62 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -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"]
}
}
14 changes: 14 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit 0a18826

Please sign in to comment.