@@ -4,16 +4,16 @@ const OFF = 0;
4
4
const WARNING = 1 ;
5
5
const ERROR = 2 ;
6
6
7
- const commonReactNativePluginsConfig = {
8
- rules : {
9
- '@react-native/platform-colors' : WARNING ,
10
- 'react-native/no-unused-styles' : ERROR ,
11
- 'react-native/split-platform-components ' : OFF ,
12
- 'react-native/no-inline-styles ' : WARNING ,
13
- 'react-native/no-color-literals ' : WARNING ,
14
- 'react-native/no-raw-text ' : ERROR ,
15
- 'react-native-a11y/has-accessibility-hint ' : OFF ,
16
- } ,
7
+ const commonAtReactNativePluginRules = {
8
+ '@react-native/platform-colors' : WARNING ,
9
+ } ,
10
+ commonReactNativePluginRules = {
11
+ 'react-native/no-unused-styles ' : ERROR ,
12
+ 'react-native/split-platform-components ' : OFF ,
13
+ 'react-native/no-inline-styles ' : WARNING ,
14
+ 'react-native/no-color-literals ' : WARNING ,
15
+ 'react-native/no-raw-text ' : ERROR ,
16
+ 'react-native-a11y/has-accessibility-hint' : OFF ,
17
17
} ,
18
18
jsFilesCommonSettings = {
19
19
'import/extensions' : extensions . ALL ,
@@ -63,6 +63,10 @@ function createRNConfig(bFlatConfig) {
63
63
parserOptions : pluginA11y . configs . all . parserOptions ,
64
64
} ,
65
65
} ,
66
+ {
67
+ plugins : { '@react-native' : rnPluginEslint } ,
68
+ rules : commonAtReactNativePluginRules ,
69
+ } ,
66
70
{
67
71
languageOptions : {
68
72
// below globals listed manually - as in https://github.com/Intellicode/eslint-plugin-react-native/blob/master/index.js
@@ -73,9 +77,8 @@ function createRNConfig(bFlatConfig) {
73
77
} ,
74
78
plugins : {
75
79
'react-native' : fixupPluginRules ( eslintPluginReactNative ) ,
76
- '@react-native' : rnPluginEslint ,
77
80
} ,
78
- ... commonReactNativePluginsConfig ,
81
+ rules : commonReactNativePluginRules ,
79
82
} ,
80
83
// below two objects: ported 'overrides' from the above object
81
84
{
@@ -94,7 +97,10 @@ function createRNConfig(bFlatConfig) {
94
97
'react-native/react-native' : true ,
95
98
} ,
96
99
plugins : [ 'react-native' , '@react-native' ] ,
97
- ...commonReactNativePluginsConfig ,
100
+ rules : {
101
+ ...commonAtReactNativePluginRules ,
102
+ ...commonReactNativePluginRules ,
103
+ } ,
98
104
overrides : [
99
105
{
100
106
files : [ '*.js' , '*.jsx' ] ,
0 commit comments