@haltcase/style 7.0.0-canary.4 → 7.0.0-canary.5

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.
@@ -1,8 +1,6 @@
1
- import { FlatCompat } from "@eslint/eslintrc";
2
1
  import eslintPluginImportX from "eslint-plugin-import-x";
3
2
  import eslintPluginJsxA11y from "eslint-plugin-jsx-a11y";
4
3
  import eslintPluginReact from "eslint-plugin-react";
5
- // @ts-ignore
6
4
  import eslintPluginReactHooks from "eslint-plugin-react-hooks";
7
5
  import { config } from "typescript-eslint";
8
6
 
@@ -10,8 +8,6 @@ import { jsxA11yRules } from "../rules/jsx-a11y.js";
10
8
  import { reactRules } from "../rules/react.js";
11
9
  import { getEslintBaseConfig } from "./internal/base.js";
12
10
 
13
- const compat = new FlatCompat();
14
-
15
11
  /**
16
12
  * @param {import("./internal/base.js").HaltcaseStyleOptions} [options]
17
13
  */
@@ -42,8 +38,12 @@ export const getEslintReactConfigInternal = (_options = {}) =>
42
38
 
43
39
  {
44
40
  name: "@haltcase/react/hooks",
45
- // @ts-ignore the modules types are incorrect
46
- ...compat.config(eslintPluginReactHooks.configs.recommended)
41
+ plugins: {
42
+ "react-hooks": eslintPluginReactHooks
43
+ },
44
+ rules: {
45
+ ...eslintPluginReactHooks.configs.recommended.rules
46
+ }
47
47
  },
48
48
 
49
49
  {
@@ -94,9 +94,11 @@ export const reactRules = {
94
94
  /**
95
95
  * Require props to be sorted alphabetically.
96
96
  *
97
+ * Disabled because it can be annoying when enabled while not having a lot of upside.
98
+ *
97
99
  * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
98
100
  */
99
- "react/jsx-sort-props": "warn",
101
+ "react/jsx-sort-props": "off",
100
102
  /**
101
103
  * Disallow usage of Array index in keys.
102
104
  *
@@ -57,5 +57,18 @@ export const typescriptExtensionRules = {
57
57
  *
58
58
  * 🚫 Not fixable - https://typescript-eslint.io/rules/no-useless-constructor/
59
59
  */
60
- "@typescript-eslint/no-useless-constructor": "error"
60
+ "@typescript-eslint/no-useless-constructor": "error",
61
+ /**
62
+ * Enforce template literal expressions to be of string type.
63
+ *
64
+ * 🚫 Not fixable - https://typescript-eslint.io/rules/restrict-template-expressions/
65
+ */
66
+ "@typescript-eslint/restrict-template-expressions": [
67
+ "error",
68
+ {
69
+ allow: [{ from: "lib", name: ["Error", "URL", "URLSearchParams"] }],
70
+ allowBoolean: true,
71
+ allowNumber: true
72
+ }
73
+ ]
61
74
  };
@@ -92,6 +92,7 @@ export const typescriptBaseRules = {
92
92
  "error",
93
93
  {
94
94
  ignorePrimitives: {
95
+ number: true,
95
96
  string: true
96
97
  }
97
98
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haltcase/style",
3
- "version": "7.0.0-canary.4",
3
+ "version": "7.0.0-canary.5",
4
4
  "description": "haltcase's web ecosystem style guide & configurations",
5
5
  "keywords": [
6
6
  "eslint",