Skip to content

Commit 68fad5b

Browse files
committed
feat: add flat/recommended-mixed config; fixes #1101
1 parent 74186a3 commit 68fad5b

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed

src/index-cjs.js

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,15 @@ import validTypes from './rules/validTypes.js';
7474
* @typedef {"" | "-typescript" | "-typescript-flavor"} ConfigVariants
7575
* @typedef {"" | "-error"} ErrorLevelVariants
7676
* @type {import('eslint').ESLint.Plugin & {
77-
* configs: Record<`flat/${ConfigGroups}${ConfigVariants}${ErrorLevelVariants}`,
78-
* import('eslint').Linter.Config> & Record<"examples"|"default-expressions"|"examples-and-default-expressions", import('eslint').Linter.Config[]>
77+
* configs: Record<
78+
* `flat/${ConfigGroups}${ConfigVariants}${ErrorLevelVariants}`,
79+
* import('eslint').Linter.Config
80+
* > &
81+
* Record<
82+
* "examples"|"default-expressions"|"examples-and-default-expressions",
83+
* import('eslint').Linter.Config[]
84+
* > &
85+
* Record<"flat/recommended-mixed", import('eslint').Linter.Config[]>
7986
* }}
8087
*/
8188
const index = {};
@@ -666,4 +673,19 @@ index.configs['examples-and-default-expressions'] = /** @type {import('eslint').
666673
}),
667674
]);
668675

676+
index.configs['flat/recommended-mixed'] = [
677+
{
678+
...index.configs['flat/recommended-typescript-flavor'],
679+
files: [
680+
'**/*.{js,jsx,cjs,mjs}',
681+
],
682+
},
683+
{
684+
...index.configs['flat/recommended-typescript'],
685+
files: [
686+
'**/*.{ts,tsx,cts,mts}',
687+
],
688+
},
689+
];
690+
669691
export default index;

src/index.js

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,15 @@ import validTypes from './rules/validTypes.js';
8080
* @typedef {"" | "-typescript" | "-typescript-flavor"} ConfigVariants
8181
* @typedef {"" | "-error"} ErrorLevelVariants
8282
* @type {import('eslint').ESLint.Plugin & {
83-
* configs: Record<`flat/${ConfigGroups}${ConfigVariants}${ErrorLevelVariants}`,
84-
* import('eslint').Linter.Config> & Record<"examples"|"default-expressions"|"examples-and-default-expressions", import('eslint').Linter.Config[]>
83+
* configs: Record<
84+
* `flat/${ConfigGroups}${ConfigVariants}${ErrorLevelVariants}`,
85+
* import('eslint').Linter.Config
86+
* > &
87+
* Record<
88+
* "examples"|"default-expressions"|"examples-and-default-expressions",
89+
* import('eslint').Linter.Config[]
90+
* > &
91+
* Record<"flat/recommended-mixed", import('eslint').Linter.Config[]>
8592
* }}
8693
*/
8794
const index = {};
@@ -672,6 +679,21 @@ index.configs['examples-and-default-expressions'] = /** @type {import('eslint').
672679
}),
673680
]);
674681

682+
index.configs['flat/recommended-mixed'] = [
683+
{
684+
...index.configs['flat/recommended-typescript-flavor'],
685+
files: [
686+
'**/*.{js,jsx,cjs,mjs}',
687+
],
688+
},
689+
{
690+
...index.configs['flat/recommended-typescript'],
691+
files: [
692+
'**/*.{ts,tsx,cts,mts}',
693+
],
694+
},
695+
];
696+
675697
export default index;
676698

677699
/* eslint-disable jsdoc/valid-types -- Bug */

0 commit comments

Comments
 (0)