Skip to content

Commit 870e622

Browse files
committed
fixed linting errors
Signed-off-by: ItsRoy69 <[email protected]>
1 parent 0060d24 commit 870e622

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

apps/generator/lib/generator.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ const { definitions, flatten, shorthands } = require('@npmcli/config/lib/definit
3838

3939
const FILTERS_DIRNAME = 'filters';
4040
const HOOKS_DIRNAME = 'hooks';
41-
const CONFIG_FILENAME = 'package.json';
4241
const PACKAGE_JSON_FILENAME = 'package.json';
4342
const GIT_IGNORE_FILENAME = '{.gitignore}';
4443
const NPM_IGNORE_FILENAME = '{.npmignore}';
@@ -956,14 +955,11 @@ class Generator {
956955
* @return {Promise<boolean>}
957956
*/
958957
async shouldOverwriteFile(filePath) {
959-
if (!Array.isArray(this.noOverwriteGlobs)) return true;
960-
const fileExists = await exists(path.resolve(this.targetDir, filePath));
961-
if (!fileExists) return true;
962-
963-
return !this.noOverwriteGlobs.some(globExp => minimatch(filePath, globExp));
958+
if (this.forceWrite) return true;
959+
if (this.noOverwriteGlobs.some(glob => minimatch(filePath, glob))) return false;
960+
return !(await exists(filePath));
964961
}
965962

966-
967963
/**
968964
* Launches all the hooks registered at a given hook point/name.
969965
*

apps/generator/lib/templateConfig/loader.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const path = require('path');
2-
const fs = require('fs');
32
const log = require('loglevel');
43
const { readFile } = require('../utils');
54

apps/generator/lib/templateConfig/validator.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const semver = require('semver');
22
const Ajv = require('ajv');
33
const { getGeneratorVersion } = require('../utils');
44
const levenshtein = require('levenshtein-edit-distance');
5-
// eslint-disable-next-line no-unused-vars
65
const {AsyncAPIDocumentInterface, AsyncAPIDocument} = require('@asyncapi/parser');
76
const { usesNewAPI } = require('../parser');
87

0 commit comments

Comments
 (0)