chore: upgrade linting, apply linting

This commit is contained in:
2025-12-07 00:14:58 +01:00
parent 956f2a95e9
commit da21c627d7
5 changed files with 141 additions and 55 deletions

View File

@@ -1,3 +0,0 @@
{
"extends": ["@ivuorinen/eslint-config"]
}

13
eslint.config.mjs Normal file
View File

@@ -0,0 +1,13 @@
import ivuorinenConfig from '@ivuorinen/eslint-config';
export default [
...ivuorinenConfig,
// your modifications
{
rules: {
// "no-unused-vars": "warn"
"n/no-unpublished-import": "off"
}
}
];

170
package-lock.json generated
View File

@@ -9,8 +9,8 @@
"version": "1.0.0", "version": "1.0.0",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@ivuorinen/eslint-config": "^0.5.0", "@ivuorinen/eslint-config": "^1",
"@ivuorinen/stylelint-config": "^0.3.0", "@ivuorinen/stylelint-config": "^1",
"@tailwindcss/vite": "^4.0.0", "@tailwindcss/vite": "^4.0.0",
"autoprefixer": "^10.4.16", "autoprefixer": "^10.4.16",
"postcss": "^8.4.31", "postcss": "^8.4.31",
@@ -20,7 +20,7 @@
"vite": "^6.0.0" "vite": "^6.0.0"
}, },
"engines": { "engines": {
"node": ">=20" "node": ">=24"
} }
}, },
"node_modules/@babel/code-frame": { "node_modules/@babel/code-frame": {
@@ -917,30 +917,30 @@
} }
}, },
"node_modules/@ivuorinen/config-checker": { "node_modules/@ivuorinen/config-checker": {
"version": "1.1.13", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/@ivuorinen/config-checker/-/config-checker-1.1.13.tgz", "resolved": "https://registry.npmjs.org/@ivuorinen/config-checker/-/config-checker-2.1.1.tgz",
"integrity": "sha512-XThRlaiue2c3ZlzXu/8TGGTSDSjlyQPQtaNEco+4mLdD3cll6so3T6Lj6QOXykDW0RfyiIkW2vBBz6bmt1oJvw==", "integrity": "sha512-qBz4G6ldmY3pCorV9LoDQoB02ihrevBQrFOyf3NeDA++dkxbWDNDiiT0a1cO5rw7ak0A+utbFMuWTR1G5Yus5g==",
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/@ivuorinen/eslint-config": { "node_modules/@ivuorinen/eslint-config": {
"version": "0.5.13", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/@ivuorinen/eslint-config/-/eslint-config-0.5.13.tgz", "resolved": "https://registry.npmjs.org/@ivuorinen/eslint-config/-/eslint-config-1.0.0.tgz",
"integrity": "sha512-LJp2gpE9KvbERHpFtfU7la5sdjZBC2dqSWCI+asq16piphK2ZF0/Onpx+hGXJxAY5Lo2E8afGqhR4G0bNgVlqA==", "integrity": "sha512-iWx84neXPCHoCSu3pgNockLcFrerMqJNN20RJfq5O+AA/qsamnjlLPnoMv41O66/G5FCulzOrC+QUjQbQQG0PQ==",
"dev": true, "dev": true,
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@eslint/js": "^9", "@eslint/js": "^9.39.1",
"@ivuorinen/config-checker": "^1.1.12", "@ivuorinen/config-checker": "^2.1.1",
"eslint": "^9.15.0", "eslint": "^9.39.1",
"eslint-config-eslint": "^11", "eslint-config-eslint": "^13.0.0",
"eslint-config-prettier": "^10.0.0", "eslint-config-prettier": "^10.1.8",
"eslint-plugin-import": "^2", "eslint-plugin-import": "^2.32.0",
"eslint-plugin-jest": "^29.0.0", "eslint-plugin-jest": "^29.2.1",
"eslint-plugin-n": "^17", "eslint-plugin-n": "^17.23.1",
"eslint-plugin-promise": "^7", "eslint-plugin-promise": "^7.2.1",
"globals": "^16.0.0", "globals": "^16.5.0",
"typescript": ">=4.2.0" "typescript": ">=4.2.0"
}, },
"engines": { "engines": {
@@ -948,20 +948,20 @@
} }
}, },
"node_modules/@ivuorinen/stylelint-config": { "node_modules/@ivuorinen/stylelint-config": {
"version": "0.3.19", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/@ivuorinen/stylelint-config/-/stylelint-config-0.3.19.tgz", "resolved": "https://registry.npmjs.org/@ivuorinen/stylelint-config/-/stylelint-config-1.0.0.tgz",
"integrity": "sha512-G9UKAhHzbuwkDiq8t9H048p8y6o/Az3FydIOsyc2/NPKNLiBRXzIH1CllLmuM4s71an7M+r+y3ghfkJ5x62OGg==", "integrity": "sha512-dhrzzudsvJOnIw8fEI76gDu4D0y4EAUKiycT3VrgS5ju8uQaJa+5EE9KOLIpuSFY23sY6vOhiP9yZyjTUyQ5JA==",
"dev": true, "dev": true,
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@ivuorinen/config-checker": "^1.1.12", "@ivuorinen/config-checker": "^2.1.1",
"postcss": "^8", "postcss": "^8.5.6",
"stylelint": "^16", "stylelint": "^16.26.1",
"stylelint-config-recommended-scss": "^15.0.0", "stylelint-config-recommended-scss": "^16.0.2",
"stylelint-config-standard": "^38.0.0", "stylelint-config-standard": "^39.0.1",
"stylelint-order": "^7.0.0", "stylelint-order": "^7.0.0",
"stylelint-scss": "^6" "stylelint-scss": "^6.13.0"
}, },
"engines": { "engines": {
"node": ">=20" "node": ">=20"
@@ -3410,20 +3410,32 @@
} }
}, },
"node_modules/eslint-config-eslint": { "node_modules/eslint-config-eslint": {
"version": "11.0.0", "version": "13.0.0",
"resolved": "https://registry.npmjs.org/eslint-config-eslint/-/eslint-config-eslint-11.0.0.tgz", "resolved": "https://registry.npmjs.org/eslint-config-eslint/-/eslint-config-eslint-13.0.0.tgz",
"integrity": "sha512-AWmzAfDUUaHYZzGQguHXzh/PkKHfrwttXIglqE0xWSkJDRhionaJVT1+niI1qKYRPn/FE5CHQIZ24L1u5rYSaw==", "integrity": "sha512-5M5+AfOfe8HUV9ytlDMctKMvzOyB1Av+S+obFb2aq4bdOPbVfUnl4rxIwV9Y+aOPOYKV3tKK+mIbG28JYnY50A==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@eslint-community/eslint-plugin-eslint-comments": "^4.3.0", "@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
"@eslint/js": "^9.0.0", "@eslint/js": "^9.0.0",
"eslint-plugin-jsdoc": "^48.2.3", "eslint-plugin-jsdoc": "^48.2.3",
"eslint-plugin-n": "^17.2.0", "eslint-plugin-n": "^17.11.1",
"eslint-plugin-regexp": "^2.10.0",
"eslint-plugin-unicorn": "^52.0.0" "eslint-plugin-unicorn": "^52.0.0"
}, },
"engines": { "engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"url": "https://eslint.org/donate"
},
"peerDependencies": {
"eslint": "^9.35.0"
},
"peerDependenciesMeta": {
"eslint": {
"optional": true
}
} }
}, },
"node_modules/eslint-config-prettier": { "node_modules/eslint-config-prettier": {
@@ -3695,6 +3707,28 @@
"eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0"
} }
}, },
"node_modules/eslint-plugin-regexp": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-regexp/-/eslint-plugin-regexp-2.10.0.tgz",
"integrity": "sha512-ovzQT8ESVn5oOe5a7gIDPD5v9bCSjIFJu57sVPDqgPRXicQzOnYfFN21WoQBQF18vrhT5o7UMKFwJQVVjyJ0ng==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.11.0",
"comment-parser": "^1.4.0",
"jsdoc-type-pratt-parser": "^4.0.0",
"refa": "^0.12.1",
"regexp-ast-analysis": "^0.7.1",
"scslre": "^0.3.0"
},
"engines": {
"node": "^18 || >=20"
},
"peerDependencies": {
"eslint": ">=8.44.0"
}
},
"node_modules/eslint-plugin-unicorn": { "node_modules/eslint-plugin-unicorn": {
"version": "52.0.0", "version": "52.0.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-52.0.0.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-52.0.0.tgz",
@@ -6300,6 +6334,19 @@
"url": "https://paulmillr.com/funding/" "url": "https://paulmillr.com/funding/"
} }
}, },
"node_modules/refa": {
"version": "0.12.1",
"resolved": "https://registry.npmjs.org/refa/-/refa-0.12.1.tgz",
"integrity": "sha512-J8rn6v4DBb2nnFqkqwy6/NnTYMcgLA+sLr0iIO41qpv0n+ngb7ksag2tMRl0inb1bbO/esUwzW1vbJi7K0sI0g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/regexpp": "^4.8.0"
},
"engines": {
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
}
},
"node_modules/reflect.getprototypeof": { "node_modules/reflect.getprototypeof": {
"version": "1.0.10", "version": "1.0.10",
"resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz",
@@ -6323,6 +6370,20 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/regexp-ast-analysis": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/regexp-ast-analysis/-/regexp-ast-analysis-0.7.1.tgz",
"integrity": "sha512-sZuz1dYW/ZsfG17WSAG7eS85r5a0dDsvg+7BiiYR5o6lKCAtUrEwdmRmaGF6rwVj3LcmAeYkOWKEPlbPzN3Y3A==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/regexpp": "^4.8.0",
"refa": "^0.12.1"
},
"engines": {
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
}
},
"node_modules/regexp-tree": { "node_modules/regexp-tree": {
"version": "0.1.27", "version": "0.1.27",
"resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz", "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz",
@@ -6580,6 +6641,21 @@
"@parcel/watcher": "^2.4.1" "@parcel/watcher": "^2.4.1"
} }
}, },
"node_modules/scslre": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/scslre/-/scslre-0.3.0.tgz",
"integrity": "sha512-3A6sD0WYP7+QrjbfNA2FN3FsOaGGFoekCVgTyypy53gPxhbkCIjtO6YWgdrfM+n/8sI8JeXZOIxsHjMTNxQ4nQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/regexpp": "^4.8.0",
"refa": "^0.12.0",
"regexp-ast-analysis": "^0.7.0"
},
"engines": {
"node": "^14.0.0 || >=16.0.0"
}
},
"node_modules/semver": { "node_modules/semver": {
"version": "6.3.1", "version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
@@ -7045,9 +7121,9 @@
} }
}, },
"node_modules/stylelint-config-recommended": { "node_modules/stylelint-config-recommended": {
"version": "16.0.0", "version": "17.0.0",
"resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-16.0.0.tgz", "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-17.0.0.tgz",
"integrity": "sha512-4RSmPjQegF34wNcK1e1O3Uz91HN8P1aFdFzio90wNK9mjgAI19u5vsU868cVZboKzCaa5XbpvtTzAAGQAxpcXA==", "integrity": "sha512-WaMSdEiPfZTSFVoYmJbxorJfA610O0tlYuU2aEwY33UQhSPgFbClrVJYWvy3jGJx+XW37O+LyNLiZOEXhKhJmA==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@@ -7064,26 +7140,26 @@
"node": ">=18.12.0" "node": ">=18.12.0"
}, },
"peerDependencies": { "peerDependencies": {
"stylelint": "^16.16.0" "stylelint": "^16.23.0"
} }
}, },
"node_modules/stylelint-config-recommended-scss": { "node_modules/stylelint-config-recommended-scss": {
"version": "15.0.1", "version": "16.0.2",
"resolved": "https://registry.npmjs.org/stylelint-config-recommended-scss/-/stylelint-config-recommended-scss-15.0.1.tgz", "resolved": "https://registry.npmjs.org/stylelint-config-recommended-scss/-/stylelint-config-recommended-scss-16.0.2.tgz",
"integrity": "sha512-V24bxkNkFGggqPVJlP9iXaBabwSGEG7QTz+PyxrRtjPkcF+/NsWtB3tKYvFYEmczRkWiIEfuFMhGpJFj9Fxe6Q==", "integrity": "sha512-aUTHhPPWCvFyWaxtckJlCPaXTDFsp4pKO8evXNCsW9OwsaUWyMd6jvcUhSmfGWPrTddvzNqK4rS/UuSLcbVGdQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"postcss-scss": "^4.0.9", "postcss-scss": "^4.0.9",
"stylelint-config-recommended": "^16.0.0", "stylelint-config-recommended": "^17.0.0",
"stylelint-scss": "^6.12.0" "stylelint-scss": "^6.12.1"
}, },
"engines": { "engines": {
"node": ">=20" "node": ">=20"
}, },
"peerDependencies": { "peerDependencies": {
"postcss": "^8.3.3", "postcss": "^8.3.3",
"stylelint": "^16.16.0" "stylelint": "^16.24.0"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"postcss": { "postcss": {
@@ -7092,9 +7168,9 @@
} }
}, },
"node_modules/stylelint-config-standard": { "node_modules/stylelint-config-standard": {
"version": "38.0.0", "version": "39.0.1",
"resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-38.0.0.tgz", "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-39.0.1.tgz",
"integrity": "sha512-uj3JIX+dpFseqd/DJx8Gy3PcRAJhlEZ2IrlFOc4LUxBX/PNMEQ198x7LCOE2Q5oT9Vw8nyc4CIL78xSqPr6iag==", "integrity": "sha512-b7Fja59EYHRNOTa3aXiuWnhUWXFU2Nfg6h61bLfAb5GS5fX3LMUD0U5t4S8N/4tpHQg3Acs2UVPR9jy2l1g/3A==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@@ -7108,13 +7184,13 @@
], ],
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"stylelint-config-recommended": "^16.0.0" "stylelint-config-recommended": "^17.0.0"
}, },
"engines": { "engines": {
"node": ">=18.12.0" "node": ">=18.12.0"
}, },
"peerDependencies": { "peerDependencies": {
"stylelint": "^16.18.0" "stylelint": "^16.23.0"
} }
}, },
"node_modules/stylelint-order": { "node_modules/stylelint-order": {

View File

@@ -12,7 +12,7 @@
"eslint:report": "eslint '**/*.{js,tsx,ts}'" "eslint:report": "eslint '**/*.{js,tsx,ts}'"
}, },
"engines": { "engines": {
"node": ">=20" "node": ">=24"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@@ -25,8 +25,8 @@
}, },
"homepage": "https://github.com/ivuorinen/generic-landing-page#readme", "homepage": "https://github.com/ivuorinen/generic-landing-page#readme",
"devDependencies": { "devDependencies": {
"@ivuorinen/eslint-config": "^0.5.0", "@ivuorinen/eslint-config": "^1",
"@ivuorinen/stylelint-config": "^0.3.0", "@ivuorinen/stylelint-config": "^1",
"@tailwindcss/vite": "^4.0.0", "@tailwindcss/vite": "^4.0.0",
"autoprefixer": "^10.4.16", "autoprefixer": "^10.4.16",
"postcss": "^8.4.31", "postcss": "^8.4.31",

View File

@@ -1,6 +1,6 @@
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
import tailwindcss from '@tailwindcss/vite'; import tailwindcss from '@tailwindcss/vite';
import { resolve } from 'path'; import { resolve } from 'node:path';
export default defineConfig({ export default defineConfig({
root: 'src', root: 'src',
@@ -12,7 +12,7 @@ export default defineConfig({
input: resolve(__dirname, 'src/index.html'), input: resolve(__dirname, 'src/index.html'),
output: { output: {
entryFileNames: 'app.js', entryFileNames: 'app.js',
assetFileNames: (assetInfo) => { assetFileNames(assetInfo) {
if (assetInfo.name?.endsWith('.css')) return 'app.css'; if (assetInfo.name?.endsWith('.css')) return 'app.css';
return '[name][extname]'; return '[name][extname]';
}, },