From f4383d0c213df7c9aa1227172d331ede4cc98bf9 Mon Sep 17 00:00:00 2001 From: KishiTheMechanic Date: Sun, 10 Sep 2023 17:32:34 +0200 Subject: [PATCH] add overrides on eslintrc --- src/templates/init/eslintrc.json.ts | 62 +++++++++++++++++++++++++++++ yarn.lock | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/src/templates/init/eslintrc.json.ts b/src/templates/init/eslintrc.json.ts index ed36641e..20ad923e 100755 --- a/src/templates/init/eslintrc.json.ts +++ b/src/templates/init/eslintrc.json.ts @@ -41,6 +41,37 @@ export const eslintrcJson = async (appName: string, template: string) => { }, ], }, + overrides: [ + { + files: ['./functions/**/*.ts', './graphql/**/*.ts'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'prettier', + ], + parserOptions: { + sourceType: 'module', + ecmaVersion: 'latest', + }, + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + env: { + es6: true, + }, + rules: { + '@typescript-eslint/no-explicit-any': 0, + '@typescript-eslint/no-var-requires': 0, + '@typescript-eslint/no-unused-vars': 0, + '@typescript-eslint/no-empty-function': 0, + '@typescript-eslint/ban-ts-comment': [ + 'off', + { + 'ts-ignore': 'allow-with-description', + }, + ], + }, + }, + ], } } else if ( template === SkeetTemplate.NextJsFirestore || @@ -78,6 +109,37 @@ export const eslintrcJson = async (appName: string, template: string) => { }, ], }, + overrides: [ + { + files: ['./functions/**/*.ts', './graphql/**/*.ts'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'prettier', + ], + parserOptions: { + sourceType: 'module', + ecmaVersion: 'latest', + }, + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + env: { + es6: true, + }, + rules: { + '@typescript-eslint/no-explicit-any': 0, + '@typescript-eslint/no-var-requires': 0, + '@typescript-eslint/no-unused-vars': 0, + '@typescript-eslint/no-empty-function': 0, + '@typescript-eslint/ban-ts-comment': [ + 'off', + { + 'ts-ignore': 'allow-with-description', + }, + ], + }, + }, + ], } } diff --git a/yarn.lock b/yarn.lock index a2cd7ab1..042f4007 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1022,7 +1022,7 @@ dependencies: "@sinonjs/commons" "^3.0.0" -"@skeet-framework/ai@^1.6.5": +"@skeet-framework/ai@1.6.5": version "1.6.5" resolved "https://registry.yarnpkg.com/@skeet-framework/ai/-/ai-1.6.5.tgz#49e8abf2e6e96483981ba61c03fdb4df4c4f0d6f" integrity sha512-xmxhMVdHObl2s8ssk3TMnCzQTImgv6d2AuYX/XACJQVk5+b7FqjVKvTOOoq1dGnbifLeTSkQyKNHF3rPqASGDA==