@tommy-mitchell/eslint-config-xo 1.0.0-2 → 1.0.0-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tommy-mitchell/eslint-config-xo",
3
- "version": "1.0.0-2",
3
+ "version": "1.0.0-3",
4
4
  "description": "Personal config for XO.",
5
5
  "keywords": [
6
6
  "nodejs",
package/src/dprint.js CHANGED
@@ -1,7 +1,25 @@
1
1
  import stylistic from "@stylistic/eslint-plugin";
2
2
 
3
+ const allowedReactRules = new Set([
4
+ "jsx-curly-brace-presence",
5
+ "jsx-newline",
6
+ "jsx-pascal-case",
7
+ "jsx-self-closing-comp",
8
+ "jsx-sort-props",
9
+ ]);
10
+
11
+ const disabledLegacyRules = Object.fromEntries(
12
+ Object.keys(stylistic.configs["disable-legacy"].rules)
13
+ .filter(rule => !allowedReactRules.has(`react/${rule}`))
14
+ .map(rule => [rule, "off"]),
15
+ );
16
+
3
17
  // TODO: eslint unicorn rule proposal
4
- const allowedRules = new Set(["padding-line-between-statements"]);
18
+ const allowedRules = new Set([
19
+ "padding-line-between-statements",
20
+ ...allowedReactRules,
21
+ ]);
22
+
5
23
  const disabledRules = Object.fromEntries(
6
24
  Object.keys(stylistic.rules)
7
25
  .filter(rule => !allowedRules.has(rule))
@@ -17,6 +35,6 @@ export default [
17
35
  "no-comma-dangle": "off",
18
36
  },
19
37
  },
20
- stylistic.configs["disable-legacy"],
38
+ { rules: disabledLegacyRules },
21
39
  { rules: disabledRules },
22
40
  ];
package/src/react.js CHANGED
@@ -37,6 +37,11 @@ export default [...configs, {
37
37
  },
38
38
  }],
39
39
  },
40
+ }, {
41
+ files: ["src/constants/**/*.{ts,cts,mts,tsx}", "**/constants.{ts,cts,mts,tsx}"],
42
+ rules: {
43
+ "@typescript-eslint/naming-convention": "off",
44
+ },
40
45
  }, {
41
46
  files: "**/*.{ts,cts,mts,tsx}",
42
47
  rules: {