1
0
mirror of https://github.com/badges/shields.git synced 2025-04-18 19:44:04 +03:00
shields/services/node/node-lts.service.js
chris48s c567f6cde4
Migrate to ESLint 9 (#10762)
* update ESLint related packages

* migrate to flat config format

* Fix prefer-const error

Fixes
'overrideLogoSize' is never reassigned. Use 'const' instead

* remove irrelevant eslint-disable comment

These comments came from a swizzled upstream
component but never did anything in our codebase.

ESLint 9 does not allow disable comments
for rules that are not registered.

* remove irrelevant eslint-disable comments

These were here because in the past we were applying
mocha lint rules to files which contained no tests

ESLint 9 now flags eslint-disable comments
that aren't doing anythings

* remove irrelevant eslint-disable comment

ESLint 9 now flags eslint-disable comments
that aren't doing anything

* there are no .tsx files in our code any more

* include .mjs files in linting and formatting

* update sort-class-members rule for openApi property

and update the handful of files violating it
2024-12-31 13:54:25 +00:00

61 lines
1.6 KiB
JavaScript

import { pathParam, queryParam } from '../index.js'
import { packageNameDescription } from '../npm/npm-base.js'
import NodeVersionBase from './node-base.js'
import { versionColorForRangeLts } from './node-version-color.js'
const description = `<p>This badge indicates whether the package supports <b>all</b> LTS node versions.</p>
<p>The node version support is retrieved from the <code>engines.node</code> section in package.json.</p>`
export default class NodeLtsVersion extends NodeVersionBase {
static route = this.buildRoute('node/v-lts', { withTag: true })
static openApi = {
'/node/v-lts/{packageName}': {
get: {
summary: 'Node LTS',
description,
parameters: [
pathParam({
name: 'packageName',
example: 'passport',
description: packageNameDescription,
}),
queryParam({
name: 'registry_uri',
example: 'https://registry.npmjs.com',
}),
],
},
},
'/node/v-lts/{packageName}/{tag}': {
get: {
summary: 'Node LTS (with tag)',
description,
parameters: [
pathParam({
name: 'packageName',
example: 'passport',
description: packageNameDescription,
}),
pathParam({
name: 'tag',
example: 'latest',
}),
queryParam({
name: 'registry_uri',
example: 'https://registry.npmjs.com',
}),
],
},
},
}
static defaultBadgeData = {
label: 'node-lts',
}
static type = 'lts'
static colorResolver = versionColorForRangeLts
}