aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Vijay A <vraravam@users.noreply.github.com>2022-12-10 13:00:43 +0530
committerLibravatar Vijay A <vraravam@users.noreply.github.com>2022-12-10 13:00:43 +0530
commit12afe7d1cf99f832e6faa7cacaf1c469c3685659 (patch)
tree4a130682c36c71a6c7f44a0576197b4e932e137c
parent6.2.3-nightly.4 [skip ci] (diff)
downloadferdium-app-12afe7d1cf99f832e6faa7cacaf1c469c3685659.tar.gz
ferdium-app-12afe7d1cf99f832e6faa7cacaf1c469c3685659.tar.zst
ferdium-app-12afe7d1cf99f832e6faa7cacaf1c469c3685659.zip
Normalize eslint/tslint configs across app and server codebases
-rw-r--r--.eslintignore2
-rw-r--r--.eslintrc.js2
-rw-r--r--package.json3
-rwxr-xr-xscripts/build-unix.sh13
-rw-r--r--scripts/build-windows.ps115
-rw-r--r--tsconfig.json14
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
30 30
31# package files 31# package files
32package.json 32package.json
33package-lock.json 33pnpm-lock.yaml
34 34
35# Json 35# Json
36*.json 36*.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 = {
10 sourceType: 'module', 10 sourceType: 'module',
11 project: './tsconfig.json', 11 project: './tsconfig.json',
12 }, 12 },
13 ignorePatterns: ['node_modules', 'build', 'recipes', '.eslintrc.js'],
13 extends: ['airbnb', 'plugin:unicorn/recommended', 'prettier'], 14 extends: ['airbnb', 'plugin:unicorn/recommended', 'prettier'],
14 plugins: ['jest', 'prettier'], 15 plugins: ['jest', 'prettier'],
15 settings: { 16 settings: {
@@ -19,7 +20,6 @@ module.exports = {
19 }, 20 },
20 }, 21 },
21 globals: { 22 globals: {
22 // TODO: can be removed once adonisj migration is done
23 use: true, 23 use: true,
24 }, 24 },
25 env: { 25 env: {
diff --git a/package.json b/package.json
index 9875c6eba..07c108960 100644
--- a/package.json
+++ b/package.json
@@ -33,8 +33,7 @@
33 "manage-translations": "pnpm extract && pnpm compile && rimraf temp.json", 33 "manage-translations": "pnpm extract && pnpm compile && rimraf temp.json",
34 "build": "preval-build-info-cli && node esbuild.mjs && electron-builder", 34 "build": "preval-build-info-cli && node esbuild.mjs && electron-builder",
35 "contributors": "all-contributors", 35 "contributors": "all-contributors",
36 "reformat-files": "prettier --ignore-path .eslintignore --write --require-pragma \"**/*.{js,jsx,scss}\"", 36 "reformat-files": "prettier --ignore-path .eslintignore --write --require-pragma \"**/*.{js,jsx,mjs,ts,tsx,scss}\"",
37 "update-submodules": "git submodule update --init --recursive --remote --rebase --force",
38 "prepare-code": "pnpm lint:fix && pnpm reformat-files && pnpm manage-translations", 37 "prepare-code": "pnpm lint:fix && pnpm reformat-files && pnpm manage-translations",
39 "link-readme": "ts-node scripts/link-readme.ts", 38 "link-readme": "ts-node scripts/link-readme.ts",
40 "minify-images": "./scripts/minify-images.sh", 39 "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
@@ -103,19 +103,18 @@ fi
103command_exists asdf && asdf reshim nodejs 103command_exists asdf && asdf reshim nodejs
104 104
105# ----------------------------------------------------------------------------- 105# -----------------------------------------------------------------------------
106# Now the meat.....
107pnpm i
108pnpm prepare-code
109pnpm lint
110pnpm test
111
112# -----------------------------------------------------------------------------
113printf "\n*************** Building recipes ***************\n" 106printf "\n*************** Building recipes ***************\n"
114pushd recipes 107pushd recipes
115pnpm i && pnpm lint && pnpm reformat-files && pnpm package 108pnpm i && pnpm lint && pnpm reformat-files && pnpm package
116popd 109popd
117 110
118# ----------------------------------------------------------------------------- 111# -----------------------------------------------------------------------------
112# Now the meat.....
113pnpm i
114pnpm prepare-code
115pnpm lint
116pnpm test
117
119printf "\n*************** Building app ***************\n" 118printf "\n*************** Building app ***************\n"
120if [[ "$(uname -m)" =~ "arm" ]]; then 119if [[ "$(uname -m)" =~ "arm" ]]; then
121 TARGET_ARCH=arm64 120 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 $
127} 127}
128 128
129 129
130
131
132# ----------------------------------------------------------------------------- 130# -----------------------------------------------------------------------------
133# Ensure that the system dependencies are at the correct version - recover if not 131# Ensure that the system dependencies are at the correct version - recover if not
134# Check pnpm version 132# Check pnpm version
@@ -148,19 +146,18 @@ if ($ACTUAL_PNPM_VERSION -ne $EXPECTED_RECIPES_PNPM_VERSION) {
148} 146}
149 147
150# ----------------------------------------------------------------------------- 148# -----------------------------------------------------------------------------
151# Now the meat.....
152& pnpm i
153& pnpm prepare-code
154& pnpm lint
155& pnpm test
156
157# -----------------------------------------------------------------------------
158Write-Host "*************** Building recipes ***************" 149Write-Host "*************** Building recipes ***************"
159Push-Location recipes 150Push-Location recipes
160pnpm i && pnpm lint && pnpm reformat-files && pnpm package 151pnpm i && pnpm lint && pnpm reformat-files && pnpm package
161Pop-Location 152Pop-Location
162 153
163# ----------------------------------------------------------------------------- 154# -----------------------------------------------------------------------------
155# Now the meat.....
156& pnpm i
157& pnpm prepare-code
158& pnpm lint
159& pnpm test
160
164Write-Host "*************** Building app ***************" 161Write-Host "*************** Building app ***************"
165if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") { 162if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") {
166 $TARGET_ARCH="arm64" 163 $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 @@
1{ 1{
2 "include": [
3 "**/*"
4 ],
5 "exclude": [
6 "node_modules",
7 "build",
8 "recipes"
9 ],
2 "compilerOptions": { 10 "compilerOptions": {
3 "outDir": ".tmp", 11 "outDir": ".tmp",
4 "rootDir": "./", 12 "rootDir": "./",
@@ -46,10 +54,4 @@
46 "forceConsistentCasingInFileNames": true, 54 "forceConsistentCasingInFileNames": true,
47 "useDefineForClassFields": true 55 "useDefineForClassFields": true
48 }, 56 },
49 "include": [
50 "src",
51 "scripts",
52 "test",
53 "gulpfile.babel.ts",
54 ],
55} 57}