Skip to content

Commit

Permalink
refactor: ⚡ implement eslint by default
Browse files Browse the repository at this point in the history
  • Loading branch information
leifermendez committed Nov 17, 2023
1 parent 6b1bba7 commit 7b9b8eb
Show file tree
Hide file tree
Showing 32 changed files with 87 additions and 37 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"lint:check": "eslint .",
"lint:fix": "eslint --fix ./packages",
"build:portal-web": "cd ./packages/portal/ && pnpm run build.types && pnpm run build.client && pnpm run build.server && pnpm run lint --fix",
"build:full": "pnpm run build:portal-web && pnpm run cli:rollup && pnpm run bot:rollup && pnpm run provider:rollup && pnpm run database:rollup && pnpm run contexts:rollup && pnpm run create-bot-whatsapp:rollup && pnpm run portal:rollup",
"build:full": "pnpm run build:portal-web && pnpm run cli:rollup && pnpm run bot:rollup && pnpm run provider:rollup && pnpm run database:rollup && pnpm run contexts:rollup && pnpm run create-bot-whatsapp:rollup && pnpm run eslint-plugin:rollup && pnpm run portal:rollup",
"build": "pnpm run cli:rollup && pnpm run bot:rollup && pnpm run provider:rollup && pnpm run database:rollup && pnpm run contexts:rollup && pnpm run create-bot-whatsapp:rollup && pnpm run portal:rollup && pnpm run eslint-plugin:rollup",
"copy.lib": "node ./scripts/move.js",
"test.unit": "node ./node_modules/uvu/bin.js packages test",
Expand Down
6 changes: 6 additions & 0 deletions scripts/checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ const checkEveryProvider = async (provider = '', stable = true) => {
const devParse = Object.entries(dependencies)
const newDevParse = {}
for (const [pkgName, pkgVersion] of devParse) {
if (!pkgVersion.includes('^')) {
newDevParse[pkgName] = pkgVersion
continue
}
console.log(`[VERSION]:${pkgVersion}`)

if (!stable) newDevParse[pkgName] = await checkPkg(pkgName)
if (stable) newDevParse[pkgName] = await checkPkgStable(pkgName, pkgVersion)

Expand Down
5 changes: 3 additions & 2 deletions starters/apps/base-baileys-json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
"@bot-whatsapp/provider": "latest",
"@bot-whatsapp/portal": "latest",
"mime-types": "2.1.35",
"@whiskeysockets/baileys": "^6.4.0",
"wa-sticker-formatter": "4.3.2"
"@whiskeysockets/baileys": "6.5.0",
"wa-sticker-formatter": "4.4.4",
"cache-manager": "5.2.4"
},
"devDependencies": {
"eslint-plugin-bot-whatsapp": "latest",
Expand Down
6 changes: 4 additions & 2 deletions starters/apps/base-baileys-memory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint .",
"pre-copy": "cd .. && npm run copy.lib base-baileys-memory",
"start": "node app.js"
},
Expand All @@ -14,8 +15,9 @@
"@bot-whatsapp/database": "latest",
"@bot-whatsapp/provider": "latest",
"@bot-whatsapp/portal": "latest",
"@whiskeysockets/baileys": "^6.4.0",
"wa-sticker-formatter": "4.3.2"
"@whiskeysockets/baileys": "6.5.0",
"wa-sticker-formatter": "4.4.4",
"cache-manager": "5.2.4"
},
"devDependencies": {
"eslint-plugin-bot-whatsapp": "latest",
Expand Down
6 changes: 4 additions & 2 deletions starters/apps/base-baileys-mongo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint . --no-ignore",
"pre-copy": "cd .. && npm run copy.lib base-baileys-mongo",
"start": "node app.js"
},
Expand All @@ -16,8 +17,9 @@
"@bot-whatsapp/portal": "latest",
"mime-types": "2.1.35",
"mongodb": "^4.12.1",
"@whiskeysockets/baileys": "^6.4.0",
"wa-sticker-formatter": "4.3.2"
"@whiskeysockets/baileys": "6.5.0",
"wa-sticker-formatter": "4.4.4",
"cache-manager": "5.2.4"
},
"devDependencies": {
"eslint-plugin-bot-whatsapp": "latest",
Expand Down
6 changes: 4 additions & 2 deletions starters/apps/base-baileys-mysql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint . --no-ignore",
"pre-copy": "cd .. && npm run copy.lib base-baileys-mysql",
"start": "node app.js"
},
Expand All @@ -15,8 +16,9 @@
"@bot-whatsapp/provider": "latest",
"@bot-whatsapp/portal": "latest",
"mysql2": "^2.3.3",
"@whiskeysockets/baileys": "^6.4.0",
"wa-sticker-formatter": "4.3.2"
"@whiskeysockets/baileys": "6.5.0",
"wa-sticker-formatter": "4.4.4",
"cache-manager": "5.2.4"
},
"devDependencies": {
"eslint-plugin-bot-whatsapp": "latest",
Expand Down
8 changes: 5 additions & 3 deletions starters/apps/base-baileys-postgres/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint . --no-ignore",
"pre-copy": "cd .. && npm run copy.lib base-baileys-postgres",
"start": "node app.js"
},
Expand All @@ -14,9 +15,10 @@
"@bot-whatsapp/database": "latest",
"@bot-whatsapp/provider": "latest",
"@bot-whatsapp/portal": "latest",
"@whiskeysockets/baileys": "^6.4.0",
"wa-sticker-formatter": "4.3.2",
"pg": "^8.11.2"
"@whiskeysockets/baileys": "6.5.0",
"wa-sticker-formatter": "4.4.4",
"pg": "^8.11.2",
"cache-manager": "5.2.4"
},
"devDependencies": {
"eslint-plugin-bot-whatsapp": "latest",
Expand Down
5 changes: 4 additions & 1 deletion starters/apps/base-meta-json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint . --no-ignore",
"pre-copy": "cd .. && npm run copy.lib base-meta-json",
"start": "node app.js"
},
Expand All @@ -15,7 +16,9 @@
"@bot-whatsapp/cli": "latest",
"@bot-whatsapp/database": "latest",
"@bot-whatsapp/provider": "latest",
"axios": "^1.2.1"
"axios": "^1.2.1",
"form-data": "4.0.0",
"queue-promise": "2.2.1"
},
"devDependencies": {
"eslint-plugin-bot-whatsapp": "latest",
Expand Down
5 changes: 4 additions & 1 deletion starters/apps/base-meta-memory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint . --no-ignore",
"pre-copy": "cd .. && npm run copy.lib base-meta-memory",
"start": "node app.js"
},
Expand All @@ -15,7 +16,9 @@
"@bot-whatsapp/cli": "latest",
"@bot-whatsapp/database": "latest",
"@bot-whatsapp/provider": "latest",
"axios": "^1.2.1"
"axios": "^1.2.1",
"form-data": "4.0.0",
"queue-promise": "2.2.1"
},
"devDependencies": {
"eslint-plugin-bot-whatsapp": "latest",
Expand Down
5 changes: 4 additions & 1 deletion starters/apps/base-meta-mongo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint . --no-ignore",
"pre-copy": "cd .. && npm run copy.lib base-meta-mongo",
"start": "node app.js"
},
Expand All @@ -16,7 +17,9 @@
"@bot-whatsapp/database": "latest",
"@bot-whatsapp/provider": "latest",
"axios": "^1.2.1",
"mongodb": "^4.12.1"
"mongodb": "^4.12.1",
"form-data": "4.0.0",
"queue-promise": "2.2.1"
},
"devDependencies": {
"eslint-plugin-bot-whatsapp": "latest",
Expand Down
5 changes: 4 additions & 1 deletion starters/apps/base-meta-mysql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint . --no-ignore",
"pre-copy": "cd .. && npm run copy.lib base-meta-mysql",
"start": "node app.js"
},
Expand All @@ -16,7 +17,9 @@
"@bot-whatsapp/database": "latest",
"@bot-whatsapp/provider": "latest",
"axios": "^1.2.1",
"mysql2": "^2.3.3"
"mysql2": "^2.3.3",
"form-data": "4.0.0",
"queue-promise": "2.2.1"
},
"devDependencies": {
"eslint-plugin-bot-whatsapp": "latest",
Expand Down
5 changes: 4 additions & 1 deletion starters/apps/base-meta-postgres/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint . --no-ignore",
"pre-copy": "cd .. && npm run copy.lib base-meta-postgres",
"start": "node app.js"
},
Expand All @@ -16,7 +17,9 @@
"@bot-whatsapp/database": "latest",
"@bot-whatsapp/provider": "latest",
"axios": "^1.2.1",
"pg": "^8.11.2"
"pg": "^8.11.2",
"form-data": "4.0.0",
"queue-promise": "2.2.1"
},
"devDependencies": {
"eslint-plugin-bot-whatsapp": "latest",
Expand Down
3 changes: 2 additions & 1 deletion starters/apps/base-twilio-json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint . --no-ignore",
"pre-copy": "cd .. && npm run copy.lib base-twilio-json",
"start": "node app.js"
},
"keywords": [],
"dependencies": {
"body-parser": "^1.20.1",
"polka": "^0.5.2",
"twilio": "3.84.1",
"twilio": "4.19.0",
"@bot-whatsapp/bot": "latest",
"@bot-whatsapp/cli": "latest",
"@bot-whatsapp/database": "latest",
Expand Down
3 changes: 2 additions & 1 deletion starters/apps/base-twilio-memory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint . --no-ignore",
"pre-copy": "cd .. && npm run copy.lib base-twilio-memory",
"start": "node app.js"
},
"keywords": [],
"dependencies": {
"body-parser": "^1.20.1",
"polka": "^0.5.2",
"twilio": "3.84.1",
"twilio": "4.19.0",
"@bot-whatsapp/bot": "latest",
"@bot-whatsapp/cli": "latest",
"@bot-whatsapp/database": "latest",
Expand Down
3 changes: 2 additions & 1 deletion starters/apps/base-twilio-mongo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint . --no-ignore",
"pre-copy": "cd .. && npm run copy.lib base-twilio-mongo",
"start": "node app.js"
},
"keywords": [],
"dependencies": {
"body-parser": "^1.20.1",
"polka": "^0.5.2",
"twilio": "3.84.1",
"twilio": "4.19.0",
"@bot-whatsapp/bot": "latest",
"@bot-whatsapp/cli": "latest",
"@bot-whatsapp/database": "latest",
Expand Down
3 changes: 2 additions & 1 deletion starters/apps/base-twilio-mysql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint . --no-ignore",
"pre-copy": "cd .. && npm run copy.lib base-twilio-mysql",
"start": "node app.js"
},
"keywords": [],
"dependencies": {
"body-parser": "^1.20.1",
"polka": "^0.5.2",
"twilio": "3.84.1",
"twilio": "4.19.0",
"@bot-whatsapp/bot": "latest",
"@bot-whatsapp/cli": "latest",
"@bot-whatsapp/database": "latest",
Expand Down
3 changes: 2 additions & 1 deletion starters/apps/base-twilio-postgres/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint . --no-ignore",
"pre-copy": "cd .. && npm run copy.lib base-twilio-postgres",
"start": "node app.js"
},
"keywords": [],
"dependencies": {
"body-parser": "^1.20.1",
"polka": "^0.5.2",
"twilio": "3.84.1",
"twilio": "4.19.0",
"@bot-whatsapp/bot": "latest",
"@bot-whatsapp/cli": "latest",
"@bot-whatsapp/database": "latest",
Expand Down
3 changes: 2 additions & 1 deletion starters/apps/base-venom-json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint . --no-ignore",
"pre-copy": "cd .. && npm run copy.lib base-venom-json",
"start": "node app.js"
},
"keywords": [],
"dependencies": {
"venom-bot": "4.3.7",
"venom-bot": "5.0.21",
"mime-types": "2.1.35",
"@bot-whatsapp/bot": "latest",
"@bot-whatsapp/cli": "latest",
Expand Down
3 changes: 2 additions & 1 deletion starters/apps/base-venom-memory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint . --no-ignore",
"pre-copy": "cd .. && npm run copy.lib base-venom-memory",
"start": "node app.js"
},
"keywords": [],
"dependencies": {
"venom-bot": "4.3.7",
"venom-bot": "5.0.21",
"@bot-whatsapp/bot": "latest",
"@bot-whatsapp/cli": "latest",
"@bot-whatsapp/database": "latest",
Expand Down
3 changes: 2 additions & 1 deletion starters/apps/base-venom-mongo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint . --no-ignore",
"pre-copy": "cd .. && npm run copy.lib base-venom-mongo",
"start": "node app.js"
},
"keywords": [],
"dependencies": {
"venom-bot": "4.3.7",
"venom-bot": "5.0.21",
"@bot-whatsapp/bot": "latest",
"@bot-whatsapp/cli": "latest",
"@bot-whatsapp/database": "latest",
Expand Down
3 changes: 2 additions & 1 deletion starters/apps/base-venom-mysql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint . --no-ignore",
"pre-copy": "cd .. && npm run copy.lib base-venom-mysql",
"start": "node app.js"
},
"keywords": [],
"dependencies": {
"venom-bot": "4.3.7",
"venom-bot": "5.0.21",
"@bot-whatsapp/bot": "latest",
"@bot-whatsapp/cli": "latest",
"@bot-whatsapp/database": "latest",
Expand Down
3 changes: 2 additions & 1 deletion starters/apps/base-venom-postgres/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint . --no-ignore",
"pre-copy": "cd .. && npm run copy.lib base-venom-postgres",
"start": "node app.js"
},
"keywords": [],
"dependencies": {
"venom-bot": "4.3.7",
"venom-bot": "5.0.21",
"@bot-whatsapp/bot": "latest",
"@bot-whatsapp/cli": "latest",
"@bot-whatsapp/database": "latest",
Expand Down
3 changes: 2 additions & 1 deletion starters/apps/base-wppconnect-json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "",
"main": "app.js",
"scripts": {
"prestart": "npx eslint . --no-ignore",
"pre-copy": "cd .. && npm run copy.lib base-wppconnect-json",
"start": "node app.js"
},
Expand All @@ -14,7 +15,7 @@
"@bot-whatsapp/database": "latest",
"@bot-whatsapp/portal": "latest",
"@bot-whatsapp/provider": "latest",
"@wppconnect-team/wppconnect": "^1.27.3",
"@wppconnect-team/wppconnect": "1.28.3",
"mime-types": "2.1.35"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit 7b9b8eb

Please sign in to comment.