From 7084d5b9f3d048ba9a1d9e77aa3ab5c908c3d3b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Iv=C3=A1n=20Vieitez=20Parra?= <3857362+corrideat@users.noreply.github.com> Date: Fri, 23 Feb 2024 11:41:36 +0100 Subject: [PATCH] Re-add eslint and prettier RC files --- .eslintrc.cjs | 59 +++++++++++++++++++++++++++++++++++++++++++++++++ .prettierrc.cjs | 23 +++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 .eslintrc.cjs create mode 100644 .prettierrc.cjs diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..973aa54 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,59 @@ +/* Copyright © 2021 Exact Realty Limited. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +module.exports = { + root: true, + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + env: { node: true }, + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'prettier', + 'plugin:prettier/recommended', + ], + rules: { + '@typescript-eslint/naming-convention': [ + 'error', + { + selector: 'typeParameter', + format: ['PascalCase'], + prefix: ['T'], + }, + { + selector: 'interface', + format: ['PascalCase'], + prefix: ['I'], + }, + { + selector: 'enumMember', + format: ['UPPER_CASE'], + }, + { + selector: 'variable', + modifiers: ['exported'], + format: ['camelCase', 'PascalCase'], + }, + { + selector: 'typeProperty', + format: ['camelCase'], + }, + { + selector: 'method', + format: ['camelCase'], + }, + ], + }, +}; diff --git a/.prettierrc.cjs b/.prettierrc.cjs new file mode 100644 index 0000000..681a5a4 --- /dev/null +++ b/.prettierrc.cjs @@ -0,0 +1,23 @@ +/* Copyright © 2021 Exact Realty Limited. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +module.exports = { + semi: true, + trailingComma: "all", + singleQuote: true, + printWidth: 80, + tabWidth: 4, + useTabs: true, +};