diff --git a/src/configs/eslint/__snapshots__/config.spec.ts.snap b/src/configs/eslint/__snapshots__/config.spec.ts.snap index 320af179..3f390966 100644 --- a/src/configs/eslint/__snapshots__/config.spec.ts.snap +++ b/src/configs/eslint/__snapshots__/config.spec.ts.snap @@ -2806,7 +2806,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "./tsconfig.json", ], "sourceType": "module", - "tsconfigRootDir": "/Users/connorbar/Projects/github.com/sumup-oss/foundry", + "tsconfigRootDir": "/project/dir", }, "plugins": [ "@typescript-eslint", @@ -3109,7 +3109,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "./tsconfig.json", ], "sourceType": "module", - "tsconfigRootDir": "/Users/connorbar/Projects/github.com/sumup-oss/foundry", + "tsconfigRootDir": "/project/dir", }, "plugins": [ "@typescript-eslint", @@ -3410,7 +3410,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "./tsconfig.json", ], "sourceType": "module", - "tsconfigRootDir": "/Users/connorbar/Projects/github.com/sumup-oss/foundry", + "tsconfigRootDir": "/project/dir", }, "plugins": [ "@typescript-eslint", @@ -3718,7 +3718,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "./tsconfig.json", ], "sourceType": "module", - "tsconfigRootDir": "/Users/connorbar/Projects/github.com/sumup-oss/foundry", + "tsconfigRootDir": "/project/dir", }, "plugins": [ "@typescript-eslint", @@ -4052,7 +4052,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "./tsconfig.json", ], "sourceType": "module", - "tsconfigRootDir": "/Users/connorbar/Projects/github.com/sumup-oss/foundry", + "tsconfigRootDir": "/project/dir", }, "plugins": [ "@typescript-eslint", @@ -4352,7 +4352,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "./tsconfig.json", ], "sourceType": "module", - "tsconfigRootDir": "/Users/connorbar/Projects/github.com/sumup-oss/foundry", + "tsconfigRootDir": "/project/dir", }, "plugins": [ "@typescript-eslint", @@ -4649,7 +4649,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "./tsconfig.json", ], "sourceType": "module", - "tsconfigRootDir": "/Users/connorbar/Projects/github.com/sumup-oss/foundry", + "tsconfigRootDir": "/project/dir", }, "plugins": [ "@typescript-eslint", @@ -4936,7 +4936,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "./tsconfig.json", ], "sourceType": "module", - "tsconfigRootDir": "/Users/connorbar/Projects/github.com/sumup-oss/foundry", + "tsconfigRootDir": "/project/dir", }, "plugins": [ "@typescript-eslint", @@ -5241,7 +5241,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "./tsconfig.json", ], "sourceType": "module", - "tsconfigRootDir": "/Users/connorbar/Projects/github.com/sumup-oss/foundry", + "tsconfigRootDir": "/project/dir", }, "plugins": [ "@typescript-eslint", @@ -5541,7 +5541,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "./tsconfig.json", ], "sourceType": "module", - "tsconfigRootDir": "/Users/connorbar/Projects/github.com/sumup-oss/foundry", + "tsconfigRootDir": "/project/dir", }, "plugins": [ "@typescript-eslint", @@ -5839,7 +5839,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "./tsconfig.json", ], "sourceType": "module", - "tsconfigRootDir": "/Users/connorbar/Projects/github.com/sumup-oss/foundry", + "tsconfigRootDir": "/project/dir", }, "plugins": [ "@typescript-eslint", @@ -6144,7 +6144,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "./tsconfig.json", ], "sourceType": "module", - "tsconfigRootDir": "/Users/connorbar/Projects/github.com/sumup-oss/foundry", + "tsconfigRootDir": "/project/dir", }, "plugins": [ "@typescript-eslint", @@ -6477,7 +6477,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "./tsconfig.json", ], "sourceType": "module", - "tsconfigRootDir": "/Users/connorbar/Projects/github.com/sumup-oss/foundry", + "tsconfigRootDir": "/project/dir", }, "plugins": [ "@typescript-eslint", @@ -6774,7 +6774,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "./tsconfig.json", ], "sourceType": "module", - "tsconfigRootDir": "/Users/connorbar/Projects/github.com/sumup-oss/foundry", + "tsconfigRootDir": "/project/dir", }, "plugins": [ "@typescript-eslint", @@ -7068,7 +7068,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "./tsconfig.json", ], "sourceType": "module", - "tsconfigRootDir": "/Users/connorbar/Projects/github.com/sumup-oss/foundry", + "tsconfigRootDir": "/project/dir", }, "plugins": [ "@typescript-eslint", @@ -7352,7 +7352,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "./tsconfig.json", ], "sourceType": "module", - "tsconfigRootDir": "/Users/connorbar/Projects/github.com/sumup-oss/foundry", + "tsconfigRootDir": "/project/dir", }, "plugins": [ "@typescript-eslint", diff --git a/src/configs/eslint/config.ts b/src/configs/eslint/config.ts index e60e9913..18ad9fb7 100644 --- a/src/configs/eslint/config.ts +++ b/src/configs/eslint/config.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import process from 'process'; +import { cwd } from 'process'; import { flow, mergeWith, isArray, isObject, isEmpty, uniq } from 'lodash/fp'; @@ -166,7 +166,7 @@ function customizeLanguage(language?: Language) { plugins: ['@typescript-eslint'], parser: '@typescript-eslint/parser', parserOptions: { - tsconfigRootDir: process.cwd(), + tsconfigRootDir: cwd(), project: ['./tsconfig.json'], extraFileExtensions: ['.json'], sourceType: 'module',