@@ -4,100 +4,98 @@ const reactPlugin = require("eslint-plugin-react");
4
4
const tsPlugin = require ( "@typescript-eslint/eslint-plugin" ) ;
5
5
const typescriptParser = require ( "@typescript-eslint/parser" ) ;
6
6
const prettierConfig = require ( "eslint-config-prettier" ) ;
7
+ const stylisticTs = require ( "@stylistic/eslint-plugin-ts" ) ;
7
8
8
9
/**
9
10
* @type {Array<import('eslint').Linter.Config> }
10
11
*/
11
- module . exports = [
12
- {
13
- ...reactHooksPlugin . configs . recommended ,
14
- ...reactPlugin . configs . flat . recommended ,
15
- ...prettierConfig ,
16
- settings : {
17
- react : {
18
- version : "detect" ,
19
- } ,
20
- } ,
21
- plugins : {
22
- jsdoc,
23
- "@typescript-eslint" : tsPlugin ,
24
- "react-hooks" : reactHooksPlugin ,
12
+ module . exports = {
13
+ name : "@grafana/eslint-config/flat" ,
14
+ ...reactHooksPlugin . configs . recommended ,
15
+ ...reactPlugin . configs . flat . recommended ,
16
+ ...prettierConfig ,
17
+ settings : {
18
+ react : {
19
+ version : "detect" ,
25
20
} ,
26
- languageOptions : {
27
- parser : typescriptParser ,
28
- ecmaVersion : 2019 ,
29
- sourceType : "module" ,
30
- parserOptions : {
31
- ecmaFeatures : {
32
- jsx : true ,
33
- } ,
21
+ } ,
22
+ plugins : {
23
+ jsdoc,
24
+ "@typescript-eslint" : tsPlugin ,
25
+ "react-hooks" : reactHooksPlugin ,
26
+ "@stylistic/ts" : stylisticTs ,
27
+ } ,
28
+ languageOptions : {
29
+ parser : typescriptParser ,
30
+ ecmaVersion : 2019 ,
31
+ sourceType : "module" ,
32
+ parserOptions : {
33
+ ecmaFeatures : {
34
+ jsx : true ,
34
35
} ,
35
36
} ,
36
- rules : {
37
- curly : "error" ,
38
- "dot-notation" : "off " ,
39
- "eol-last " : "error " ,
40
- eqeqeq : [ "error" , "always" , { null : "ignore" } ] ,
41
- "guard-for-in" : "off" ,
42
- "jsdoc/check-alignment " : "error " ,
43
- "new-parens " : "error" ,
44
- "no-array-constructor " : "error" ,
45
- "no-bitwise " : "off " ,
46
- "no-caller " : "error " ,
47
- "no-cond-assign " : "error" ,
48
- "no-console " : [ "error" , { allow : [ "error" , "log" , "warn" , "info" ] } ] ,
49
- "no-debugger " : "error" ,
50
- "no-empty " : "off " ,
51
- "no-eval " : "error " ,
52
- "no-fallthrough " : "off " ,
53
- "no-new-wrappers " : "error " ,
54
- "no-redeclare " : "error" ,
55
- "no-restricted-imports " : [ "error" , "moment" ] ,
56
- "no-shadow " : "off" ,
57
- "no-unused-expressions " : "off" ,
58
- "no-unused-labels " : "error " ,
59
- "no-var " : "error" ,
60
- radix : "error" ,
61
- "sort-keys" : "off " ,
62
- "spaced-comment " : [ "off" , "always" ] ,
63
- "use-isnan " : "error" ,
64
- "no-duplicate-imports " : "error" ,
65
- "@typescript-eslint/ no-unused-expressions " : [
66
- "error" ,
67
- { allowShortCircuit : true , allowTernary : true } ,
68
- ] ,
69
- "@typescript-eslint/array-type" : [ "error" , { default : "array-simple" } ] ,
70
- "@typescript-eslint/naming-convention " : [
71
- "error" ,
72
- {
73
- selector : "interface" ,
74
- format : [ "PascalCase" ] ,
75
- custom : {
76
- regex : "^I[A-Z]" ,
77
- match : false ,
78
- } ,
37
+ } ,
38
+ rules : {
39
+ curly : "error " ,
40
+ "dot-notation " : "off " ,
41
+ "eol-last" : "error" ,
42
+ eqeqeq : [ "error" , "always" , { null : "ignore" } ] ,
43
+ "guard-for-in " : "off " ,
44
+ "jsdoc/check-alignment " : "error" ,
45
+ "new-parens " : "error" ,
46
+ "no-array-constructor " : "error " ,
47
+ "no-bitwise " : "off " ,
48
+ "no-caller " : "error" ,
49
+ "no-cond-assign " : "error" ,
50
+ "no-console " : [ "error" , { allow : [ "error" , "log" , "warn" , "info" ] } ] ,
51
+ "no-debugger " : "error " ,
52
+ "no-empty " : "off " ,
53
+ "no-eval " : "error " ,
54
+ "no-fallthrough " : "off " ,
55
+ "no-new-wrappers " : "error" ,
56
+ "no-redeclare " : "error" ,
57
+ "no-restricted-imports " : [ "error" , "moment" ] ,
58
+ "no-shadow " : "off" ,
59
+ "no-unused-expressions " : "off " ,
60
+ "no-unused-labels " : "error" ,
61
+ "no-var" : "error" ,
62
+ radix : "error " ,
63
+ "sort-keys " : "off" ,
64
+ "spaced-comment " : [ "off" , "always" ] ,
65
+ "use-isnan " : "error" ,
66
+ " no-duplicate-imports " : "error" ,
67
+ "@typescript-eslint/no-unused-expressions" : [
68
+ "error" ,
69
+ { allowShortCircuit : true , allowTernary : true } ,
70
+ ] ,
71
+ "@typescript-eslint/array-type " : [ "error" , { default : "array-simple" } ] ,
72
+ "@typescript-eslint/naming-convention" : [
73
+ "error" ,
74
+ {
75
+ selector : "interface" ,
76
+ format : [ "PascalCase" ] ,
77
+ custom : {
78
+ regex : "^I[A-Z]" ,
79
+ match : false ,
79
80
} ,
80
- ] ,
81
- "@typescript-eslint/consistent-type-assertions" : "error" ,
82
- "@typescript-eslint/no-inferrable-types" : "error" ,
83
- "@typescript-eslint/no-namespace" : [
84
- "error" ,
85
- { allowDeclarations : false } ,
86
- ] ,
87
- "@typescript-eslint/no-unused-vars" : "off" ,
88
- "@typescript-eslint/no-use-before-define" : "off" ,
89
- "@typescript-eslint/triple-slash-reference" : "error" ,
90
- "@typescript-eslint/type-annotation-spacing" : [
91
- "error" ,
92
- {
93
- after : true ,
94
- before : false ,
95
- overrides : {
96
- arrow : { after : true , before : true } ,
97
- } ,
81
+ } ,
82
+ ] ,
83
+ "@typescript-eslint/consistent-type-assertions" : "error" ,
84
+ "@typescript-eslint/no-inferrable-types" : "error" ,
85
+ "@typescript-eslint/no-namespace" : [ "error" , { allowDeclarations : false } ] ,
86
+ "@typescript-eslint/no-unused-vars" : "off" ,
87
+ "@typescript-eslint/no-use-before-define" : "off" ,
88
+ "@typescript-eslint/triple-slash-reference" : "error" ,
89
+ "@stylistic/ts/type-annotation-spacing" : [
90
+ "error" ,
91
+ {
92
+ after : true ,
93
+ before : false ,
94
+ overrides : {
95
+ arrow : { after : true , before : true } ,
98
96
} ,
99
- ] ,
100
- "react-hooks/exhaustive-deps" : "error" ,
101
- } ,
97
+ } ,
98
+ ] ,
99
+ "react-hooks/exhaustive-deps" : "error" ,
102
100
} ,
103
- ] ;
101
+ } ;
0 commit comments