@tommy-mitchell/eslint-config-xo 1.0.0-3 → 1.0.0-4
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/package.json +1 -1
- package/src/dprint.js +6 -4
- package/src/react.js +7 -1
package/package.json
CHANGED
package/src/dprint.js
CHANGED
|
@@ -9,14 +9,16 @@ const allowedReactRules = new Set([
|
|
|
9
9
|
]);
|
|
10
10
|
|
|
11
11
|
const disabledLegacyRules = Object.fromEntries(
|
|
12
|
-
Object.
|
|
13
|
-
.filter(rule => !allowedReactRules.has(
|
|
14
|
-
.map(rule => [rule, "off"]),
|
|
12
|
+
Object.entries(stylistic.configs["disable-legacy"].rules)
|
|
13
|
+
.filter(([rule]) => !allowedReactRules.has(rule.replace("react/", ""))),
|
|
15
14
|
);
|
|
16
15
|
|
|
17
|
-
// TODO: eslint unicorn rule proposal
|
|
18
16
|
const allowedRules = new Set([
|
|
17
|
+
// "multiline-ternary",
|
|
18
|
+
"no-floating-decimal",
|
|
19
|
+
"no-mixed-operators",
|
|
19
20
|
"padding-line-between-statements",
|
|
21
|
+
"wrap-iife",
|
|
20
22
|
...allowedReactRules,
|
|
21
23
|
]);
|
|
22
24
|
|
package/src/react.js
CHANGED
|
@@ -8,13 +8,19 @@ const configs = [
|
|
|
8
8
|
jsxA11y.flatConfigs.recommended,
|
|
9
9
|
];
|
|
10
10
|
|
|
11
|
-
export default [...configs, {
|
|
11
|
+
export default [{ react: true }, ...configs, {
|
|
12
12
|
plugins: {
|
|
13
13
|
"react-refresh": reactRefresh,
|
|
14
14
|
"sort-react-dependency-arrays": sortReactDependencyArrays,
|
|
15
15
|
},
|
|
16
16
|
rules: {
|
|
17
17
|
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
|
|
18
|
+
"react/jsx-sort-props": ["error", {
|
|
19
|
+
callbacksLast: true,
|
|
20
|
+
noSortAlphabetically: false,
|
|
21
|
+
reservedFirst: true,
|
|
22
|
+
shorthandFirst: true,
|
|
23
|
+
}],
|
|
18
24
|
"react/no-array-index-key": "warn",
|
|
19
25
|
"simple-import-sort/imports": ["error", {
|
|
20
26
|
groups: [[
|