Add a lint rule to avoid using __dirname

This commit is contained in:
Navaneeth Suresh
2020-09-30 23:33:21 +05:30
parent 17c30eaf3e
commit bbeaff9daf
18 changed files with 24 additions and 0 deletions
+1
View File
@@ -37,6 +37,7 @@ export async function generate(
);
}
/* eslint-disable-next-line no-restricted-syntax */
const rootDir = resolvePath(__dirname, '../../..');
const srcDir = resolvePath(rootDir, 'packages', 'core-api', 'src');
const targetDir = resolvePath(targetPath);
+1
View File
@@ -21,6 +21,7 @@ import fs from 'fs-extra';
import { generate } from './generate';
const main = (argv: string[]) => {
/* eslint-disable-next-line no-restricted-syntax */
const pkgJson = fs.readJsonSync(resolvePath(__dirname, '../package.json'));
program.name('docgen').version(pkgJson.version);