Skip to content

Commit 1c7cd76

Browse files
committed
fix composable flat configs
1 parent 16c74ab commit 1c7cd76

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

flat.js

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @ts-check
12
const jsdoc = require("eslint-plugin-jsdoc");
23
const reactHooksPlugin = require("eslint-plugin-react-hooks");
34
const reactPlugin = require("eslint-plugin-react");
@@ -11,23 +12,24 @@ const baseConfig = require("./base");
1112
/**
1213
* @type {Array<import('eslint').Linter.Config>}
1314
*/
14-
module.exports = {
15-
name: "@grafana/eslint-config/flat",
16-
...reactHooksPlugin.configs.recommended,
17-
...reactPlugin.configs.flat.recommended,
18-
...prettierConfig,
19-
settings: baseConfig.settings,
20-
plugins: {
21-
jsdoc,
22-
"@typescript-eslint": tsPlugin,
23-
"react-hooks": reactHooksPlugin,
24-
"@stylistic/ts": stylisticTs,
15+
module.exports = [
16+
reactHooksPlugin.configs["recommended-latest"],
17+
reactPlugin.configs.flat.recommended,
18+
prettierConfig,
19+
{
20+
name: "@grafana/eslint-config/flat",
21+
settings: baseConfig.settings,
22+
plugins: {
23+
jsdoc,
24+
"@typescript-eslint": tsPlugin,
25+
"@stylistic/ts": stylisticTs,
26+
},
27+
languageOptions: {
28+
parser: typescriptParser,
29+
ecmaVersion: baseConfig.ecmaVersion,
30+
sourceType: baseConfig.sourceType,
31+
parserOptions: baseConfig.parserOptions,
32+
},
33+
rules: baseConfig.rules,
2534
},
26-
languageOptions: {
27-
parser: typescriptParser,
28-
ecmaVersion: baseConfig.ecmaVersion,
29-
sourceType: baseConfig.sourceType,
30-
parserOptions: baseConfig.parserOptions,
31-
},
32-
rules: baseConfig.rules,
33-
};
35+
];

0 commit comments

Comments
 (0)