@@ -64,63 +64,63 @@ module.exports = {
6464 * Temporarily disable some react rules for specific plugins, remove in separate PRs
6565 */
6666 {
67- files : [ 'packages/kbn-ui-framework/**/*.{js,ts,tsx}' ] ,
67+ files : [ 'packages/kbn-ui-framework/**/*.{js,mjs, ts,tsx}' ] ,
6868 rules : {
6969 'jsx-a11y/no-onchange' : 'off' ,
7070 } ,
7171 } ,
7272 {
73- files : [ 'src/plugins/es_ui_shared/**/*.{js,ts,tsx}' ] ,
73+ files : [ 'src/plugins/es_ui_shared/**/*.{js,mjs, ts,tsx}' ] ,
7474 rules : {
7575 'react-hooks/exhaustive-deps' : 'off' ,
7676 } ,
7777 } ,
7878 {
79- files : [ 'src/plugins/kibana_react/**/*.{js,ts,tsx}' ] ,
79+ files : [ 'src/plugins/kibana_react/**/*.{js,mjs, ts,tsx}' ] ,
8080 rules : {
8181 'react-hooks/rules-of-hooks' : 'off' ,
8282 'react-hooks/exhaustive-deps' : 'off' ,
8383 } ,
8484 } ,
8585 {
86- files : [ 'src/plugins/kibana_utils/**/*.{js,ts,tsx}' ] ,
86+ files : [ 'src/plugins/kibana_utils/**/*.{js,mjs, ts,tsx}' ] ,
8787 rules : {
8888 'react-hooks/exhaustive-deps' : 'off' ,
8989 } ,
9090 } ,
9191 {
92- files : [ 'x-pack/plugins/canvas/**/*.{js,ts,tsx}' ] ,
92+ files : [ 'x-pack/plugins/canvas/**/*.{js,mjs, ts,tsx}' ] ,
9393 rules : {
9494 'jsx-a11y/click-events-have-key-events' : 'off' ,
9595 } ,
9696 } ,
9797 {
98- files : [ 'x-pack/plugins/cross_cluster_replication/**/*.{js,ts,tsx}' ] ,
98+ files : [ 'x-pack/plugins/cross_cluster_replication/**/*.{js,mjs, ts,tsx}' ] ,
9999 rules : {
100100 'jsx-a11y/click-events-have-key-events' : 'off' ,
101101 } ,
102102 } ,
103103 {
104- files : [ 'x-pack/legacy/plugins/index_management/**/*.{js,ts,tsx}' ] ,
104+ files : [ 'x-pack/legacy/plugins/index_management/**/*.{js,mjs, ts,tsx}' ] ,
105105 rules : {
106106 'react-hooks/exhaustive-deps' : 'off' ,
107107 'react-hooks/rules-of-hooks' : 'off' ,
108108 } ,
109109 } ,
110110 {
111- files : [ 'x-pack/plugins/lens/**/*.{js,ts,tsx}' ] ,
111+ files : [ 'x-pack/plugins/lens/**/*.{js,mjs, ts,tsx}' ] ,
112112 rules : {
113113 'react-hooks/exhaustive-deps' : 'off' ,
114114 } ,
115115 } ,
116116 {
117- files : [ 'x-pack/plugins/ml/**/*.{js,ts,tsx}' ] ,
117+ files : [ 'x-pack/plugins/ml/**/*.{js,mjs, ts,tsx}' ] ,
118118 rules : {
119119 'react-hooks/exhaustive-deps' : 'off' ,
120120 } ,
121121 } ,
122122 {
123- files : [ 'x-pack/legacy/plugins/snapshot_restore/**/*.{js,ts,tsx}' ] ,
123+ files : [ 'x-pack/legacy/plugins/snapshot_restore/**/*.{js,mjs, ts,tsx}' ] ,
124124 rules : {
125125 'react-hooks/exhaustive-deps' : 'off' ,
126126 } ,
@@ -132,7 +132,7 @@ module.exports = {
132132 * Licence headers
133133 */
134134 {
135- files : [ '**/*.{js,ts,tsx}' , '!plugins/**/*' ] ,
135+ files : [ '**/*.{js,mjs, ts,tsx}' , '!plugins/**/*' ] ,
136136 rules : {
137137 '@kbn/eslint/require-license-header' : [
138138 'error' ,
@@ -153,7 +153,7 @@ module.exports = {
153153 * New Platform client-side
154154 */
155155 {
156- files : [ '{src,x-pack}/plugins/*/public/**/*.{js,ts,tsx}' ] ,
156+ files : [ '{src,x-pack}/plugins/*/public/**/*.{js,mjs, ts,tsx}' ] ,
157157 rules : {
158158 'import/no-commonjs' : 'error' ,
159159 } ,
@@ -163,7 +163,7 @@ module.exports = {
163163 * Files that require Elastic license headers instead of Apache 2.0 header
164164 */
165165 {
166- files : [ 'x-pack/**/*.{js,ts,tsx}' ] ,
166+ files : [ 'x-pack/**/*.{js,mjs, ts,tsx}' ] ,
167167 rules : {
168168 '@kbn/eslint/require-license-header' : [
169169 'error' ,
@@ -184,7 +184,7 @@ module.exports = {
184184 * Restricted paths
185185 */
186186 {
187- files : [ '**/*.{js,ts,tsx}' ] ,
187+ files : [ '**/*.{js,mjs, ts,tsx}' ] ,
188188 rules : {
189189 '@kbn/eslint/no-restricted-paths' : [
190190 'error' ,
@@ -251,8 +251,8 @@ module.exports = {
251251 ] ,
252252 from : [
253253 '(src|x-pack)/plugins/**/(public|server)/**/*' ,
254- '!(src|x-pack)/plugins/**/(public|server)/mocks/index.{js,ts}' ,
255- '!(src|x-pack)/plugins/**/(public|server)/(index|mocks).{js,ts,tsx}' ,
254+ '!(src|x-pack)/plugins/**/(public|server)/mocks/index.{js,mjs, ts}' ,
255+ '!(src|x-pack)/plugins/**/(public|server)/(index|mocks).{js,mjs, ts,tsx}' ,
256256 ] ,
257257 allowSameFolder : true ,
258258 errorMessage : 'Plugins may only import from top-level public and server modules.' ,
@@ -264,11 +264,11 @@ module.exports = {
264264
265265 'src/legacy/core_plugins/**/*' ,
266266 '!src/legacy/core_plugins/**/server/**/*' ,
267- '!src/legacy/core_plugins/**/index.{js,ts,tsx}' ,
267+ '!src/legacy/core_plugins/**/index.{js,mjs, ts,tsx}' ,
268268
269269 'x-pack/legacy/plugins/**/*' ,
270270 '!x-pack/legacy/plugins/**/server/**/*' ,
271- '!x-pack/legacy/plugins/**/index.{js,ts,tsx}' ,
271+ '!x-pack/legacy/plugins/**/index.{js,mjs, ts,tsx}' ,
272272
273273 'examples/**/*' ,
274274 '!examples/**/server/**/*' ,
@@ -334,6 +334,7 @@ module.exports = {
334334 */
335335 {
336336 files : [
337+ 'x-pack/test/apm_api_integration/**/*.ts' ,
337338 'x-pack/test/functional/apps/**/*.js' ,
338339 'x-pack/plugins/apm/**/*.js' ,
339340 'test/*/config.ts' ,
@@ -530,7 +531,7 @@ module.exports = {
530531 * Jest specific rules
531532 */
532533 {
533- files : [ '**/*.test.{js,ts,tsx}' ] ,
534+ files : [ '**/*.test.{js,mjs, ts,tsx}' ] ,
534535 rules : {
535536 'jest/valid-describe' : 'error' ,
536537 } ,
@@ -595,8 +596,8 @@ module.exports = {
595596 {
596597 // front end and common typescript and javascript files only
597598 files : [
598- 'x-pack/plugins/security_solution/public/**/*.{js,ts,tsx}' ,
599- 'x-pack/plugins/security_solution/common/**/*.{js,ts,tsx}' ,
599+ 'x-pack/plugins/security_solution/public/**/*.{js,mjs, ts,tsx}' ,
600+ 'x-pack/plugins/security_solution/common/**/*.{js,mjs, ts,tsx}' ,
600601 ] ,
601602 rules : {
602603 'import/no-nodejs-modules' : 'error' ,
@@ -646,7 +647,7 @@ module.exports = {
646647 // {
647648 // // will introduced after the other warns are fixed
648649 // // typescript and javascript for front end react performance
649- // files: ['x-pack/plugins/security_solution/public/**/!(*.test).{js,ts,tsx}'],
650+ // files: ['x-pack/plugins/security_solution/public/**/!(*.test).{js,mjs, ts,tsx}'],
650651 // plugins: ['react-perf'],
651652 // rules: {
652653 // // 'react-perf/jsx-no-new-object-as-prop': 'error',
@@ -657,7 +658,7 @@ module.exports = {
657658 // },
658659 {
659660 // typescript and javascript for front and back end
660- files : [ 'x-pack/{,legacy/}plugins/security_solution/**/*.{js,ts,tsx}' ] ,
661+ files : [ 'x-pack/{,legacy/}plugins/security_solution/**/*.{js,mjs, ts,tsx}' ] ,
661662 plugins : [ 'eslint-plugin-node' , 'react' ] ,
662663 env : {
663664 mocha : true ,
@@ -776,8 +777,8 @@ module.exports = {
776777 {
777778 // front end and common typescript and javascript files only
778779 files : [
779- 'x-pack/plugins/lists/public/**/*.{js,ts,tsx}' ,
780- 'x-pack/plugins/lists/common/**/*.{js,ts,tsx}' ,
780+ 'x-pack/plugins/lists/public/**/*.{js,mjs, ts,tsx}' ,
781+ 'x-pack/plugins/lists/common/**/*.{js,mjs, ts,tsx}' ,
781782 ] ,
782783 rules : {
783784 'import/no-nodejs-modules' : 'error' ,
@@ -792,7 +793,7 @@ module.exports = {
792793 } ,
793794 {
794795 // typescript and javascript for front and back end
795- files : [ 'x-pack/plugins/lists/**/*.{js,ts,tsx}' ] ,
796+ files : [ 'x-pack/plugins/lists/**/*.{js,mjs, ts,tsx}' ] ,
796797 plugins : [ 'eslint-plugin-node' ] ,
797798 env : {
798799 mocha : true ,
@@ -888,7 +889,7 @@ module.exports = {
888889 {
889890 // typescript only for front and back end
890891 files : [
891- 'x-pack/{,legacy/}plugins/{alerting ,alerting_builtins,actions,task_manager,event_log}/**/*.{ts,tsx}' ,
892+ 'x-pack/{,legacy/}plugins/{alerts ,alerting_builtins,actions,task_manager,event_log}/**/*.{ts,tsx}' ,
892893 ] ,
893894 rules : {
894895 '@typescript-eslint/no-explicit-any' : 'error' ,
@@ -1020,8 +1021,8 @@ module.exports = {
10201021 */
10211022 {
10221023 files : [
1023- 'src/plugins/vis_type_timeseries/**/*.{js,ts,tsx}' ,
1024- 'src/legacy/core_plugins/vis_type_timeseries/**/*.{js,ts,tsx}' ,
1024+ 'src/plugins/vis_type_timeseries/**/*.{js,mjs, ts,tsx}' ,
1025+ 'src/legacy/core_plugins/vis_type_timeseries/**/*.{js,mjs, ts,tsx}' ,
10251026 ] ,
10261027 rules : {
10271028 'import/no-default-export' : 'error' ,
@@ -1039,5 +1040,22 @@ module.exports = {
10391040 ...require ( 'eslint-config-prettier/@typescript-eslint' ) . rules ,
10401041 } ,
10411042 } ,
1043+
1044+ {
1045+ files : [
1046+ // platform-team owned code
1047+ 'src/core/**' ,
1048+ 'x-pack/plugins/features/**' ,
1049+ 'x-pack/plugins/licensing/**' ,
1050+ 'x-pack/plugins/global_search/**' ,
1051+ 'x-pack/plugins/cloud/**' ,
1052+ 'packages/kbn-config-schema' ,
1053+ 'src/plugins/status_page/**' ,
1054+ 'src/plugins/saved_objects_management/**' ,
1055+ ] ,
1056+ rules : {
1057+ '@typescript-eslint/prefer-ts-expect-error' : 'error' ,
1058+ } ,
1059+ } ,
10421060 ] ,
10431061} ;
0 commit comments