Skip to content

Commit 64eb5cc

Browse files
committed
chore: configure husky lint hooks and ignore eslint cache
1 parent 13f0a45 commit 64eb5cc

12 files changed

Lines changed: 6427 additions & 5994 deletions

web/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ logs
2424
!.env.example
2525
!.env.docker
2626
!.env.production
27+
28+
# ESLint cache
29+
.eslintcache

web/.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cd web && pnpm exec commitlint --edit "$1"

web/.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cd web && pnpm exec lint-staged

web/.prettierignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Build output
2+
.nuxt
3+
.output
4+
dist
5+
node_modules
6+
7+
# Generated files
8+
shared/types/api.ts
9+
pnpm-lock.yaml
10+
11+
# Logs
12+
*.log

web/.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true
4+
}

web/commitlint.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default {
2+
extends: ['@commitlint/config-conventional'],
3+
}

web/eslint.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import withNuxt from './.nuxt/eslint.config.mjs'
2+
import eslintConfigPrettier from 'eslint-config-prettier'
3+
4+
export default withNuxt(eslintConfigPrettier)

web/nuxt.config.ts

Lines changed: 63 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,86 @@
11
// https://nuxt.com/docs/api/configuration/nuxt-config
22
export default defineNuxtConfig({
3-
compatibilityDate: "2025-01-01",
3+
compatibilityDate: '2025-01-01',
44

55
ssr: false,
66

7-
modules: ["vuetify-nuxt-module", "@pinia/nuxt", "@nuxtjs/google-fonts"],
7+
modules: [
8+
'@nuxt/eslint',
9+
'vuetify-nuxt-module',
10+
'@pinia/nuxt',
11+
'@nuxtjs/google-fonts',
12+
],
813

914
googleFonts: {
1015
families: {
1116
Roboto: [100, 300, 400, 500, 700, 900],
1217
},
13-
display: "swap",
18+
display: 'swap',
1419
download: true,
1520
},
1621

17-
css: ["vuetify/styles"],
22+
css: ['vuetify/styles'],
1823

1924
build: {
20-
transpile: ["vuetify", "chart.js", "vue-chartjs", "v-phone-input"],
25+
transpile: ['vuetify', 'chart.js', 'vue-chartjs', 'v-phone-input'],
2126
},
2227

2328
vite: {
2429
define: {
25-
"process.env.DEBUG": false,
30+
'process.env.DEBUG': false,
2631
},
2732
optimizeDeps: {
2833
include: [
29-
"@mdi/js",
30-
"chartjs-adapter-moment",
31-
"date-fns",
32-
"firebase/app",
33-
"firebase/auth",
34-
"highlight.js/lib/core",
35-
"libphonenumber-js",
36-
"pusher-js",
37-
"qrcode",
34+
'@mdi/js',
35+
'chartjs-adapter-moment',
36+
'date-fns',
37+
'firebase/app',
38+
'firebase/auth',
39+
'highlight.js/lib/core',
40+
'libphonenumber-js',
41+
'pusher-js',
42+
'qrcode',
3843
],
3944
},
4045
},
4146

4247
vuetify: {
4348
vuetifyOptions: {
4449
theme: {
45-
defaultTheme: "dark",
50+
defaultTheme: 'dark',
4651
},
4752
icons: {
48-
defaultSet: "mdi-svg",
53+
defaultSet: 'mdi-svg',
4954
},
5055
},
5156
},
5257

5358
runtimeConfig: {
5459
public: {
55-
apiBaseUrl: process.env.API_BASE_URL || "http://localhost:8000",
56-
clientVersion: process.env.GITHUB_SHA || "dev",
57-
appUrl: process.env.APP_URL || "https://httpsms.com",
58-
appName: process.env.APP_NAME || "HTTP SMS",
60+
apiBaseUrl: process.env.API_BASE_URL || 'http://localhost:8000',
61+
clientVersion: process.env.GITHUB_SHA || 'dev',
62+
appUrl: process.env.APP_URL || 'https://httpsms.com',
63+
appName: process.env.APP_NAME || 'HTTP SMS',
5964
appGithubUrl:
60-
process.env.APP_GITHUB_URL || "https://github.com/NdoleStudio/httpsms",
65+
process.env.APP_GITHUB_URL || 'https://github.com/NdoleStudio/httpsms',
6166
appDocumentationUrl:
62-
process.env.APP_DOCUMENTATION_URL || "https://docs.httpsms.com",
67+
process.env.APP_DOCUMENTATION_URL || 'https://docs.httpsms.com',
6368
appDownloadUrl:
64-
process.env.APP_DOWNLOAD_URL || "https://apk.httpsms.com/HttpSms.apk",
65-
appEnv: process.env.APP_ENV || "production",
66-
checkoutUrl: process.env.CHECKOUT_URL || "",
67-
enterpriseCheckoutUrl: process.env.ENTERPRISE_CHECKOUT_URL || "",
69+
process.env.APP_DOWNLOAD_URL || 'https://apk.httpsms.com/HttpSms.apk',
70+
appEnv: process.env.APP_ENV || 'production',
71+
checkoutUrl: process.env.CHECKOUT_URL || '',
72+
enterpriseCheckoutUrl: process.env.ENTERPRISE_CHECKOUT_URL || '',
6873
cloudflareTurnstileSiteKey:
69-
process.env.CLOUDFLARE_TURNSTILE_SITE_KEY || "",
70-
pusherKey: process.env.PUSHER_KEY || "",
71-
pusherCluster: process.env.PUSHER_CLUSTER || "",
72-
firebaseApiKey: process.env.FIREBASE_API_KEY || "",
73-
firebaseAuthDomain: process.env.FIREBASE_AUTH_DOMAIN || "",
74-
firebaseProjectId: process.env.FIREBASE_PROJECT_ID || "",
75-
firebaseStorageBucket: process.env.FIREBASE_STORAGE_BUCKET || "",
76-
firebaseMessagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID || "",
77-
firebaseAppId: process.env.FIREBASE_APP_ID || "",
78-
firebaseMeasurementId: process.env.FIREBASE_MEASUREMENT_ID || "",
74+
process.env.CLOUDFLARE_TURNSTILE_SITE_KEY || '',
75+
pusherKey: process.env.PUSHER_KEY || '',
76+
pusherCluster: process.env.PUSHER_CLUSTER || '',
77+
firebaseApiKey: process.env.FIREBASE_API_KEY || '',
78+
firebaseAuthDomain: process.env.FIREBASE_AUTH_DOMAIN || '',
79+
firebaseProjectId: process.env.FIREBASE_PROJECT_ID || '',
80+
firebaseStorageBucket: process.env.FIREBASE_STORAGE_BUCKET || '',
81+
firebaseMessagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID || '',
82+
firebaseAppId: process.env.FIREBASE_APP_ID || '',
83+
firebaseMeasurementId: process.env.FIREBASE_MEASUREMENT_ID || '',
7984
},
8085
},
8186

@@ -90,46 +95,46 @@ export default defineNuxtConfig({
9095

9196
app: {
9297
head: {
93-
titleTemplate: "%s",
94-
title: "Convert your android phone into an SMS gateway - httpSMS",
95-
htmlAttrs: { lang: "en" },
98+
titleTemplate: '%s',
99+
title: 'Convert your android phone into an SMS gateway - httpSMS',
100+
htmlAttrs: { lang: 'en' },
96101
script: [
97-
{ src: "/integrations.js", async: true, defer: true },
102+
{ src: '/integrations.js', async: true, defer: true },
98103
{
99-
src: "https://lmsqueezy.com/affiliate.js",
104+
src: 'https://lmsqueezy.com/affiliate.js',
100105
async: true,
101106
defer: true,
102107
},
103108
{
104-
src: "https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",
109+
src: 'https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit',
105110
},
106111
],
107112
meta: [
108-
{ charset: "utf-8" },
109-
{ name: "viewport", content: "width=device-width, initial-scale=1" },
113+
{ charset: 'utf-8' },
114+
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
110115
{
111-
name: "description",
116+
name: 'description',
112117
content:
113-
"Use your android phone to send and receive SMS messages using a simple HTTP API.",
118+
'Use your android phone to send and receive SMS messages using a simple HTTP API.',
114119
},
115-
{ name: "format-detection", content: "telephone=no" },
116-
{ name: "twitter:site", content: "@NdoleStudio" },
117-
{ name: "twitter:card", content: "summary_large_image" },
120+
{ name: 'format-detection', content: 'telephone=no' },
121+
{ name: 'twitter:site', content: '@NdoleStudio' },
122+
{ name: 'twitter:card', content: 'summary_large_image' },
118123
{
119-
property: "og:title",
120-
content: "Convert your android phone into an SMS gateway - httpSMS",
124+
property: 'og:title',
125+
content: 'Convert your android phone into an SMS gateway - httpSMS',
121126
},
122127
{
123-
property: "og:description",
128+
property: 'og:description',
124129
content:
125-
"Use your android phone to send and receive SMS messages using a simple HTTP API.",
130+
'Use your android phone to send and receive SMS messages using a simple HTTP API.',
126131
},
127132
{
128-
property: "og:image",
129-
content: "https://httpsms.com/header.png",
133+
property: 'og:image',
134+
content: 'https://httpsms.com/header.png',
130135
},
131136
],
132-
link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }],
137+
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
133138
},
134139
},
135-
});
140+
})

