Merge pull request #2684 from themousepotato/lintrule-dirname-fix
Add a lint rule to avoid using __dirname
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable no-restricted-syntax */
|
||||
const path = require('path');
|
||||
|
||||
// Figure out whether we're running inside the backstage repo or as an installed dependency
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user