From b089d191e7238232e52f3d11c2ec57a7564c328f Mon Sep 17 00:00:00 2001 From: what1s1ove Date: Sun, 28 Jul 2024 18:28:48 +0300 Subject: [PATCH 1/2] ci(root): remove dts file for unicorn eslint plugin wd-270 --- .../create-process-video.script.js | 11 +- apps/careers-whatislove-dev/vite.config.js | 4 +- .../vite.config.js | 4 +- apps/whatislove-dev/eleventy.config.js | 43 +++---- package-lock.json | 113 ++++++++++++++---- package.json | 2 +- packages.d.ts | 10 -- 7 files changed, 124 insertions(+), 63 deletions(-) diff --git a/apps/careers-whatislove-dev/scripts/create-process-video/create-process-video.script.js b/apps/careers-whatislove-dev/scripts/create-process-video/create-process-video.script.js index 54acf768..879cdf71 100644 --- a/apps/careers-whatislove-dev/scripts/create-process-video/create-process-video.script.js +++ b/apps/careers-whatislove-dev/scripts/create-process-video/create-process-video.script.js @@ -1,16 +1,17 @@ +#! import ffmpegInstaller from '@ffmpeg-installer/ffmpeg' import ffprobeInstaller from '@ffprobe-installer/ffprobe' import { ProcessExitCode, getShuffledItems } from '@whatislove.dev/shared' import ffmpeg from 'fluent-ffmpeg' import { existsSync } from 'node:fs' import { readdir } from 'node:fs/promises' -import { join } from 'node:path' -import { exit } from 'node:process' +import path from 'node:path' +import process from 'node:process' let PROCESS_PIECE_FILE_EXT = /** @type {const} */ (`.mp4`) -let processPiecesPath = join(import.meta.dirname, `./process-pieces`) -let processFilePath = join( +let processPiecesPath = path.join(import.meta.dirname, `./process-pieces`) +let processFilePath = path.join( import.meta.dirname, `../../public/videos`, `process.mp4`, @@ -39,7 +40,7 @@ let createProcessVideo = async () => { let hasProcessFile = existsSync(processFilePath) if (hasProcessFile) { - exit(ProcessExitCode.SUCCESS) + process.exit(ProcessExitCode.SUCCESS) } await createProcessVideo() diff --git a/apps/careers-whatislove-dev/vite.config.js b/apps/careers-whatislove-dev/vite.config.js index 45b25c00..a14d69cf 100644 --- a/apps/careers-whatislove-dev/vite.config.js +++ b/apps/careers-whatislove-dev/vite.config.js @@ -1,4 +1,4 @@ -import { join } from 'node:path' +import path from 'node:path' import { defineConfig } from 'vite' import babel from 'vite-plugin-babel' @@ -29,7 +29,7 @@ let config = defineConfig({ alias: [ { find: `~`, - replacement: join(import.meta.dirname, `src`), + replacement: path.join(import.meta.dirname, `src`), }, ], }, diff --git a/apps/certifications-whatislove-dev/vite.config.js b/apps/certifications-whatislove-dev/vite.config.js index 69e507c6..ece0c863 100644 --- a/apps/certifications-whatislove-dev/vite.config.js +++ b/apps/certifications-whatislove-dev/vite.config.js @@ -1,5 +1,5 @@ import reactPlugin from '@vitejs/plugin-react' -import { join } from 'node:path' +import path from 'node:path' import { defineConfig } from 'vite' /** @type {import('vite').UserConfig} */ @@ -16,7 +16,7 @@ let config = defineConfig({ alias: [ { find: `~`, - replacement: join(import.meta.dirname, `src`), + replacement: path.join(import.meta.dirname, `src`), }, ], }, diff --git a/apps/whatislove-dev/eleventy.config.js b/apps/whatislove-dev/eleventy.config.js index 2acc2257..25e786dd 100644 --- a/apps/whatislove-dev/eleventy.config.js +++ b/apps/whatislove-dev/eleventy.config.js @@ -13,9 +13,9 @@ import htmlMin from 'html-minifier-terser' import * as lightningcss from 'lightningcss' import { parseHTML } from 'linkedom' import markdownIt from 'markdown-it' -import { existsSync, readFileSync } from 'node:fs' -import { mkdir, readFile, writeFile } from 'node:fs/promises' -import { basename, extname, join } from 'node:path' +import fsSync from 'node:fs' +import fs from 'node:fs/promises' +import path from 'node:path' import svgo from 'svgo' import { default as environment } from './src/data/environment.js' @@ -59,7 +59,7 @@ let CollectionPath = /** @type {const} */ ({ PAGES: `src/pages/!(404)/index.njk`, }) -let rawPackageJson = await readFile(new URL(`package.json`, import.meta.url)) +let rawPackageJson = await fs.readFile(new URL(`package.json`, import.meta.url)) let packageJson = /** @type {(text: string) => PackageJson} */ (JSON.parse)( rawPackageJson.toString(), ) @@ -124,7 +124,7 @@ let init = (config) => { outputFileSlug: (ogImage) => ogImage.data.page.fileSlug, satoriOptions: { fonts: [400, 700].map((weight) => ({ - data: readFileSync( + data: fsSync.readFileSync( new URL( `src/fonts/red-hat-display-${weight.toString()}.woff`, import.meta.url, @@ -161,13 +161,13 @@ let init = (config) => { config.addNunjucksAsyncShortcode( `inlineImage`, /** - * @param {string} path + * @param {string} url * @returns {Promise} */ - async (path) => { - let extension = extname(path).slice(1) - let imgPath = join(config.dir.input, path) - let base64Image = await readFile(imgPath, `base64`) + async (url) => { + let extension = path.extname(url).slice(1) + let imgPath = path.join(config.dir.input, url) + let base64Image = await fs.readFile(imgPath, `base64`) if (extension === `svg`) { extension = `svg+xml` @@ -195,15 +195,15 @@ let init = (config) => { return } - let rawDatabase = await readFile(Path.DB) + let rawDatabase = await fs.readFile(Path.DB) let database = /** @type {(text: string) => Database} */ ( JSON.parse )(rawDatabase.toString()) - let isFolderExists = existsSync(`build/api`) + let isFolderExists = fsSync.existsSync(`build/api`) if (!isFolderExists) { - await mkdir(`build/api`) + await fs.mkdir(`build/api`) } await Promise.all( @@ -212,7 +212,10 @@ let init = (config) => { database[/** @type {keyof Database} */ (databaseKey)], ) - return writeFile(`build/api/${databaseKey}.json`, payload) + return fs.writeFile( + `build/api/${databaseKey}.json`, + payload, + ) }), ) }, @@ -220,8 +223,8 @@ let init = (config) => { }) // html - config.addTransform(`html-minify`, async (content, path) => { - if (path.endsWith(`.html`)) { + config.addTransform(`html-minify`, async (content, url) => { + if (url.endsWith(`.html`)) { return await htmlMin.minify(content, { collapseBooleanAttributes: true, collapseWhitespace: true, @@ -232,8 +235,8 @@ let init = (config) => { return content }) - config.addTransform(`html-transform`, (content, path) => { - if (path.endsWith(`.html`)) { + config.addTransform(`html-transform`, (content, url) => { + if (url.endsWith(`.html`)) { let window = parseHTML(content) for (let transform of TRANSFORMS) { @@ -336,8 +339,8 @@ let init = (config) => { * @returns {string} */ filenameFormat: (_id, source, width, format) => { - let extension = extname(source) - let name = basename(source, extension) + let extension = path.extname(source) + let name = path.basename(source, extension) return `${name}-${width.toString()}w.${format.toString()}` }, diff --git a/package-lock.json b/package-lock.json index 6e8bfc3b..20d27f5a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,7 +30,7 @@ "eslint-plugin-jsdoc": "48.2.1", "eslint-plugin-perfectionist": "2.5.0", "eslint-plugin-sonarjs": "1.0.3", - "eslint-plugin-unicorn": "49.0.0", + "eslint-plugin-unicorn": "55.0.0", "globals": "13.24.0", "knip": "5.7.0", "lightningcss": "1.25.1", @@ -8202,9 +8202,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001636", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001636.tgz", - "integrity": "sha512-bMg2vmr8XBsbL6Lr0UHXy/21m84FTxDLWn2FSqMd5PrlbMxwJlQnC2YWYxVgp66PZE+BBNF2jYQUBKCo1FDeZg==", + "version": "1.0.30001643", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz", + "integrity": "sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg==", "dev": true, "funding": [ { @@ -8219,7 +8219,8 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ] + ], + "license": "CC-BY-4.0" }, "node_modules/caseless": { "version": "0.12.0", @@ -8407,9 +8408,9 @@ } }, "node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.0.0.tgz", + "integrity": "sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==", "dev": true, "funding": [ { @@ -8417,6 +8418,7 @@ "url": "https://github.com/sponsors/sibiraj-s" } ], + "license": "MIT", "engines": { "node": ">=8" } @@ -9090,6 +9092,53 @@ "dev": true, "hasInstallScript": true }, + "node_modules/core-js-compat": { + "version": "3.37.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.37.1.tgz", + "integrity": "sha512-9TNiImhKvQqSUkOvk/mMRZzOANTiEVC7WaBNhHcKM7x+/5E1l5NvsysR19zuDQScE8k+kfQXWRN3AtS/eOSHpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.23.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/core-js-compat/node_modules/browserslist": { + "version": "4.23.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.2.tgz", + "integrity": "sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "caniuse-lite": "^1.0.30001640", + "electron-to-chromium": "^1.4.820", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.1.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -10004,10 +10053,11 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.803", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.803.tgz", - "integrity": "sha512-61H9mLzGOCLLVsnLiRzCbc63uldP0AniRYPV3hbGVtONA1pI7qSGILdbofR7A8TMbOypDocEAjH/e+9k1QIe3g==", - "dev": true + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.2.tgz", + "integrity": "sha512-kc4r3U3V3WLaaZqThjYz/Y6z8tJe+7K0bbjUVo3i+LWIypVdMx5nXCkwRe6SWbY6ILqLdc1rKcKmr3HoH7wjSQ==", + "dev": true, + "license": "ISC" }, "node_modules/eleventy-plugin-og-image": { "version": "4.0.0-beta.7", @@ -11163,16 +11213,19 @@ } }, "node_modules/eslint-plugin-unicorn": { - "version": "49.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-49.0.0.tgz", - "integrity": "sha512-0fHEa/8Pih5cmzFW5L7xMEfUTvI9WKeQtjmKpTUmY+BiFCDxkxrTdnURJOHKykhtwIeyYsxnecbGvDCml++z4Q==", + "version": "55.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-55.0.0.tgz", + "integrity": "sha512-n3AKiVpY2/uDcGrS3+QsYDkjPfaOrNrsfQxU9nt5nitd9KuvVXrfAvgCO9DYPSfap+Gqjw9EOrXIsBp5tlHZjA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-validator-identifier": "^7.24.5", "@eslint-community/eslint-utils": "^4.4.0", - "ci-info": "^3.8.0", + "ci-info": "^4.0.0", "clean-regexp": "^1.0.0", + "core-js-compat": "^3.37.0", "esquery": "^1.5.0", + "globals": "^15.7.0", "indent-string": "^4.0.0", "is-builtin-module": "^3.2.1", "jsesc": "^3.0.2", @@ -11180,17 +11233,30 @@ "read-pkg-up": "^7.0.1", "regexp-tree": "^0.1.27", "regjsparser": "^0.10.0", - "semver": "^7.5.4", + "semver": "^7.6.1", "strip-indent": "^3.0.0" }, "engines": { - "node": ">=16" + "node": ">=18.18" }, "funding": { "url": "https://github.com/sindresorhus/eslint-plugin-unicorn?sponsor=1" }, "peerDependencies": { - "eslint": ">=8.52.0" + "eslint": ">=8.56.0" + } + }, + "node_modules/eslint-plugin-unicorn/node_modules/globals": { + "version": "15.8.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.8.0.tgz", + "integrity": "sha512-VZAJ4cewHTExBWDHR6yptdIBlx9YSSZuwojj9Nt5mBRXQzrKakDsVKQ1J63sklLvzAJm0X5+RpO4i3Y2hcOnFw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint-plugin-unicorn/node_modules/semver": { @@ -21316,9 +21382,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz", - "integrity": "sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", + "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", "dev": true, "funding": [ { @@ -21334,6 +21400,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "escalade": "^3.1.2", "picocolors": "^1.0.1" diff --git a/package.json b/package.json index a50ce00c..9f854ae4 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "eslint-plugin-jsdoc": "48.2.1", "eslint-plugin-perfectionist": "2.5.0", "eslint-plugin-sonarjs": "1.0.3", - "eslint-plugin-unicorn": "49.0.0", + "eslint-plugin-unicorn": "55.0.0", "globals": "13.24.0", "knip": "5.7.0", "lightningcss": "1.25.1", diff --git a/packages.d.ts b/packages.d.ts index 58752ab2..366006c4 100644 --- a/packages.d.ts +++ b/packages.d.ts @@ -8,16 +8,6 @@ declare module 'eslint-plugin-perfectionist' { } } -declare module 'eslint-plugin-unicorn' { - import { type Linter } from 'eslint' - - const configs: Record<'recommended', Required> - - export default { - configs, - } -} - declare module 'eslint-plugin-import' { import { type Linter } from 'eslint' From af95fcfcff1ef707ab16959e6da1294345257571 Mon Sep 17 00:00:00 2001 From: what1s1ove Date: Sun, 28 Jul 2024 18:39:10 +0300 Subject: [PATCH 2/2] ci(root): remove dts file for perfectionist eslint plugin wd-270 --- .../create-process-video.script.js | 2 +- .../src/libs/components/app/app.js | 2 +- .../visually-hidden/visually-hidden.js | 2 +- .../components/screen-form/screen-form.js | 4 +- .../screen-initial/screen-initial.js | 2 +- .../screen-process/screen-process.js | 2 +- .../src/pages/root/root.js | 2 +- .../src/libs/components/components.js | 2 +- .../whatislove-math.package.js | 6 +- .../main/libs/components/timeline/timeline.js | 2 +- eslint.config.js | 8 +- package-lock.json | 158 +++++++++++------- package.json | 4 +- packages.d.ts | 10 -- 14 files changed, 122 insertions(+), 84 deletions(-) diff --git a/apps/careers-whatislove-dev/scripts/create-process-video/create-process-video.script.js b/apps/careers-whatislove-dev/scripts/create-process-video/create-process-video.script.js index 879cdf71..63e0cac5 100644 --- a/apps/careers-whatislove-dev/scripts/create-process-video/create-process-video.script.js +++ b/apps/careers-whatislove-dev/scripts/create-process-video/create-process-video.script.js @@ -1,7 +1,7 @@ #! import ffmpegInstaller from '@ffmpeg-installer/ffmpeg' import ffprobeInstaller from '@ffprobe-installer/ffprobe' -import { ProcessExitCode, getShuffledItems } from '@whatislove.dev/shared' +import { getShuffledItems, ProcessExitCode } from '@whatislove.dev/shared' import ffmpeg from 'fluent-ffmpeg' import { existsSync } from 'node:fs' import { readdir } from 'node:fs/promises' diff --git a/apps/careers-whatislove-dev/src/libs/components/app/app.js b/apps/careers-whatislove-dev/src/libs/components/app/app.js index e9aff532..7609f859 100644 --- a/apps/careers-whatislove-dev/src/libs/components/app/app.js +++ b/apps/careers-whatislove-dev/src/libs/components/app/app.js @@ -1,4 +1,4 @@ -import { LitElement, html } from 'lit' +import { html, LitElement } from 'lit' import { defineCustomElement, diff --git a/apps/careers-whatislove-dev/src/libs/components/visually-hidden/visually-hidden.js b/apps/careers-whatislove-dev/src/libs/components/visually-hidden/visually-hidden.js index d1f7bff1..8ae191c4 100644 --- a/apps/careers-whatislove-dev/src/libs/components/visually-hidden/visually-hidden.js +++ b/apps/careers-whatislove-dev/src/libs/components/visually-hidden/visually-hidden.js @@ -1,4 +1,4 @@ -import { LitElement, html } from 'lit' +import { html, LitElement } from 'lit' import { defineCustomElement, diff --git a/apps/careers-whatislove-dev/src/pages/root/libs/components/screen-form/screen-form.js b/apps/careers-whatislove-dev/src/pages/root/libs/components/screen-form/screen-form.js index 54796e32..d9302d10 100644 --- a/apps/careers-whatislove-dev/src/pages/root/libs/components/screen-form/screen-form.js +++ b/apps/careers-whatislove-dev/src/pages/root/libs/components/screen-form/screen-form.js @@ -1,11 +1,11 @@ import { ControlType, getFormValues } from 'form-payload' -import { LitElement, html } from 'lit' +import { html, LitElement } from 'lit' import { defineCustomElement, parseRawStyleSheet, } from '~/libs/helpers/helpers.js' -import { TableNames, database } from '~/libs/modules/database/database.js' +import { database, TableNames } from '~/libs/modules/database/database.js' import { notify } from '~/libs/modules/notify/notify.js' import { Scene } from '../../enums/enums.js' diff --git a/apps/careers-whatislove-dev/src/pages/root/libs/components/screen-initial/screen-initial.js b/apps/careers-whatislove-dev/src/pages/root/libs/components/screen-initial/screen-initial.js index adea194c..ccebeac2 100644 --- a/apps/careers-whatislove-dev/src/pages/root/libs/components/screen-initial/screen-initial.js +++ b/apps/careers-whatislove-dev/src/pages/root/libs/components/screen-initial/screen-initial.js @@ -1,4 +1,4 @@ -import { LitElement, html } from 'lit' +import { html, LitElement } from 'lit' import { defineCustomElement, diff --git a/apps/careers-whatislove-dev/src/pages/root/libs/components/screen-process/screen-process.js b/apps/careers-whatislove-dev/src/pages/root/libs/components/screen-process/screen-process.js index 0ad09351..6785eb9d 100644 --- a/apps/careers-whatislove-dev/src/pages/root/libs/components/screen-process/screen-process.js +++ b/apps/careers-whatislove-dev/src/pages/root/libs/components/screen-process/screen-process.js @@ -1,4 +1,4 @@ -import { LitElement, html, nothing } from 'lit' +import { html, LitElement, nothing } from 'lit' import { property } from 'lit/decorators.js' import { createRef, ref } from 'lit/directives/ref.js' diff --git a/apps/careers-whatislove-dev/src/pages/root/root.js b/apps/careers-whatislove-dev/src/pages/root/root.js index 85fcda48..6f8c3dec 100644 --- a/apps/careers-whatislove-dev/src/pages/root/root.js +++ b/apps/careers-whatislove-dev/src/pages/root/root.js @@ -1,4 +1,4 @@ -import { LitElement, html } from 'lit' +import { html, LitElement } from 'lit' import { property } from 'lit/decorators.js' import { diff --git a/apps/certifications-whatislove-dev/src/libs/components/components.js b/apps/certifications-whatislove-dev/src/libs/components/components.js index 736628ec..de79627b 100644 --- a/apps/certifications-whatislove-dev/src/libs/components/components.js +++ b/apps/certifications-whatislove-dev/src/libs/components/components.js @@ -2,9 +2,9 @@ export { App } from './app/app.jsx' export { Document, G as PDFG, - PDFViewer, Page, Path as PDFPath, + PDFViewer, Svg as PDFSvg, Text, View, diff --git a/apps/whatislove-dev/src/scripts/libs/modules/whatislove-math/whatislove-math.package.js b/apps/whatislove-dev/src/scripts/libs/modules/whatislove-math/whatislove-math.package.js index f80cdc40..ffd927a2 100644 --- a/apps/whatislove-dev/src/scripts/libs/modules/whatislove-math/whatislove-math.package.js +++ b/apps/whatislove-dev/src/scripts/libs/modules/whatislove-math/whatislove-math.package.js @@ -7,14 +7,14 @@ class WhatisloveMath { MENTEE: `mentee`, }) - static NOTHING_TODO_VALUE = /** @type {const} */ (10) - static boostEntityToProfessionalValue = /** @type {const} */ ({ [WhatisloveMath.BoostEntity.BOOK]: 1, [WhatisloveMath.BoostEntity.COURSE]: 3, [WhatisloveMath.BoostEntity.MENTEE]: 10, }) + static NOTHING_TODO_VALUE = /** @type {const} */ (10) + /** * @param {number} initialValue * @param {ValuesOf[]} boostEntities @@ -24,8 +24,8 @@ class WhatisloveMath { static calculateProfessionalLevel(initialValue = 0, ...boostEntities) { let { BoostEntity, - NOTHING_TODO_VALUE, boostEntityToProfessionalValue, + NOTHING_TODO_VALUE, } = WhatisloveMath let hasBoostEntities = boostEntities.length > 0 diff --git a/apps/whatislove-dev/src/scripts/pages/main/libs/components/timeline/timeline.js b/apps/whatislove-dev/src/scripts/pages/main/libs/components/timeline/timeline.js index b5b4cb58..3dfe4cd0 100644 --- a/apps/whatislove-dev/src/scripts/pages/main/libs/components/timeline/timeline.js +++ b/apps/whatislove-dev/src/scripts/pages/main/libs/components/timeline/timeline.js @@ -1,9 +1,9 @@ import { Loader } from '~/libs/components/components.js' import { checkIsBeforeElement } from '~/libs/helpers/helpers.js' import { - Timeline as TTimeline, TimelineApi, TimelineFilter, + Timeline as TTimeline, } from '~/modules/timeline/timeline.js' import { TimelineForm, TimelineList } from './libs/components/components.js' diff --git a/eslint.config.js b/eslint.config.js index 48ca7eb8..0442767f 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -147,9 +147,13 @@ let unicornConfig = { /** @type {FlatConfig} */ let perfectionistConfig = { plugins: { - perfectionist, + perfectionist: /** @type {Plugin} */ ( + /** @type {unknown} */ (perfectionist) + ), }, - rules: perfectionist.configs[`recommended-natural`].rules, + rules: /** @type {RulesRecord} */ ( + perfectionist.configs[`recommended-natural`].rules + ), } /** @type {FlatConfig} */ diff --git a/package-lock.json b/package-lock.json index 20d27f5a..9f07cb55 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@commitlint/types": "18.4.3", "@eslint/js": "8.55.0", "@ls-lint/ls-lint": "2.3.0-beta.1", - "@types/eslint": "8.56.10", + "@types/eslint": "8.56.11", "@types/eslint__js": "8.42.3", "@types/lint-staged": "13.3.0", "@typescript-eslint/eslint-plugin": "7.13.0", @@ -28,7 +28,7 @@ "eslint-import-resolver-typescript": "3.6.1", "eslint-plugin-import": "2.29.0", "eslint-plugin-jsdoc": "48.2.1", - "eslint-plugin-perfectionist": "2.5.0", + "eslint-plugin-perfectionist": "3.0.0", "eslint-plugin-sonarjs": "1.0.3", "eslint-plugin-unicorn": "55.0.0", "globals": "13.24.0", @@ -5831,10 +5831,11 @@ } }, "node_modules/@types/eslint": { - "version": "8.56.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", - "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", + "version": "8.56.11", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.11.tgz", + "integrity": "sha512-sVBpJMf7UPo/wGecYOpk2aQya2VUGeHhe38WG7/mN5FufNSubf5VT9Uh9Uyp8/eLJpu1/tuhJ/qTo4mhSB4V4Q==", "dev": true, + "license": "MIT", "dependencies": { "@types/estree": "*", "@types/json-schema": "*" @@ -5999,12 +6000,6 @@ "integrity": "sha512-YIoDCTH3Af6XM5VuwGG/QL/CJqga1Zm3NkU3HZ4ZHK2fRMPYP1VczsTUqtsf43PH/iJNVlPHAo2oWX7BSdB2Hw==", "dev": true }, - "node_modules/@types/semver": { - "version": "7.5.8", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", - "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", - "dev": true - }, "node_modules/@types/sharp": { "version": "0.31.1", "resolved": "https://registry.npmjs.org/@types/sharp/-/sharp-0.31.1.tgz", @@ -6331,16 +6326,17 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.14.0.tgz", - "integrity": "sha512-VT7CFWHbZipPncAZtuALr9y3EuzY1b1t1AEkIq2bTXUPKw+pHoXflGNG5L+Gv6nKul1cz1VH8fz16IThIU0tdg==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.17.0.tgz", + "integrity": "sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/visitor-keys": "6.14.0" + "@typescript-eslint/types": "7.17.0", + "@typescript-eslint/visitor-keys": "7.17.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -6508,12 +6504,13 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.14.0.tgz", - "integrity": "sha512-uty9H2K4Xs8E47z3SnXEPRNDfsis8JO27amp2GNCnzGETEW3yTqEIVg5+AI7U276oGF/tw6ZA+UesxeQ104ceA==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.17.0.tgz", + "integrity": "sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A==", "dev": true, + "license": "MIT", "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -6521,21 +6518,23 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.14.0.tgz", - "integrity": "sha512-yPkaLwK0yH2mZKFE/bXkPAkkFgOv15GJAUzgUVonAbv0Hr4PK/N2yaA/4XQbTZQdygiDkpt5DkxPELqHguNvyw==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.17.0.tgz", + "integrity": "sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/visitor-keys": "6.14.0", + "@typescript-eslint/types": "7.17.0", + "@typescript-eslint/visitor-keys": "7.17.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -6547,42 +6546,80 @@ } } }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@typescript-eslint/utils": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.14.0.tgz", - "integrity": "sha512-XwRTnbvRr7Ey9a1NT6jqdKX8y/atWG+8fAIu3z73HSP8h06i3r/ClMhmaF/RGWGW1tHJEwij1uEg2GbEmPYvYg==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.17.0.tgz", + "integrity": "sha512-r+JFlm5NdB+JXc7aWWZ3fKSm1gn0pkswEwIYsrGPdsT2GjsRATAKXiNtp3vgAAO1xZhX8alIOEQnNMl3kbTgJw==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.14.0", - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/typescript-estree": "6.14.0", - "semver": "^7.5.4" + "@typescript-eslint/scope-manager": "7.17.0", + "@typescript-eslint/types": "7.17.0", + "@typescript-eslint/typescript-estree": "7.17.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.14.0.tgz", - "integrity": "sha512-fB5cw6GRhJUz03MrROVuj5Zm/Q+XWlVdIsFj+Zb1Hvqouc8t+XP2H5y53QYU/MGtd2dPg6/vJJlhoX3xc2ehfw==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.17.0.tgz", + "integrity": "sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "6.14.0", - "eslint-visitor-keys": "^3.4.1" + "@typescript-eslint/types": "7.17.0", + "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -11145,20 +11182,25 @@ } }, "node_modules/eslint-plugin-perfectionist": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-perfectionist/-/eslint-plugin-perfectionist-2.5.0.tgz", - "integrity": "sha512-F6XXcq4mKKUe/SREoMGQqzgw6cgCgf3pFzkFfQVIGtqD1yXVpQjnhTepzhBeZfxZwgMzR9HO4yH4CUhIQ2WBcQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-perfectionist/-/eslint-plugin-perfectionist-3.0.0.tgz", + "integrity": "sha512-B+leJTo1YjxiNIm8Yv0rCHp4eWh9RaJHO6T1ifxd26wg8NCbEiWSdqZVeYLWPCI+zS1dlf89WpOkUzG7cE4vtQ==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/utils": "^6.13.0", - "minimatch": "^9.0.3", + "@typescript-eslint/types": "^7.16.1", + "@typescript-eslint/utils": "^7.16.1", + "minimatch": "^10.0.1", "natural-compare-lite": "^1.4.0" }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, "peerDependencies": { - "astro-eslint-parser": "^0.16.0", + "astro-eslint-parser": "^1.0.2", "eslint": ">=8.0.0", "svelte": ">=3.0.0", - "svelte-eslint-parser": "^0.33.0", + "svelte-eslint-parser": "^0.40.0", "vue-eslint-parser": ">=9.0.0" }, "peerDependenciesMeta": { @@ -11181,20 +11223,22 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/eslint-plugin-perfectionist/node_modules/minimatch": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", - "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", + "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" diff --git a/package.json b/package.json index 9f854ae4..642b1180 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@commitlint/types": "18.4.3", "@eslint/js": "8.55.0", "@ls-lint/ls-lint": "2.3.0-beta.1", - "@types/eslint": "8.56.10", + "@types/eslint": "8.56.11", "@types/eslint__js": "8.42.3", "@types/lint-staged": "13.3.0", "@typescript-eslint/eslint-plugin": "7.13.0", @@ -43,7 +43,7 @@ "eslint-import-resolver-typescript": "3.6.1", "eslint-plugin-import": "2.29.0", "eslint-plugin-jsdoc": "48.2.1", - "eslint-plugin-perfectionist": "2.5.0", + "eslint-plugin-perfectionist": "3.0.0", "eslint-plugin-sonarjs": "1.0.3", "eslint-plugin-unicorn": "55.0.0", "globals": "13.24.0", diff --git a/packages.d.ts b/packages.d.ts index 366006c4..600edbe1 100644 --- a/packages.d.ts +++ b/packages.d.ts @@ -1,13 +1,3 @@ -declare module 'eslint-plugin-perfectionist' { - import { type Linter } from 'eslint' - - const configs: Record<'recommended-natural', Required> - - export default { - configs, - } -} - declare module 'eslint-plugin-import' { import { type Linter } from 'eslint'