web/package.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,20 @@
88
"generate": "nuxt generate",
99
"preview": "nuxt preview",
1010
"postinstall": "nuxt prepare",
11-
"lint": "echo 'No linter configured yet'",
11+
"prepare": "cd .. && husky web/.husky",
12+
"api:models": "npx swagger-typescript-api generate -p ../api/docs/swagger.json -o ./shared/types -n api.ts --no-client",
13+
"lint:js": "eslint .",
14+
"lint:style": "stylelint \"**/*.{css,scss,sass,vue}\"",
15+
"lint:prettier": "prettier --check .",
16+
"lint": "pnpm lint:js && pnpm lint:style && pnpm lint:prettier",
17+
"lintfix": "prettier --write --list-different . && pnpm lint:js --fix && pnpm lint:style --fix",
1218
"test": "echo 'No tests configured yet'"
1319
},
20+
"lint-staged": {
21+
"*.{js,ts,vue}": "eslint --cache",
22+
"*.{css,scss,sass,vue}": "stylelint",
23+
"*": "prettier --check --ignore-unknown"
24+
},
1425
"dependencies": {
1526
"@mdi/js": "^7.4.47",
1627
"@nuxtjs/google-fonts": "^3.2.0",
@@ -36,7 +47,19 @@
3647
"vuetify": "^4.0.7"
3748
},
3849
"devDependencies": {
50+
"@commitlint/cli": "^21.0.2",
51+
"@commitlint/config-conventional": "^21.0.2",
52+
"@nuxt/eslint": "^1.16.0",
3953
"@types/qrcode": "^1.5.6",
54+
"eslint": "^10.5.0",
55+
"eslint-config-prettier": "^10.1.8",
56+
"husky": "^9.1.7",
57+
"lint-staged": "^17.0.8",
58+
"postcss-html": "^1.8.1",
59+
"stylelint": "^17.13.0",
60+
"stylelint-config-recommended-vue": "^1.6.1",
61+
"stylelint-config-standard": "^40.0.0",
62+
"typescript": "^5.9.3",
4063
"vuetify-nuxt-module": "^0.19.5"
4164
}
4265
}

0 commit comments

Comments
 (0)