-
Notifications
You must be signed in to change notification settings - Fork 8
/
eslint.config.js
47 lines (39 loc) · 1.49 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import path from 'path'
import { fileURLToPath } from 'url'
/**
* @todo(eslint) cycle through each one until we are good to go back to: react
*/
import { configReactDefault } from '@jeromefitz/eslint-config/src/react.js'
// import { configE2EDefault } from '@jeromefitz/eslint-config/src/e2e.js'
// import { configJestDefault } from '@jeromefitz/eslint-config/src/jest.js'
// import { configNextDefault } from '@jeromefitz/eslint-config/src/next.js'
// import { configTailwindDefault } from '@jeromefitz/eslint-config/src/tailwind.js'
// import { configTurboDefault } from '@jeromefitz/eslint-config/src/turbo.js'
import _findIndex from 'lodash/findIndex.js'
import _merge from 'lodash/merge.js'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
/**
* @hack(eslint) monorepo manipulation for typescript
*/
const ESLINT_HACK__CONFIG = configReactDefault
const ESLINT_HACK__NAME = '@jeromefitz/eslint-config:typescript'
const ESLINT_HACK__INDEX = _findIndex(configReactDefault, {
name: ESLINT_HACK__NAME,
})
const ESLINT_HACK__OBJECT = _merge(configReactDefault[ESLINT_HACK__INDEX], {
languageOptions: {
parserOptions: {
project: [
'./tsconfig.json',
'./tsconfig.eslint.json',
'./config/*/tsconfig.json',
'./packages/*/tsconfig.json',
],
tsconfigRootDir: __dirname,
},
},
})
ESLINT_HACK__CONFIG[ESLINT_HACK__INDEX] = ESLINT_HACK__OBJECT
// console.dir(ESLINT_HACK__CONFIG)
export default [...ESLINT_HACK__CONFIG]