@@ -22,7 +22,13 @@ function compactObj(obj) {
2222}
2323
2424/***
25- * @param {{ enableJest?: boolean, enableTypescript?: boolean, ignores?: string[] } } [options={}] - Options to customize the config
25+ * @param {{
26+ * enableJest?: boolean,
27+ * enableTypescript?: boolean,
28+ * ignores?: string[],
29+ * commonRules?: Readonly<import('eslint').Linter.RulesRecord>,
30+ * typescriptRules?: Readonly<import('eslint').Linter.RulesRecord>,
31+ * }} [options={ }] - Options to customize the config
2632 * @returns {Promise<import('eslint').Linter.Config[]> }
2733 */
2834export async function generateEslintConfig ( options = { } ) {
@@ -46,6 +52,8 @@ export async function generateEslintConfig(options = {}) {
4652 'no-use-before-define' : 'off' ,
4753 'no-warning-comments' : [ 'error' , { terms : [ 'nocommit' , '@nocommit' , '@no-commit' ] } ] ,
4854 // 'jest/no-mocks-import': 'off',
55+
56+ ...( options . commonRules || { } ) ,
4957 } ,
5058 }
5159
@@ -101,6 +109,8 @@ export async function generateEslintConfig(options = {}) {
101109 '@typescript-eslint/restrict-plus-operands' : 0 ,
102110 '@typescript-eslint/no-redundant-type-constituents' : 0 ,
103111 /** End 'recommended-requiring-type-checking' overrides */
112+
113+ ...( options . typescriptRules || { } ) ,
104114 } ,
105115 }
106116 : null ,
0 commit comments