From 12afe7d1cf99f832e6faa7cacaf1c469c3685659 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sat, 10 Dec 2022 13:00:43 +0530 Subject: Normalize eslint/tslint configs across app and server codebases --- .eslintignore | 2 +- .eslintrc.js | 2 +- package.json | 3 +-- scripts/build-unix.sh | 13 ++++++------- scripts/build-windows.ps1 | 15 ++++++--------- tsconfig.json | 14 ++++++++------ 6 files changed, 23 insertions(+), 26 deletions(-) diff --git a/.eslintignore b/.eslintignore index 058a2b11d..68b64f029 100644 --- a/.eslintignore +++ b/.eslintignore @@ -30,7 +30,7 @@ node_modules # package files package.json -package-lock.json +pnpm-lock.yaml # Json *.json diff --git a/.eslintrc.js b/.eslintrc.js index 3f56f18cd..54ae4c8ad 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -10,6 +10,7 @@ module.exports = { sourceType: 'module', project: './tsconfig.json', }, + ignorePatterns: ['node_modules', 'build', 'recipes', '.eslintrc.js'], extends: ['airbnb', 'plugin:unicorn/recommended', 'prettier'], plugins: ['jest', 'prettier'], settings: { @@ -19,7 +20,6 @@ module.exports = { }, }, globals: { - // TODO: can be removed once adonisj migration is done use: true, }, env: { diff --git a/package.json b/package.json index 9875c6eba..07c108960 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,7 @@ "manage-translations": "pnpm extract && pnpm compile && rimraf temp.json", "build": "preval-build-info-cli && node esbuild.mjs && electron-builder", "contributors": "all-contributors", - "reformat-files": "prettier --ignore-path .eslintignore --write --require-pragma \"**/*.{js,jsx,scss}\"", - "update-submodules": "git submodule update --init --recursive --remote --rebase --force", + "reformat-files": "prettier --ignore-path .eslintignore --write --require-pragma \"**/*.{js,jsx,mjs,ts,tsx,scss}\"", "prepare-code": "pnpm lint:fix && pnpm reformat-files && pnpm manage-translations", "link-readme": "ts-node scripts/link-readme.ts", "minify-images": "./scripts/minify-images.sh", diff --git a/scripts/build-unix.sh b/scripts/build-unix.sh index 8dae9e5ee..04aa9e70f 100755 --- a/scripts/build-unix.sh +++ b/scripts/build-unix.sh @@ -102,13 +102,6 @@ fi # If 'asdf' is installed, reshim for new nodejs if necessary command_exists asdf && asdf reshim nodejs -# ----------------------------------------------------------------------------- -# Now the meat..... -pnpm i -pnpm prepare-code -pnpm lint -pnpm test - # ----------------------------------------------------------------------------- printf "\n*************** Building recipes ***************\n" pushd recipes @@ -116,6 +109,12 @@ pnpm i && pnpm lint && pnpm reformat-files && pnpm package popd # ----------------------------------------------------------------------------- +# Now the meat..... +pnpm i +pnpm prepare-code +pnpm lint +pnpm test + printf "\n*************** Building app ***************\n" if [[ "$(uname -m)" =~ "arm" ]]; then TARGET_ARCH=arm64 diff --git a/scripts/build-windows.ps1 b/scripts/build-windows.ps1 index ca4fabfe8..3c85e0a38 100644 --- a/scripts/build-windows.ps1 +++ b/scripts/build-windows.ps1 @@ -127,8 +127,6 @@ if((-not $NPM_CONFIG_MSVS_VERSION) -or -not ($EXPECTED_MSVST_VERSION -contains $ } - - # ----------------------------------------------------------------------------- # Ensure that the system dependencies are at the correct version - recover if not # Check pnpm version @@ -147,13 +145,6 @@ if ($ACTUAL_PNPM_VERSION -ne $EXPECTED_RECIPES_PNPM_VERSION) { actual : [$EXPECTED_PNPM_VERSION]" } -# ----------------------------------------------------------------------------- -# Now the meat..... -& pnpm i -& pnpm prepare-code -& pnpm lint -& pnpm test - # ----------------------------------------------------------------------------- Write-Host "*************** Building recipes ***************" Push-Location recipes @@ -161,6 +152,12 @@ pnpm i && pnpm lint && pnpm reformat-files && pnpm package Pop-Location # ----------------------------------------------------------------------------- +# Now the meat..... +& pnpm i +& pnpm prepare-code +& pnpm lint +& pnpm test + Write-Host "*************** Building app ***************" if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") { $TARGET_ARCH="arm64" diff --git a/tsconfig.json b/tsconfig.json index bf7c81e51..6a1d5d1b2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,4 +1,12 @@ { + "include": [ + "**/*" + ], + "exclude": [ + "node_modules", + "build", + "recipes" + ], "compilerOptions": { "outDir": ".tmp", "rootDir": "./", @@ -46,10 +54,4 @@ "forceConsistentCasingInFileNames": true, "useDefineForClassFields": true }, - "include": [ - "src", - "scripts", - "test", - "gulpfile.babel.ts", - ], } -- cgit v1.2.3-54-g00ecf