8
8
//-----------------------------------------------------------------------------
9
9
10
10
import eslintConfigESLint from "eslint-config-eslint" ;
11
+ import eslintPlugin from "eslint-plugin-eslint-plugin" ;
11
12
import json from "@eslint/json" ;
12
13
13
14
//-----------------------------------------------------------------------------
@@ -18,6 +19,11 @@ const eslintPluginJSDoc = eslintConfigESLint.find(
18
19
config => config . plugins ?. jsdoc ,
19
20
) . plugins . jsdoc ;
20
21
22
+ const eslintPluginRulesRecommendedConfig =
23
+ eslintPlugin . configs [ "flat/rules-recommended" ] ;
24
+ const eslintPluginTestsRecommendedConfig =
25
+ eslintPlugin . configs [ "flat/tests-recommended" ] ;
26
+
21
27
//-----------------------------------------------------------------------------
22
28
// Configuration
23
29
//-----------------------------------------------------------------------------
@@ -68,4 +74,40 @@ export default [
68
74
} ,
69
75
} ,
70
76
} ,
77
+ {
78
+ files : [ "src/rules/*.js" ] ,
79
+ ...eslintPluginRulesRecommendedConfig ,
80
+ rules : {
81
+ ...eslintPluginRulesRecommendedConfig . rules ,
82
+ "eslint-plugin/require-meta-schema" : "off" , // `schema` defaults to []
83
+ "eslint-plugin/prefer-placeholders" : "error" ,
84
+ "eslint-plugin/prefer-replace-text" : "error" ,
85
+ "eslint-plugin/report-message-format" : [ "error" , "[^a-z].*\\.$" ] ,
86
+ "eslint-plugin/require-meta-docs-description" : [
87
+ "error" ,
88
+ { pattern : "^(Enforce|Require|Disallow) .+[^. ]$" } ,
89
+ ] ,
90
+ } ,
91
+ } ,
92
+ {
93
+ files : [ "tests/rules/*.test.js" ] ,
94
+ ...eslintPluginTestsRecommendedConfig ,
95
+ rules : {
96
+ ...eslintPluginTestsRecommendedConfig . rules ,
97
+ "eslint-plugin/test-case-property-ordering" : [
98
+ "error" ,
99
+ [
100
+ "name" ,
101
+ "filename" ,
102
+ "code" ,
103
+ "output" ,
104
+ "language" ,
105
+ "options" ,
106
+ "languageOptions" ,
107
+ "errors" ,
108
+ ] ,
109
+ ] ,
110
+ "eslint-plugin/test-case-shorthand-strings" : "error" ,
111
+ } ,
112
+ } ,
71
113
] ;
0 commit comments