Skip to content

Commit b0cedf1

Browse files
authored
ci(whatislove-dev/careers-whatislove-dev): update ts/sonar/lit/wb eslint plugins wd-270 (#648)
1 parent 0e39828 commit b0cedf1

File tree

14 files changed

+608
-198
lines changed

14 files changed

+608
-198
lines changed

apps/careers-whatislove-dev/eslint.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import baseConfig from '../../eslint.config.js'
66

77
/** @typedef {import('eslint').Linter.FlatConfig} */
88
let FlatConfig
9+
/** @typedef {import('eslint').Linter.RulesRecord} */
10+
let RulesRecord
911

1012
/** @type {FlatConfig} */
1113
let ignoresConfig = {
@@ -15,9 +17,9 @@ let ignoresConfig = {
1517
/** @type {FlatConfig} */
1618
let litConfig = {
1719
plugins: {
18-
lit,
20+
lit: lit,
1921
},
20-
rules: lit.configs.all.rules,
22+
rules: /** @type {RulesRecord} */ (lit.configs.all.rules),
2123
}
2224

2325
let litA11yConfig = {

apps/careers-whatislove-dev/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
"@ffmpeg-installer/ffmpeg": "1.1.0",
2525
"@ffprobe-installer/ffprobe": "2.1.2",
2626
"@types/fluent-ffmpeg": "2.1.24",
27-
"eslint-plugin-lit": "1.11.0",
27+
"eslint-plugin-lit": "1.14.0",
2828
"eslint-plugin-lit-a11y": "4.1.2",
29-
"eslint-plugin-wc": "2.0.4",
29+
"eslint-plugin-wc": "2.1.0",
3030
"fluent-ffmpeg": "2.1.2",
3131
"vite-plugin-babel": "1.2.0"
3232
}
Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
declare module 'eslint-plugin-lit' {
2-
import { type Linter } from 'eslint'
3-
4-
const configs: Record<'all', Required<Linter.FlatConfig>>
5-
6-
export default {
7-
configs,
8-
}
9-
}
10-
111
declare module 'eslint-plugin-lit-a11y' {
122
import { type Linter } from 'eslint'
133

@@ -17,13 +7,3 @@ declare module 'eslint-plugin-lit-a11y' {
177
configs,
188
}
199
}
20-
21-
declare module 'eslint-plugin-wc' {
22-
import { type Linter } from 'eslint'
23-
24-
const configs: Record<'best-practice', Required<Linter.FlatConfig>>
25-
26-
export default {
27-
configs,
28-
}
29-
}

apps/careers-whatislove-dev/src/libs/modules/database/database.module.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ class Database {
3030
* @returns {{ set: (payload: Record<string, unknown>) => Promise<void> }}
3131
*/
3232
getTableReference(tableName) {
33-
let reference = ref(this.#instance, `${tableName}/${Date.now()}`)
33+
let reference = ref(
34+
this.#instance,
35+
`${tableName}/${Date.now().toString()}`,
36+
)
3437

3538
return {
3639
/**

apps/whatislove-dev/eleventy.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ let init = (config) => {
126126
fonts: [400, 700].map((weight) => ({
127127
data: readFileSync(
128128
new URL(
129-
`src/fonts/red-hat-display-${weight}.woff`,
129+
`src/fonts/red-hat-display-${weight.toString()}.woff`,
130130
import.meta.url,
131131
),
132132
),
@@ -339,7 +339,7 @@ let init = (config) => {
339339
let extension = extname(source)
340340
let name = basename(source, extension)
341341

342-
return `${name}-${width}w.${format}`
342+
return `${name}-${width.toString()}w.${format.toString()}`
343343
},
344344
formats: [`avif`, `webp`, `png`],
345345
widths: [640, 960, 1280, 1920, 2560],

apps/whatislove-dev/src/data/mentions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ let getDevtoPageMention = async () => {
137137

138138
for (let article of articles) {
139139
let comments = await /** @type {Promise<CommentDevto[]>} */ (
140-
callDevtoApi(`/comments?a_id=${article.id}`)
140+
callDevtoApi(`/comments?a_id=${article.id.toString()}`)
141141
)
142142

143143
let allComments = getAllDevtoComments(comments)

apps/whatislove-dev/src/scripts/libs/helpers/get-server-api-url/get-server-api-url.helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @returns {string}
88
*/
99
let getServerApiUrl = ({ apiPrefix = ``, host = ``, port = 0 } = {}) => {
10-
return `${host}${port}${apiPrefix}`
10+
return `${host}${port.toString()}${apiPrefix}`
1111
}
1212

1313
export { getServerApiUrl }

apps/whatislove-dev/src/scripts/libs/modules/http/http.package.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Http {
3636
}
3737

3838
/**
39-
* @param {Error} error
39+
* @param {unknown} error
4040
* @returns {never}
4141
* @throws {Error}
4242
*/
@@ -88,7 +88,7 @@ class Http {
8888
.then((response) => /** @type {T} */ (Http.parseJSON(response)))
8989
.catch(
9090
/**
91-
* @param {Error} error
91+
* @param {unknown} error
9292
* @returns {ReturnType<typeof Http.throwError>}
9393
*/
9494
(error) => Http.throwError(error),

apps/whatislove-dev/src/scripts/pages/main/libs/components/easter-egg/easter-egg.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ class EasterEgg {
181181
)
182182
let { x, y } = getNodeRandomCoords(easterEggButtonWrapperNode)
183183

184-
easterEggButtonWrapperNode.style.insetBlockStart = `${y}px`
185-
easterEggButtonWrapperNode.style.insetInlineStart = `${x}px`
184+
easterEggButtonWrapperNode.style.insetBlockStart = `${y.toString()}px`
185+
easterEggButtonWrapperNode.style.insetInlineStart = `${x.toString()}px`
186186
}
187187

188188
/**

apps/whatislove-dev/src/transforms/add-toc/libs/helpers/generate-toc-markup/generate-toc-markup.helper.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ let generateTocMarkup = (item) => {
1212
if (hasLiNode) {
1313
markup += `
1414
<li class="${BlockName.TOC}__item">
15-
<a class="${BlockName.TOC}__link" href="#${item.slug}">
16-
${item.text}
15+
<a
16+
class="${BlockName.TOC}__link"
17+
href="#${/** @type {string} */ (item.slug).toString()}"
18+
>
19+
${/** @type {string} */ (item.text).toString()}
1720
</a>
1821
`
1922
}

eslint.config.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ import globals from 'globals'
1111

1212
/** @typedef {import('eslint').Linter.FlatConfig} */
1313
let FlatConfig
14-
/** @typedef {import('eslint').Linter.ParserModule} */
15-
let ParserModule
14+
/** @typedef {import('eslint').ESLint.Plugin} */
15+
let Plugin
16+
/** @typedef {import('eslint').Linter.RulesRecord} */
17+
let RulesRecord
1618

1719
/** @type {FlatConfig} */
1820
let ignoresConfig = {
@@ -121,9 +123,9 @@ let importConfig = {
121123
/** @type {FlatConfig} */
122124
let sonarConfig = {
123125
plugins: {
124-
sonarjs,
126+
sonarjs: /** @type {Plugin} */ (/** @type {unknown} */ (sonarjs)),
125127
},
126-
rules: sonarjs.configs.recommended.rules,
128+
rules: /** @type {RulesRecord} */ (sonarjs.configs.recommended.rules),
127129
}
128130

129131
/** @type {FlatConfig} */
@@ -183,16 +185,18 @@ let jsdocConfig = {
183185
/** @type {FlatConfig} */
184186
let typescriptPlugin = {
185187
languageOptions: {
186-
parser: /** @type {ParserModule} */ (tsParser),
188+
parser: tsParser,
187189
parserOptions: {
188190
project: `./tsconfig.json`,
189191
},
190192
},
191193
plugins: {
192-
'@typescript-eslint': ts,
194+
'@typescript-eslint': /** @type {Plugin} */ (
195+
/** @type {unknown} */ (ts)
196+
),
193197
},
194198
rules: {
195-
...ts.configs[`strict-type-checked`].rules,
199+
...ts.configs[`strict-type-checked`]?.rules,
196200
'@typescript-eslint/no-extraneous-class': [
197201
`error`,
198202
{

0 commit comments

Comments
 (0)