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
+2
View File
@@ -18,6 +18,7 @@
const path = require('path');
// Figure out whether we're running inside the backstage repo or as an installed dependency
/* eslint-disable-next-line no-restricted-syntax */
const isLocal = require('fs').existsSync(path.resolve(__dirname, '../src'));
if (!isLocal || process.env.BACKSTAGE_E2E_CLI_TEST) {
@@ -25,6 +26,7 @@ if (!isLocal || process.env.BACKSTAGE_E2E_CLI_TEST) {
} else {
require('ts-node').register({
transpileOnly: true,
/* eslint-disable-next-line no-restricted-syntax */
project: path.resolve(__dirname, '../../../tsconfig.json'),
compilerOptions: {
module: 'CommonJS',