File tree 3 files changed +18
-4
lines changed
3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 1
1
const { buildConfig} = require ( './helpers/eslint' )
2
2
3
- module . exports = buildConfig ( { withReact : true } )
3
+ const defaultOptions = { withReact : true }
4
+
5
+ const defaultExport = buildConfig ( defaultOptions )
6
+
7
+ defaultExport . buildConfig = options =>
8
+ buildConfig ( { ...defaultOptions , ...options } )
9
+
10
+ module . exports = defaultExport
Original file line number Diff line number Diff line change 1
1
const { buildConfig} = require ( './helpers/eslint' )
2
2
3
- module . exports = buildConfig ( )
3
+ const defaultExport = buildConfig ( )
4
+
5
+ defaultExport . buildConfig = buildConfig
6
+
7
+ module . exports = defaultExport
Original file line number Diff line number Diff line change @@ -22,7 +22,10 @@ const parserRules = (typescript = false) => {
22
22
}
23
23
}
24
24
25
- const buildConfig = ( { withReact = false } = { } ) => {
25
+ const buildConfig = ( {
26
+ withReact = false ,
27
+ tsProjects = './**/*/tsconfig.json' ,
28
+ } = { } ) => {
26
29
const ifReact = ( t , f ) => ( withReact || hasReact ? t : f )
27
30
28
31
return {
@@ -56,7 +59,7 @@ const buildConfig = ({withReact = false} = {}) => {
56
59
{
57
60
files : [ '**/*.ts?(x)' ] ,
58
61
parserOptions : {
59
- project : './**/*/tsconfig.json' ,
62
+ project : tsProjects ,
60
63
} ,
61
64
extends : [
62
65
'plugin:@typescript-eslint/recommended-requiring-type-checking' ,
You can’t perform that action at this time.
0 commit comments