Skip to content

Commit

Permalink
fs.test.ts: Improve readbility, add types to fix TS problems (#1482)
Browse files Browse the repository at this point in the history
* more readable const names instead of index number ([2] etc)

* verify fs method name exists in Base.prototype (fixes type problem)

* use Data type from ejs. Must include ejs package explicitly

* use SinonStub type

* ts-expect-error for spyOn type; comment re: why not use sinonStub for get config ?

* types for op. results, paths; put op results into var so it can be typed as FSOpResult[]

* add missing help: to new generator options

* removed unneeded eslint disable
  • Loading branch information
weedySeaDragon committed Oct 21, 2023
1 parent 8d95ae0 commit 3dd4c2d
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 107 deletions.
8 changes: 5 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -71,6 +71,7 @@
},
"devDependencies": {
"@types/debug": "^4.1.9",
"@types/ejs": "^3.1.4",
"@types/inquirer": "^9.0.4",
"@types/minimist": "^1.2.3",
"@types/semver": "^7.5.3",
Expand All @@ -80,6 +81,7 @@
"@yeoman/transform": "^1.2.0",
"c8": "^8.0.1",
"cpy-cli": "^5.0.0",
"ejs": "^3.1.9",
"esmocha": "^1.0.1",
"inquirer": "^9.2.11",
"jsdoc": "^4.0.2",
Expand Down
1 change: 0 additions & 1 deletion src/actions/fs.ts
@@ -1,7 +1,6 @@
/* eslint max-params: [1, 5] */
import assert from 'node:assert';
import { type CopyOptions, type MemFsEditor } from 'mem-fs-editor';
// eslint-disable-next-line import/no-extraneous-dependencies
import type { Data as TemplateData, Options as TemplateOptions } from 'ejs';
import type { OverloadParameters, OverloadReturnType } from '../types-utils.js';
import type BaseGenerator from '../generator.js';
Expand Down

0 comments on commit 3dd4c2d

Please sign in to comment.