diff --git a/src/actions/fs.ts b/src/actions/fs.ts index 1eeeadc6..9d425de0 100644 --- a/src/actions/fs.ts +++ b/src/actions/fs.ts @@ -1,9 +1,9 @@ -/* eslint max-params: [1, 5] */ +/* eslint max-params: [1, 6] */ import assert from 'node:assert'; import { type CopyOptions, type MemFsEditor } from 'mem-fs-editor'; import type { Data as TemplateData, Options as TemplateOptions } from 'ejs'; import type { OverloadParameters, OverloadReturnType } from '../types-utils.js'; -import type BaseGenerator from '../generator.js'; +import type { BaseGenerator } from '../generator.js'; export type Template = { /** diff --git a/src/actions/help.ts b/src/actions/help.ts index 417e9fec..f9eea385 100644 --- a/src/actions/help.ts +++ b/src/actions/help.ts @@ -2,7 +2,7 @@ import path from 'node:path'; import fs from 'node:fs'; import table from 'text-table'; import type { ArgumentSpec, CliOptionSpec } from '../types.js'; -import type BaseGenerator from '../generator.js'; +import type { BaseGenerator } from '../generator.js'; function formatArg(config: ArgumentSpec) { let arg = `<${config.name}>`; diff --git a/src/actions/spawn-command.ts b/src/actions/spawn-command.ts index d925fc6f..32faeaf9 100644 --- a/src/actions/spawn-command.ts +++ b/src/actions/spawn-command.ts @@ -9,7 +9,7 @@ import { execaCommandSync, execaSync, } from 'execa'; -import type BaseGenerator from '../generator.js'; +import type { BaseGenerator } from '../generator.js'; export class SpawnCommandMixin { /** diff --git a/src/generator.ts b/src/generator.ts index 194c4d83..de8793bf 100644 --- a/src/generator.ts +++ b/src/generator.ts @@ -4,7 +4,7 @@ import os from 'node:os'; import { EventEmitter } from 'node:events'; import { fileURLToPath } from 'node:url'; import * as _ from 'lodash-es'; -import semver from 'semver'; +import { lte as semverLte } from 'semver'; import { readPackageUpSync } from 'read-package-up'; import chalk from 'chalk'; import minimist from 'minimist'; @@ -291,7 +291,7 @@ export class BaseGenerator = { - get(storage: Storage, property: string, receiver: any): StorageValue { + get(storage: Storage, property: string, _receiver: any): StorageValue { return storage.get(property); }, - set(storage: Storage, property: string, value: any, receiver: any): boolean { + set(storage: Storage, property: string, value: any, _receiver: any): boolean { if (typeof property === 'string') { storage.set(property, value); return true; diff --git a/test/fs.test.ts b/test/fs.test.ts index a2e66023..82300bc4 100644 --- a/test/fs.test.ts +++ b/test/fs.test.ts @@ -5,7 +5,7 @@ import { TestAdapter } from '@yeoman/adapter/testing'; import { type SinonStub, stub as sinonStub } from 'sinon'; import type { Data as TemplateData } from 'ejs'; import Environment from 'yeoman-environment'; -import BaseGenerator from '../src/generator.js'; +import { BaseGenerator } from '../src/generator.js'; import Base from './utils.js'; const randomString = () => Math.random().toString(36).slice(7); diff --git a/test/generators.test.ts b/test/generators.test.ts index 43166b0a..f2ac9686 100644 --- a/test/generators.test.ts +++ b/test/generators.test.ts @@ -5,7 +5,7 @@ import { beforeEach, describe, it } from 'vitest'; import { TestAdapter } from '@yeoman/adapter/testing'; import Environment from 'yeoman-environment'; import assert from 'yeoman-assert'; -import semver from 'semver'; +import { valid as semverValid } from 'semver'; import Base from './utils.js'; const NAMESPACE = 'somenamespace'; @@ -31,7 +31,7 @@ describe('Generators module', () => { }); it('should expose yoGeneratorVersion', () => { - assert(semver.valid(generator.yoGeneratorVersion), `Not valid version ${generator.yoGeneratorVersion as string}`); + assert(semverValid(generator.yoGeneratorVersion), `Not valid version ${generator.yoGeneratorVersion as string}`); }); it('is an EventEmitter', () => diff --git a/test/package-json.test.ts b/test/package-json.test.ts index b098f3fb..c3907a3d 100644 --- a/test/package-json.test.ts +++ b/test/package-json.test.ts @@ -1,6 +1,6 @@ import assert from 'node:assert'; import { beforeEach, describe, expect, it, vi } from 'vitest'; -import semver from 'semver'; +import { lte as semverLte } from 'semver'; import helpers from 'yeoman-test'; import type { BaseEnvironment } from '@yeoman/types'; import Generator from '../src/index.js'; @@ -21,7 +21,7 @@ describe('Base#package-json', () => { describe('_resolvePackageJsonDependencies()', () => { it('should accept empty version and resolve', async ctx => { - if (semver.lte(env.getVersion(), '3.1.0')) { + if (semverLte(env.getVersion(), '3.1.0')) { ctx.skip(); } const dependencies = await generator._resolvePackageJsonDependencies('yeoman-generator'); @@ -40,7 +40,7 @@ describe('Base#package-json', () => { }); it('should resolve object with empty version and resolve', async ctx => { - if (semver.lte(env.getVersion(), '3.1.0')) { + if (semverLte(env.getVersion(), '3.1.0')) { ctx.skip(); }