@keeex/eslint-config 2.1.1 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -31
- package/package.json +4 -13
- package/src/config/base.js +1 -0
- package/src/config/globals.js +1 -1
- package/src/config/importx.js +15 -4
- package/src/config/lazy.js +0 -1
- package/src/config/react/reacthooks.js +6 -1
- package/src/config/reactfullconfig.js +1 -6
- package/src/defaults.js +3 -1
- package/src/dependencies.js +2 -2
- package/src/environ.js +9 -0
- package/src/index.js +6 -4
- package/src/config/react/reactnative.js +0 -22
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Common eslint configuration for KeeeX
|
|
2
2
|
|
|
3
3
|
## Description
|
|
4
|
+
|
|
4
5
|
Manage the eslint and prettier configuration used through all KeeeX projects.
|
|
5
6
|
|
|
6
7
|
### tl;dr
|
|
@@ -12,6 +13,7 @@ Manage the eslint and prettier configuration used through all KeeeX projects.
|
|
|
12
13
|
- enable eslint and prettier in whatever you use
|
|
13
14
|
|
|
14
15
|
## Installation
|
|
16
|
+
|
|
15
17
|
The package is available on npmjs and can be installed with any package manager that supports it.
|
|
16
18
|
|
|
17
19
|
```bash
|
|
@@ -19,9 +21,9 @@ npm install -D @keeex/eslint-config
|
|
|
19
21
|
```
|
|
20
22
|
|
|
21
23
|
## Usage
|
|
24
|
+
|
|
22
25
|
To prepare the configuration file, you can run `npx kxeslint-setup` to create a blank config file.
|
|
23
|
-
Alternatively, you can create the file yourself.
|
|
24
|
-
In both cases, it will be named `eslint.config.js`.
|
|
26
|
+
Alternatively, you can create the file yourself. In both cases, it will be named `eslint.config.js`.
|
|
25
27
|
|
|
26
28
|
Here is all the available options with their default values:
|
|
27
29
|
|
|
@@ -29,6 +31,7 @@ Here is all the available options with their default values:
|
|
|
29
31
|
import eslintConfig from "@keeex/eslint-config";
|
|
30
32
|
|
|
31
33
|
export default await eslintConfig({
|
|
34
|
+
full: false,
|
|
32
35
|
globals: [
|
|
33
36
|
{globals: {builtin: true, es2025: true}},
|
|
34
37
|
{
|
|
@@ -56,21 +59,27 @@ export default await eslintConfig({
|
|
|
56
59
|
import: 3,
|
|
57
60
|
mocha: true,
|
|
58
61
|
noBase: false,
|
|
59
|
-
react:
|
|
62
|
+
react: false,
|
|
60
63
|
typescript: true,
|
|
61
64
|
});
|
|
62
65
|
```
|
|
63
66
|
|
|
64
|
-
If any of the top-level property is not defined, it will be set to its default value.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
Good luck with that.
|
|
67
|
+
If any of the top-level property is not defined, it will be set to its default value. If you want to
|
|
68
|
+
customize the output, instead of directly exporting the return value of the function you can edit it
|
|
69
|
+
by hand. Good luck with that.
|
|
68
70
|
|
|
69
71
|
## Configuration
|
|
70
72
|
|
|
73
|
+
### `full`
|
|
74
|
+
|
|
75
|
+
Enable some deeper, more costly checks. This is enabled automatically if the environment variable
|
|
76
|
+
"KXESLINT" is set to "full", or if "GIT_HOOK_NAME" is set to "pre-push". You can enable it manually
|
|
77
|
+
by passing `full: true` to the eslint config function.
|
|
78
|
+
|
|
71
79
|
### `globals`
|
|
72
|
-
|
|
73
|
-
|
|
80
|
+
|
|
81
|
+
The `globals` property is an array of object to define which globals are available in the code. Each
|
|
82
|
+
of these objects can have two properties: `files`, which is an array of globs to match the files to
|
|
74
83
|
be considered, and `globals`, which is an object that can have the following properties:
|
|
75
84
|
|
|
76
85
|
- "builtin": generic JS built-in globals
|
|
@@ -86,43 +95,46 @@ be considered, and `globals`, which is an object that can have the following pro
|
|
|
86
95
|
the values are boolean indicating if these identifiers are read-only (false) or not (true)
|
|
87
96
|
|
|
88
97
|
### `ignores`
|
|
98
|
+
|
|
89
99
|
Array of globs to globally ignore for eslint.
|
|
90
100
|
|
|
91
101
|
### `import`
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
It is possible to pass a number instead of a boolean to
|
|
95
|
-
This greatly improves performances, at the risk of
|
|
102
|
+
|
|
103
|
+
Some extra rules for formatting and ordering imports can be used by setting `import` to true
|
|
104
|
+
(enabled by default with a depth of 3). It is possible to pass a number instead of a boolean to
|
|
105
|
+
limit the depth of circular imports check. This greatly improves performances, at the risk of
|
|
106
|
+
missing a dependency cycle.
|
|
96
107
|
|
|
97
108
|
### `mocha`
|
|
98
|
-
|
|
99
|
-
testing, set `mocha` to
|
|
109
|
+
|
|
110
|
+
To enable mocha-specific rules, as well as loosen some regular rules for testing, set `mocha` to
|
|
111
|
+
true.
|
|
100
112
|
|
|
101
113
|
### `noBase`
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
There is absolutely no reason to do so.
|
|
114
|
+
|
|
115
|
+
The base configuration imports all eslint recommendeds rules and promises handling rules. Setting
|
|
116
|
+
`noBase` to true removes that. There is absolutely no reason to do so.
|
|
105
117
|
|
|
106
118
|
### `react`
|
|
107
|
-
To improve handling of React/JSX, set `react` to true.
|
|
108
|
-
You can also pass an object with the following boolean properties:
|
|
109
119
|
|
|
110
|
-
|
|
120
|
+
To improve handling of React/JSX, set `react` to true. You can also pass an object with the
|
|
121
|
+
following boolean properties:
|
|
122
|
+
|
|
111
123
|
- `reactHooks`: enable/disable React hooks rules
|
|
112
|
-
- `reactNative`: enable/disable React Native rules
|
|
113
124
|
|
|
114
|
-
You can't enable the hooks
|
|
125
|
+
You can't enable the hooks rules without enabling React, so if an object is provided React support
|
|
126
|
+
is automatically enabled.
|
|
115
127
|
|
|
116
128
|
### `typescript`
|
|
117
|
-
|
|
118
|
-
This includes tsdoc rules.
|
|
129
|
+
|
|
130
|
+
Set to `true` (the default value) to enable all TypeScript rules. This includes tsdoc rules.
|
|
119
131
|
|
|
120
132
|
## Dependencies
|
|
133
|
+
|
|
121
134
|
This configuration depends on various packages to be available depending on the user settings for
|
|
122
|
-
each individual projects.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
You can also automatically install missing dependencies by adding the "auto" flag to the command.
|
|
135
|
+
each individual projects. You can list the required dependencies for the current configuration by
|
|
136
|
+
running `npx kxeslint-setup`. You can also automatically install missing dependencies by adding the
|
|
137
|
+
"auto" flag to the command.
|
|
126
138
|
|
|
127
139
|
All dependencies are set as peer dependencies, as they are almost all optional depending on local
|
|
128
140
|
settings.
|
|
@@ -130,10 +142,12 @@ settings.
|
|
|
130
142
|
The tool will also uninstall older dependencies that we used to have but are not used anymore.
|
|
131
143
|
|
|
132
144
|
## Migration from .eslintrc.cjs
|
|
145
|
+
|
|
133
146
|
When running `npx kxeslint-setup`, the tool will automatically detect an existing `.eslintrc.cjs`
|
|
134
|
-
file and provides instructions for the migration.
|
|
135
|
-
|
|
147
|
+
file and provides instructions for the migration. The migration process is manual; you have to
|
|
148
|
+
update the new `eslint.config.js` file by hand.
|
|
136
149
|
|
|
137
150
|
## Debugging config issues
|
|
151
|
+
|
|
138
152
|
Running `npx eslint --inspect-config` will launch a debugger interface that allows checking all the
|
|
139
153
|
rules and individual file rules.
|
package/package.json
CHANGED
|
@@ -17,15 +17,14 @@
|
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@eslint/compat": "^1.2.1",
|
|
19
19
|
"@eslint/js": "^9.12.0",
|
|
20
|
-
"eslint": "9.
|
|
20
|
+
"eslint": "^9.13.0",
|
|
21
21
|
"eslint-import-resolver-typescript": "^3.6.3",
|
|
22
22
|
"eslint-import-resolver-webpack": "^0.13.9",
|
|
23
23
|
"eslint-plugin-import-x": "^4.3.1",
|
|
24
24
|
"eslint-plugin-mocha": "^10.5.0",
|
|
25
25
|
"eslint-plugin-promise": "^7.1.0",
|
|
26
|
-
"eslint-plugin-react": "^7.37.
|
|
27
|
-
"eslint-plugin-react-hooks": "^5.
|
|
28
|
-
"eslint-plugin-react-native": "^4.1.0",
|
|
26
|
+
"eslint-plugin-react": "^7.37.2",
|
|
27
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
29
28
|
"eslint-plugin-tsdoc": "^0.3.0",
|
|
30
29
|
"globals": "^15.11.0",
|
|
31
30
|
"prettier": "^3.3.3",
|
|
@@ -38,10 +37,6 @@
|
|
|
38
37
|
"license": "MIT",
|
|
39
38
|
"main": "src/index.js",
|
|
40
39
|
"name": "@keeex/eslint-config",
|
|
41
|
-
"overrides": {
|
|
42
|
-
"eslint": "9.x",
|
|
43
|
-
"eslint-plugin-react-native": "^4.1.0"
|
|
44
|
-
},
|
|
45
40
|
"peerDependencies": {
|
|
46
41
|
"@eslint/compat": "^1.2.0",
|
|
47
42
|
"@eslint/js": "9.x",
|
|
@@ -53,7 +48,6 @@
|
|
|
53
48
|
"eslint-plugin-promise": "7.x",
|
|
54
49
|
"eslint-plugin-react": "7.x",
|
|
55
50
|
"eslint-plugin-react-hooks": "5.x",
|
|
56
|
-
"eslint-plugin-react-native": "4.x",
|
|
57
51
|
"eslint-plugin-tsdoc": "0.x",
|
|
58
52
|
"globals": "15.x",
|
|
59
53
|
"prettier": "3.x",
|
|
@@ -90,9 +84,6 @@
|
|
|
90
84
|
"eslint-plugin-react-hooks": {
|
|
91
85
|
"optional": true
|
|
92
86
|
},
|
|
93
|
-
"eslint-plugin-react-native": {
|
|
94
|
-
"optional": true
|
|
95
|
-
},
|
|
96
87
|
"eslint-plugin-tsdoc": {
|
|
97
88
|
"optional": true
|
|
98
89
|
},
|
|
@@ -121,5 +112,5 @@
|
|
|
121
112
|
"test": "echo No test for this project"
|
|
122
113
|
},
|
|
123
114
|
"type": "module",
|
|
124
|
-
"version": "2.1.
|
|
115
|
+
"version": "2.1.3"
|
|
125
116
|
}
|
package/src/config/base.js
CHANGED
|
@@ -63,6 +63,7 @@ export const apply = (configResult, eslintConfig) => {
|
|
|
63
63
|
"no-div-regex": "warn",
|
|
64
64
|
"no-duplicate-imports": "error",
|
|
65
65
|
"no-else-return": "warn",
|
|
66
|
+
"no-empty": ["error", {allowEmptyCatch: true}],
|
|
66
67
|
"no-eq-null": "error",
|
|
67
68
|
"no-eval": "error",
|
|
68
69
|
"no-extend-native": "error",
|
package/src/config/globals.js
CHANGED
|
@@ -21,7 +21,7 @@ const getGlobalsFromConfig = (configGlobals) => {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export const apply = (configResult, eslintConfig) => {
|
|
24
|
-
const sharedGlobals = eslintConfig.globals.find((c) => c.files === undefined);
|
|
24
|
+
const sharedGlobals = eslintConfig.globals.find((c) => c.files === undefined) ?? {globals: {}};
|
|
25
25
|
const sharedSection = sections.getNamedSection(configResult, "keeex/shared");
|
|
26
26
|
sections.sectionAddOption(
|
|
27
27
|
sharedSection,
|
package/src/config/importx.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import eslintPluginImportX from "eslint-plugin-import-x";
|
|
2
2
|
|
|
3
|
+
import {isFullCheck} from "../environ.js";
|
|
3
4
|
import * as sections from "../sections.js";
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -66,18 +67,28 @@ export const apply = (configResult, eslintConfig) => {
|
|
|
66
67
|
sections.configureRules(override, "import-x", {"no-cycle": "error"});
|
|
67
68
|
}
|
|
68
69
|
if (eslintConfig.typescript) {
|
|
69
|
-
sections.
|
|
70
|
+
const tsOverride = sections.getNamedSection(configResult, "keeex/importx-override-typescript");
|
|
71
|
+
sections.configureRules(tsOverride, "import-x", {
|
|
72
|
+
"default": "off",
|
|
73
|
+
"namespace": "off",
|
|
70
74
|
"no-extraneous-dependencies": ["error", {includeTypes: true}],
|
|
75
|
+
"no-named-as-default-member": "off",
|
|
76
|
+
"no-unresolved": "off",
|
|
71
77
|
});
|
|
78
|
+
if (!isFullCheck()) {
|
|
79
|
+
sections.configureRules(tsOverride, "import-x", {
|
|
80
|
+
"no-named-as-default": "off",
|
|
81
|
+
});
|
|
82
|
+
}
|
|
72
83
|
if (eslintConfig.react) {
|
|
73
|
-
sections.sectionAddOption(
|
|
84
|
+
sections.sectionAddOption(tsOverride, "settings", "import-x/extensions", [".ts", ".tsx"]);
|
|
74
85
|
} else {
|
|
75
|
-
sections.sectionAddOption(
|
|
86
|
+
sections.sectionAddOption(tsOverride, "settings", "import-x/extensions", [".ts"]);
|
|
76
87
|
}
|
|
77
88
|
} else {
|
|
78
89
|
sections.configureRules(override, "import-x", {
|
|
79
90
|
"extensions": ["error", "ignorePackages"],
|
|
80
|
-
"no-deprecated": "warn",
|
|
91
|
+
"no-deprecated": isFullCheck() ? "warn" : "off",
|
|
81
92
|
"no-extraneous-dependencies": "error",
|
|
82
93
|
});
|
|
83
94
|
if (eslintConfig.react) {
|
package/src/config/lazy.js
CHANGED
|
@@ -4,5 +4,4 @@ export const importx = () => import("./importx.js");
|
|
|
4
4
|
export const mocha = () => import("./mocha.js");
|
|
5
5
|
export const react = () => import("./react.js");
|
|
6
6
|
export const reactHooks = () => import("./react/reacthooks.js");
|
|
7
|
-
export const reactNative = () => import("./react/reactnative.js");
|
|
8
7
|
export const typescript = () => import("./typescript.js");
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {fixupPluginRules} from "@eslint/compat";
|
|
1
2
|
import eslintPluginReactHooks from "eslint-plugin-react-hooks";
|
|
2
3
|
|
|
3
4
|
import {getReactFullConfig} from "../reactfullconfig.js";
|
|
@@ -6,8 +7,12 @@ export const apply = (configResult, eslintConfig) => {
|
|
|
6
7
|
const reactCfg = getReactFullConfig(eslintConfig.react);
|
|
7
8
|
if (!reactCfg.reactHooks) return;
|
|
8
9
|
configResult.push({
|
|
9
|
-
...eslintPluginReactHooks.configs.recommended,
|
|
10
10
|
files: ["src/webapp/**/*.js", "**/*.jsx", "**/*.tsx"],
|
|
11
11
|
name: "react-hooks/recommended",
|
|
12
|
+
plugins: {"react-hooks": fixupPluginRules(eslintPluginReactHooks)},
|
|
13
|
+
rules: {
|
|
14
|
+
"react-hooks/rules-of-hooks": "error",
|
|
15
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
16
|
+
},
|
|
12
17
|
});
|
|
13
18
|
};
|
|
@@ -5,14 +5,9 @@ export const getReactFullConfig = (configEntry) => {
|
|
|
5
5
|
return {react: false, reactHooks: false, reactNative: false};
|
|
6
6
|
}
|
|
7
7
|
const cfg = {
|
|
8
|
-
react:
|
|
8
|
+
react: true,
|
|
9
9
|
reactHooks: configEntry?.reactHooks ?? false,
|
|
10
10
|
reactNative: configEntry?.reactNative ?? false,
|
|
11
11
|
};
|
|
12
|
-
if (!cfg.react && (cfg.reactHooks || cfg.reactNative)) {
|
|
13
|
-
throw new Error(
|
|
14
|
-
"Invalid react config; react must be enabled for react-native and react-hooks to be enabled too.",
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
12
|
return cfg;
|
|
18
13
|
};
|
package/src/defaults.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {isFullCheck} from "./environ.js";
|
|
2
|
+
|
|
1
3
|
/** List of ignored patterns by default */
|
|
2
4
|
export const ignores = ["lib", "web", "gen", "src/gen"];
|
|
3
5
|
|
|
@@ -35,4 +37,4 @@ export const globals = [
|
|
|
35
37
|
];
|
|
36
38
|
|
|
37
39
|
/** Import cycle max depth */
|
|
38
|
-
export const cycleMaxDepth =
|
|
40
|
+
export const cycleMaxDepth = isFullCheck() ? true : 0;
|
package/src/dependencies.js
CHANGED
|
@@ -18,6 +18,7 @@ const removedDependencies = [
|
|
|
18
18
|
"eslint-plugin-deprecation",
|
|
19
19
|
"eslint-plugin-i",
|
|
20
20
|
"eslint-plugin-import",
|
|
21
|
+
"eslint-plugin-react-native",
|
|
21
22
|
];
|
|
22
23
|
|
|
23
24
|
let pkgJson;
|
|
@@ -166,7 +167,7 @@ export const configToDependencies = (eslintConfig) => {
|
|
|
166
167
|
addDependency("eslint", "9.x");
|
|
167
168
|
addDependency("prettier", "3.x");
|
|
168
169
|
if (eslintConfig.globals) addDependency("globals", "15.x");
|
|
169
|
-
if (eslintConfig.import) {
|
|
170
|
+
if (eslintConfig.import !== false) {
|
|
170
171
|
addDependency("eslint-plugin-import-x", "4.x");
|
|
171
172
|
if (eslintConfig.typescript) addDependency("eslint-import-resolver-typescript", "3.x");
|
|
172
173
|
}
|
|
@@ -187,7 +188,6 @@ export const configToDependencies = (eslintConfig) => {
|
|
|
187
188
|
}
|
|
188
189
|
if (eslintConfig.typescript) {
|
|
189
190
|
addDependency("typescript-eslint", "8.x");
|
|
190
|
-
addDependency("@typescript-eslint/parser", "8.x");
|
|
191
191
|
addDependency("eslint-plugin-tsdoc", "0.x");
|
|
192
192
|
}
|
|
193
193
|
};
|
package/src/environ.js
CHANGED
|
@@ -5,3 +5,12 @@ export const setDepCheck = () => {
|
|
|
5
5
|
|
|
6
6
|
/** Check the depcheck flag */
|
|
7
7
|
export const isDepCheck = () => process.env.KEEEX_DEPCHECK === "true";
|
|
8
|
+
|
|
9
|
+
/** Enable the full check */
|
|
10
|
+
export const setFullCheck = () => {
|
|
11
|
+
process.env.KXESLINT = "full";
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** Check deeper checks flag */
|
|
15
|
+
export const isFullCheck = () =>
|
|
16
|
+
process.env.KXESLINT === "full" || process.env.GIT_HOOK_NAME === "pre-push";
|
package/src/index.js
CHANGED
|
@@ -3,11 +3,12 @@ import {getReactFullConfig} from "./config/reactfullconfig.js";
|
|
|
3
3
|
import * as defaults from "./defaults.js";
|
|
4
4
|
|
|
5
5
|
import {configToDependencies} from "./dependencies.js";
|
|
6
|
-
import
|
|
6
|
+
import * as environ from "./environ.js";
|
|
7
7
|
import {clearConfig} from "./sections.js";
|
|
8
8
|
|
|
9
9
|
/** Setup all defaults in the eslintParams config */
|
|
10
10
|
const configDefaults = (eslintParams) => ({
|
|
11
|
+
full: eslintParams?.full ?? false,
|
|
11
12
|
globals: eslintParams?.globals ?? defaults.globals,
|
|
12
13
|
ignores: eslintParams?.ignores ?? defaults.ignores,
|
|
13
14
|
import: eslintParams?.import ?? defaults.cycleMaxDepth,
|
|
@@ -43,17 +44,19 @@ const configDefaults = (eslintParams) => ({
|
|
|
43
44
|
*
|
|
44
45
|
* @param [eslintParams.react] {object|false} - If trueish, enable React support.
|
|
45
46
|
* @param [eslintParams.react.reactHooks] {boolean} - Enable react-hooks stuff.
|
|
46
|
-
* @param [eslintParams.react.reactNative] {boolean} - Enable react-native stuff.
|
|
47
47
|
*
|
|
48
48
|
* @param [eslintParams.mocha] {boolean} - Enable mocha plugins
|
|
49
49
|
*
|
|
50
|
+
* @param [eslintParams.full] {boolean} - Enable full check mode
|
|
51
|
+
*
|
|
50
52
|
* @returns
|
|
51
53
|
* The eslint config object
|
|
52
54
|
*/
|
|
53
55
|
const eslintConfig = async (eslintParams) => {
|
|
54
56
|
const fullConfig = configDefaults(eslintParams);
|
|
55
57
|
const res = [];
|
|
56
|
-
if (
|
|
58
|
+
if (fullConfig.full) environ.setFullCheck();
|
|
59
|
+
if (environ.isDepCheck()) {
|
|
57
60
|
configToDependencies(fullConfig);
|
|
58
61
|
} else {
|
|
59
62
|
if (!fullConfig.noBase) (await lazy.base()).apply(res, fullConfig);
|
|
@@ -62,7 +65,6 @@ const eslintConfig = async (eslintParams) => {
|
|
|
62
65
|
if (fullConfig.import !== false) (await lazy.importx()).apply(res, fullConfig);
|
|
63
66
|
const reactCfg = getReactFullConfig(fullConfig.react);
|
|
64
67
|
if (reactCfg.react) (await lazy.react()).apply(res, fullConfig);
|
|
65
|
-
if (reactCfg.reactNative) (await lazy.reactNative()).apply(res, fullConfig);
|
|
66
68
|
if (reactCfg.reactHooks) (await lazy.reactHooks()).apply(res, fullConfig);
|
|
67
69
|
if (fullConfig.mocha) (await lazy.mocha()).apply(res, fullConfig);
|
|
68
70
|
clearConfig(res);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {fixupPluginRules} from "@eslint/compat";
|
|
2
|
-
|
|
3
|
-
import reactNative from "eslint-plugin-react-native";
|
|
4
|
-
|
|
5
|
-
import * as sections from "../../sections.js";
|
|
6
|
-
import {getReactFullConfig} from "../reactfullconfig.js";
|
|
7
|
-
|
|
8
|
-
export const apply = (configResult, eslintConfig) => {
|
|
9
|
-
const reactCfg = getReactFullConfig(eslintConfig.react);
|
|
10
|
-
if (!reactCfg.reactNative) return;
|
|
11
|
-
const reactNativeSection = sections.getNamedSection(configResult, "keeex/react-native");
|
|
12
|
-
reactNativeSection.plugins = {"react-native": fixupPluginRules(reactNative)};
|
|
13
|
-
sections.configureRules(reactNativeSection, "react-native", {
|
|
14
|
-
"no-color-literals": "warn",
|
|
15
|
-
"no-inline-styles": "warn",
|
|
16
|
-
"no-raw-text": "error",
|
|
17
|
-
"no-single-element-style-arrays": "error",
|
|
18
|
-
"no-unused-styles": "warn",
|
|
19
|
-
"sort-styles": "warn",
|
|
20
|
-
"split-platform-components": "warn",
|
|
21
|
-
});
|
|
22
|
-
};
|