reactivated 0.44.3 → 0.44.4-a2617

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,3 +1,4 @@
1
+ import React from "react";
1
2
  import { WidgetType } from "./Widget";
2
3
  interface FieldLike {
3
4
  name: string;
@@ -32,5 +33,5 @@ export interface FormSetLike<T extends FieldMap> {
32
33
  }
33
34
  export declare const ManagementForm: <T extends FieldMap>({ formSet, }: {
34
35
  formSet: FormSetLike<T>;
35
- }) => JSX.Element;
36
+ }) => React.JSX.Element;
36
37
  export {};
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@typescript-eslint/utils/dist/ts-eslint").FlatConfig.ConfigArray;
2
+ export default _default;
@@ -1,10 +1,22 @@
1
- module.exports = {
2
- root: true,
3
- parser: "@typescript-eslint/parser",
4
- parserOptions: {
5
- project: ["./tsconfig.json"],
1
+ import path from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ import { fixupConfigRules } from "@eslint/compat";
4
+ import { FlatCompat } from "@eslint/eslintrc";
5
+ import eslint from "@eslint/js";
6
+ import eslintConfigPrettier from "eslint-config-prettier";
7
+ import unusedImports from "eslint-plugin-unused-imports";
8
+ import tseslint from "typescript-eslint";
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = path.dirname(__filename);
11
+ const compat = new FlatCompat({
12
+ baseDirectory: __dirname,
13
+ recommendedConfig: eslint.configs.recommended,
14
+ allConfig: eslint.configs.all,
15
+ });
16
+ export default tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommendedTypeChecked, eslintConfigPrettier, ...fixupConfigRules(compat.extends("plugin:react/recommended", "plugin:react-hooks/recommended", "plugin:import/typescript", "plugin:import/errors", "plugin:import/warnings")), {
17
+ plugins: {
18
+ "unused-imports": unusedImports,
6
19
  },
7
- plugins: ["@typescript-eslint", "unused-imports"],
8
20
  settings: {
9
21
  react: {
10
22
  version: "detect",
@@ -12,7 +24,12 @@ module.exports = {
12
24
  "import/resolver": "typescript",
13
25
  },
14
26
  rules: {
15
- "sort-imports": ["error", { ignoreDeclarationSort: true }],
27
+ "sort-imports": [
28
+ "error",
29
+ {
30
+ ignoreDeclarationSort: true,
31
+ },
32
+ ],
16
33
  // TypeScript handles this for us.
17
34
  "import/namespace": 0,
18
35
  "import/named": 0,
@@ -26,7 +43,9 @@ module.exports = {
26
43
  "import/order": [
27
44
  "error",
28
45
  {
29
- alphabetize: { order: "asc" },
46
+ alphabetize: {
47
+ order: "asc",
48
+ },
30
49
  "newlines-between": "always",
31
50
  pathGroups: [
32
51
  {
@@ -77,7 +96,12 @@ module.exports = {
77
96
  // to check against a null return.
78
97
  "@typescript-eslint/no-unnecessary-condition": "error",
79
98
  // We use empty callbacks that are no-ops sometimes.
80
- "@typescript-eslint/no-empty-function": ["error", { allow: ["arrowFunctions"] }],
99
+ "@typescript-eslint/no-empty-function": [
100
+ "error",
101
+ {
102
+ allow: ["arrowFunctions"],
103
+ },
104
+ ],
81
105
  // Typescript additions
82
106
  "@typescript-eslint/strict-boolean-expressions": "error",
83
107
  // See: https://github.com/typescript-eslint/typescript-eslint/issues/4619#issuecomment-1057096238
@@ -93,16 +117,5 @@ module.exports = {
93
117
  // https://www.reddit.com/r/typescript/comments/uiil9k/am_i_crazy_for_expecting_typescript_to_catch_this/
94
118
  "@typescript-eslint/no-use-before-define": ["error"],
95
119
  },
96
- extends: [
97
- "eslint:recommended",
98
- "plugin:react/recommended",
99
- "plugin:react-hooks/recommended",
100
- "plugin:@typescript-eslint/recommended",
101
- "plugin:@typescript-eslint/recommended-requiring-type-checking",
102
- "prettier",
103
- "plugin:import/typescript",
104
- "plugin:import/errors",
105
- "plugin:import/warnings",
106
- ],
107
- };
108
- //# sourceMappingURL=eslintrc.cjs.map
120
+ });
121
+ //# sourceMappingURL=eslintrc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eslintrc.js","sourceRoot":"","sources":["../src/eslintrc.ts"],"names":[],"mappings":"AAAA,OAAO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gBACI,KAAK,EAAE,CAAC,gBAAgB,CAAC;aAC5B;SACJ;QAED,uBAAuB;QACvB,+CAA+C,EAAE,OAAO;QAExD,kGAAkG;QAClG,kDAAkD;QAClD,wCAAwC,EAAE;YACtC,OAAO;YACP;gBACI,gBAAgB,EAAE;oBACd,UAAU,EAAE,KAAK;iBACpB;aACJ;SACJ;QAED,yGAAyG;QACzG,yCAAyC,EAAE,CAAC,OAAO,CAAC;KACvD;CACJ,CACJ,CAAC"}
@@ -140,13 +140,13 @@ interface ExcludeRendererProps<T extends FieldMap, F extends WidgetLike> extends
140
140
  exclude: Array<Extract<keyof T, string>>;
141
141
  }
142
142
  export type RendererProps<T extends FieldMap, F extends WidgetLike> = IncludeRendererProps<T, F> | ExcludeRendererProps<T, F>;
143
- export declare const createIterator: <F extends WidgetLike>() => <U extends FieldMap>(props: RendererProps<U, F>) => JSX.Element;
143
+ export declare const createIterator: <F extends WidgetLike>() => <U extends FieldMap>(props: RendererProps<U, F>) => React.JSX.Element;
144
144
  export declare const Widget: (props: {
145
145
  field: FieldHandler<widgets.CoreWidget>;
146
- }) => JSX.Element;
146
+ }) => React.JSX.Element;
147
147
  export declare const ManagementForm: <T extends FieldMap>({ formSet, }: {
148
148
  formSet: FormSetLike<T>;
149
- }) => JSX.Element;
149
+ }) => React.JSX.Element;
150
150
  export declare const useFormSet: <T extends FieldMap>(options: {
151
151
  formSet: FormSetLike<T>;
152
152
  onAddForm?: (form: FormLike<T>) => void;
@@ -165,24 +165,24 @@ export declare const useFormSet: <T extends FieldMap>(options: {
165
165
  };
166
166
  export declare const bindWidgetType: <W extends WidgetLike>() => {
167
167
  createRenderer: <TProps = Record<never, never>>(callback: (field: FieldHandler<W>, props: TProps) => React.ReactNode) => {
168
- <T extends FieldMap>(props: TProps & RendererProps<T, W>): JSX.Element;
168
+ <T extends FieldMap>(props: TProps & RendererProps<T, W>): React.JSX.Element;
169
169
  defaultProps: {
170
170
  children: () => null;
171
171
  };
172
172
  };
173
- Iterator: <U extends FieldMap>(props: RendererProps<U, W>) => JSX.Element;
173
+ Iterator: <U extends FieldMap>(props: RendererProps<U, W>) => React.JSX.Element;
174
174
  };
175
175
  export declare const createCSRFToken: <TContext extends {
176
176
  csrf_token: string;
177
- }>(Context: React.Context<TContext>) => (props: {}) => JSX.Element;
177
+ }>(Context: React.Context<TContext>) => (props: {}) => React.JSX.Element;
178
178
  export declare const Form: <T extends FieldMap<widgets.CoreWidget>>(props: {
179
179
  form: FormLike<T> | FormHandler<T>;
180
180
  as: "p" | "table";
181
- }) => JSX.Element;
181
+ }) => React.JSX.Element;
182
182
  export declare const FormSet: <T extends FieldMap<widgets.CoreWidget>>(props: {
183
183
  formSet: FormSetLike<T>;
184
184
  as: "p" | "table";
185
- }) => JSX.Element;
185
+ }) => React.JSX.Element;
186
186
  export type UnknownFormValues<T extends FieldMap> = {
187
187
  [K in keyof T]: T[K] extends {
188
188
  enum: unknown;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { Types } from "../generated";
2
3
  export type CoreWidget = Types["Widget"];
3
4
  type Optgroup = Types["Optgroup"];
@@ -6,7 +7,7 @@ export declare const CheckboxInput: (props: {
6
7
  className?: string;
7
8
  value: true | false;
8
9
  onChange: (value: boolean) => void;
9
- }) => JSX.Element;
10
+ }) => React.JSX.Element;
10
11
  export declare const TextInput: (props: {
11
12
  name: string;
12
13
  className?: string;
@@ -14,18 +15,18 @@ export declare const TextInput: (props: {
14
15
  onChange: (value: string) => void;
15
16
  placeholder?: string;
16
17
  type?: "text" | "password";
17
- }) => JSX.Element;
18
+ }) => React.JSX.Element;
18
19
  export declare const Select: (props: {
19
20
  name: string;
20
21
  className?: string;
21
22
  value: string | number | null;
22
23
  optgroups: Optgroup[];
23
24
  onChange: (value: string) => void;
24
- }) => JSX.Element;
25
+ }) => React.JSX.Element;
25
26
  export declare const Textarea: (props: {
26
27
  name: string;
27
28
  className?: string;
28
29
  value: string | null;
29
30
  onChange: (value: string) => void;
30
- }) => JSX.Element;
31
+ }) => React.JSX.Element;
31
32
  export {};
package/dist/vite.mjs CHANGED
@@ -71,7 +71,11 @@ app.use("/_reactivated/", async (req, res) => {
71
71
  try {
72
72
  const { render } = (await vite.ssrLoadModule("reactivated/dist/render.mjs"));
73
73
  const url = context.request.path;
74
- const viteHead = await vite.transformIndexHtml(url, "");
74
+ // For E2E tests, we may want to run them pointing to a running vite
75
+ // instance for a quick feedback loop. Intead of the traditional python
76
+ // manage.py build step necessary. So we ensure vite head always
77
+ // points to the per-request STATIC_URL.
78
+ const viteHead = (await vite.transformIndexHtml(url, "")).replace(base, `${context.STATIC_URL}dist/`);
75
79
  const rendered = await render(req, viteHead, "development", "index");
76
80
  res.status(200).set({ "Content-Type": "text/html" }).end(rendered);
77
81
  }
package/dist/vite.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"vite.mjs","sourceRoot":"","sources":["../src/vite.mts"],"names":[],"mappings":";AAEA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,sBAAsB,CAAC;AACzC,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AACjC,OAAO,EAAmB,cAAc,EAAC,MAAM,aAAa,CAAC;AAI7D,aAAa;AACb,OAAO,EAAC,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAEnD,OAAO,EAAC,oBAAoB,EAAC,MAAM,8BAA8B,CAAC;AAElE,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,IAAI,CAAC;AACvD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC;AACrC,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AAChE,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AAEpF,MAAM,GAAG,G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AO,CAAC,UAAU,OAAO,CAC/B,CAAC;QACF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;QAErE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAC,cAAc,EAAE,WAAW,EAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACrE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,IAAI,CAAC,gBAAgB,CAAC,KAAY,CAAC,CAAC;QACpC,MAAM,OAAO,GAAqB;YAC9B,KAAK,EAAE,cAAc,CAAC,KAAY,CAAC;SACtC,CAAC;QACF,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "reactivated",
3
- "version": "0.44.3",
3
+ "version": "0.44.4-a2617",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": "./dist/index.js",
8
+ "./dist/eslintrc": "./dist/eslintrc.js",
8
9
  "./dist/forms": "./dist/forms/index.js",
9
10
  "./dist/context": "./dist/context.js",
10
11
  "./dist/conf": "./dist/conf.js",
@@ -29,37 +30,42 @@
29
30
  },
30
31
  "license": "ISC",
31
32
  "peerDependencies": {
32
- "@types/express": "^4.17.21",
33
- "@types/react": "^18.0.12",
34
- "@types/react-dom": "^18.0.5",
35
- "@typescript-eslint/eslint-plugin": "^7.16.0",
36
- "@typescript-eslint/parser": "^7.16.0",
37
- "@vanilla-extract/css": "^1.11.0",
38
- "@vanilla-extract/css-utils": "^0.1.3",
39
- "@vanilla-extract/dynamic": "^2.0.3",
40
- "@vanilla-extract/esbuild-plugin": "^2.2.2",
41
- "@vanilla-extract/recipes": "^0.4.0",
42
- "@vanilla-extract/sprinkles": "^1.6.0",
43
- "@vanilla-extract/vite-plugin": "^3.9.5",
44
- "@vitejs/plugin-react": "^4.2.1",
45
- "eslint": "^8.57.0",
33
+ "@eslint/compat": "^1.2.2",
34
+ "@eslint/eslintrc": "^3.1.0",
35
+ "@eslint/js": "^9.14.0",
36
+ "@types/eslint__eslintrc": "^2.1.2",
37
+ "@types/eslint__js": "^8.42.3",
38
+ "@types/eslint-config-prettier": "^6.11.3",
39
+ "@types/express": "^5.0.0",
40
+ "@types/react": "^18.3.12",
41
+ "@types/react-dom": "^18.3.1",
42
+ "@vanilla-extract/css": "^1.16.0",
43
+ "@vanilla-extract/css-utils": "^0.1.4",
44
+ "@vanilla-extract/dynamic": "^2.1.2",
45
+ "@vanilla-extract/esbuild-plugin": "^2.3.11",
46
+ "@vanilla-extract/recipes": "^0.5.5",
47
+ "@vanilla-extract/sprinkles": "^1.6.3",
48
+ "@vanilla-extract/vite-plugin": "^4.0.17",
49
+ "@vitejs/plugin-react": "^4.3.3",
50
+ "eslint": "^9.14.0",
46
51
  "eslint-config-prettier": "^9.1.0",
47
- "eslint-import-resolver-typescript": "^3.6.1",
48
- "eslint-plugin-import": "^2.29.1",
49
- "eslint-plugin-react": "^7.34.3",
50
- "eslint-plugin-react-hooks": "^4.6.2",
51
- "eslint-plugin-unused-imports": "^3.2.0",
52
- "express": "^4.18.2",
53
- "immer": "^10.0.3",
54
- "json-schema-to-typescript": "^14.1.0",
55
- "prettier": "^3.2.5",
56
- "react": "^18.1.0",
57
- "react-dom": "^18.1.0",
58
- "react-helmet-async": "^2.0.4",
59
- "terser": "^5.10.0",
60
- "ts-morph": "^23.0.0",
61
- "typescript": "^5.5.2",
62
- "vite": "^5.0.12",
63
- "vite-plugin-cjs-interop": "^2.0.5"
52
+ "eslint-import-resolver-typescript": "^3.6.3",
53
+ "eslint-plugin-import": "^2.31.0",
54
+ "eslint-plugin-react": "^7.37.2",
55
+ "eslint-plugin-react-hooks": "^5.0.0",
56
+ "eslint-plugin-unused-imports": "^4.1.4",
57
+ "express": "^5.0.1",
58
+ "immer": "^10.1.1",
59
+ "json-schema-to-typescript": "^15.0.2",
60
+ "prettier": "^3.3.3",
61
+ "react": "^18.3.1",
62
+ "react-dom": "^18.3.1",
63
+ "react-helmet-async": "^2.0.5",
64
+ "terser": "^5.36.0",
65
+ "ts-morph": "^24.0.0",
66
+ "typescript": "^5.6.3",
67
+ "typescript-eslint": "^8.13.0",
68
+ "vite": "^5.4.10",
69
+ "vite-plugin-cjs-interop": "^2.1.5"
64
70
  }
65
71
  }
@@ -0,0 +1,154 @@
1
+ import path from "node:path";
2
+ import {fileURLToPath} from "node:url";
3
+
4
+ import {fixupConfigRules} from "@eslint/compat";
5
+ import {FlatCompat} from "@eslint/eslintrc";
6
+ import eslint from "@eslint/js";
7
+ import eslintConfigPrettier from "eslint-config-prettier";
8
+ import unusedImports from "eslint-plugin-unused-imports";
9
+ import tseslint from "typescript-eslint";
10
+
11
+ const __filename = fileURLToPath(import.meta.url);
12
+ const __dirname = path.dirname(__filename);
13
+ const compat = new FlatCompat({
14
+ baseDirectory: __dirname,
15
+ recommendedConfig: eslint.configs.recommended,
16
+ allConfig: eslint.configs.all,
17
+ });
18
+
19
+ export default tseslint.config(
20
+ eslint.configs.recommended,
21
+ ...tseslint.configs.recommendedTypeChecked,
22
+ eslintConfigPrettier,
23
+ ...fixupConfigRules(
24
+ compat.extends(
25
+ "plugin:react/recommended",
26
+ "plugin:react-hooks/recommended",
27
+ "plugin:import/typescript",
28
+ "plugin:import/errors",
29
+ "plugin:import/warnings",
30
+ ),
31
+ ),
32
+ {
33
+ plugins: {
34
+ "unused-imports": unusedImports,
35
+ },
36
+
37
+ settings: {
38
+ react: {
39
+ version: "detect",
40
+ },
41
+
42
+ "import/resolver": "typescript",
43
+ },
44
+
45
+ rules: {
46
+ "sort-imports": [
47
+ "error",
48
+ {
49
+ ignoreDeclarationSort: true,
50
+ },
51
+ ],
52
+
53
+ // TypeScript handles this for us.
54
+ "import/namespace": 0,
55
+ "import/named": 0,
56
+ "import/no-unresolved": 0,
57
+
58
+ // immer's default export is produce, not matching the filename.
59
+ // TODO: I think immer can be specifically imported now.
60
+ "import/no-named-as-default": 0,
61
+ "import/no-named-as-default-member": 0,
62
+
63
+ "import/newline-after-import": ["error"],
64
+ "import/first": ["error"],
65
+
66
+ "import/order": [
67
+ "error",
68
+ {
69
+ alphabetize: {
70
+ order: "asc",
71
+ },
72
+
73
+ "newlines-between": "always",
74
+
75
+ pathGroups: [
76
+ {
77
+ group: "builtin",
78
+ pattern: "{react,react-dom}",
79
+ position: "before",
80
+ },
81
+ {
82
+ group: "builtin",
83
+ pattern: "{@reactivated,react-*}",
84
+ position: "after",
85
+ },
86
+ {
87
+ group: "internal",
88
+ pattern: "@client/actions/*",
89
+ position: "before",
90
+ },
91
+ {
92
+ group: "internal",
93
+ pattern:
94
+ "@client/{app/graphics,shared/analytics,dates,utils,routes,models,style,shared/typography,constants}",
95
+ position: "before",
96
+ },
97
+ ],
98
+
99
+ groups: [
100
+ "builtin",
101
+ "external",
102
+ "internal",
103
+ "parent",
104
+ "sibling",
105
+ "index",
106
+ ],
107
+ pathGroupsExcludedImportTypes: ["builtin"],
108
+ },
109
+ ],
110
+ // React overrides
111
+ "react/prop-types": "off",
112
+ // We create way too many components dynamically.
113
+ "react/display-name": "off",
114
+ // We use empty arrays to run once, etc.
115
+ "react-hooks/exhaustive-deps": "off",
116
+
117
+ // Typescript overrides from recommended
118
+ "@typescript-eslint/no-unused-vars": "off",
119
+ "unused-imports/no-unused-imports": "error",
120
+ "unused-imports/no-unused-vars": "error",
121
+ "@typescript-eslint/explicit-module-boundary-types": "off",
122
+ "@typescript-eslint/no-non-null-assertion": "off",
123
+
124
+ // For when we do RPC calls and forget to call await on the promise
125
+ // to check against a null return.
126
+ "@typescript-eslint/no-unnecessary-condition": "error",
127
+
128
+ // We use empty callbacks that are no-ops sometimes.
129
+ "@typescript-eslint/no-empty-function": [
130
+ "error",
131
+ {
132
+ allow: ["arrowFunctions"],
133
+ },
134
+ ],
135
+
136
+ // Typescript additions
137
+ "@typescript-eslint/strict-boolean-expressions": "error",
138
+
139
+ // See: https://github.com/typescript-eslint/typescript-eslint/issues/4619#issuecomment-1057096238
140
+ // We want async callbacks to React event handlers
141
+ "@typescript-eslint/no-misused-promises": [
142
+ "error",
143
+ {
144
+ checksVoidReturn: {
145
+ attributes: false,
146
+ },
147
+ },
148
+ ],
149
+
150
+ // https://www.reddit.com/r/typescript/comments/uiil9k/am_i_crazy_for_expecting_typescript_to_catch_this/
151
+ "@typescript-eslint/no-use-before-define": ["error"],
152
+ },
153
+ },
154
+ );
package/src/vite.mts CHANGED
@@ -87,7 +87,14 @@ app.use("/_reactivated/", async (req, res) => {
87
87
  };
88
88
 
89
89
  const url = context.request.path;
90
- const viteHead = await vite.transformIndexHtml(url, "");
90
+ // For E2E tests, we may want to run them pointing to a running vite
91
+ // instance for a quick feedback loop. Intead of the traditional python
92
+ // manage.py build step necessary. So we ensure vite head always
93
+ // points to the per-request STATIC_URL.
94
+ const viteHead = (await vite.transformIndexHtml(url, "")).replace(
95
+ base,
96
+ `${context.STATIC_URL}dist/`,
97
+ );
91
98
  const rendered = await render(req, viteHead, "development", "index");
92
99
 
93
100
  res.status(200).set({"Content-Type": "text/html"}).end(rendered);
@@ -1 +0,0 @@
1
- {"version":3,"file":"eslintrc.cjs","sourceRoot":"","sources":["../src/eslintrc.cts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,GAAG;IACb,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE;QACX,OAAO,EAAE,CAAC,iBAAiB,CAAC;KAC/B;IACD,OAAO,EAAE,CAAC,oBAAoB,EAAE,gBAAgB,CAAC;IACjD,QAAQ,EAAE;QACN,KAAK,EAAE;YACH,OAAO,EAAE,QAAQ;SACpB;QACD,iBAAiB,EAAE,YAAY;KAClC;IACD,KAAK,EAAE;QACH,cAAc,EAAE,CAAC,OAAO,EAAE,EAAC,qBAAqB,EA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CAAkC;QAClC,6CAA6C,EAAE,OAAO;QAEtD,oDAAoD;QACpD,sCAAsC,EAAE,CAAC,OAAO,EAAE,EAAC,KAAK,EAAE,CAAC,gBAAgB,CAAC,EAAC,CAAC;QAE9E,uBAAuB;QACvB,+CAA+C,EAAE,OAAO;QAExD,kGAAkG;QAClG,kDAAkD;QAClD,wCAAwC,EAAE;YACtC,OAAO;YACP;gBACI,gBAAgB,EAAE;oBACd,UAAU,EAAE,KAAK;iBACpB;aACJ;SACJ;QAED,yGAAyG;QACzG,yCAAyC,EAAE,CAAC,OAAO,CAAC;KACvD;IACD,OAAO,EAAE;QACL,oBAAoB;QACpB,0BAA0B;QAC1B,gCAAgC;QAChC,uCAAuC;QACvC,+DAA+D;QAC/D,UAAU;QACV,0BAA0B;QAC1B,sBAAsB;QACtB,wBAAwB;KAC3B;CACJ,CAAC"}
@@ -1 +0,0 @@
1
- export {};
package/src/eslintrc.cts DELETED
@@ -1,117 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- parser: "@typescript-eslint/parser",
4
- parserOptions: {
5
- project: ["./tsconfig.json"],
6
- },
7
- plugins: ["@typescript-eslint", "unused-imports"],
8
- settings: {
9
- react: {
10
- version: "detect",
11
- },
12
- "import/resolver": "typescript",
13
- },
14
- rules: {
15
- "sort-imports": ["error", {ignoreDeclarationSort: true}],
16
-
17
- // TypeScript handles this for us.
18
- "import/namespace": 0,
19
- "import/named": 0,
20
- "import/no-unresolved": 0,
21
-
22
- // immer's default export is produce, not matching the filename.
23
- // TODO: I think immer can be specifically imported now.
24
- "import/no-named-as-default": 0,
25
- "import/no-named-as-default-member": 0,
26
-
27
- "import/newline-after-import": ["error"],
28
- "import/first": ["error"],
29
- "import/order": [
30
- "error",
31
- {
32
- alphabetize: {order: "asc"},
33
- "newlines-between": "always",
34
- pathGroups: [
35
- {
36
- group: "builtin",
37
- pattern: "{react,react-dom}",
38
- position: "before",
39
- },
40
- {
41
- group: "builtin",
42
- pattern: "{@reactivated,react-*}",
43
- position: "after",
44
- },
45
- {
46
- group: "internal",
47
- pattern: "@client/actions/*",
48
- position: "before",
49
- },
50
- {
51
- group: "internal",
52
- pattern:
53
- "@client/{app/graphics,shared/analytics,dates,utils,routes,models,style,shared/typography,constants}",
54
- position: "before",
55
- },
56
- ],
57
- groups: [
58
- "builtin",
59
- "external",
60
- "internal",
61
- "parent",
62
- "sibling",
63
- "index",
64
- ],
65
- pathGroupsExcludedImportTypes: ["builtin"],
66
- },
67
- ],
68
- // React overrides
69
- "react/prop-types": "off",
70
- // We create way too many components dynamically.
71
- "react/display-name": "off",
72
- // We use empty arrays to run once, etc.
73
- "react-hooks/exhaustive-deps": "off",
74
-
75
- // Typescript overrides from recommended
76
- "@typescript-eslint/no-unused-vars": "off",
77
- "unused-imports/no-unused-imports": "error",
78
- "unused-imports/no-unused-vars": "error",
79
- "@typescript-eslint/explicit-module-boundary-types": "off",
80
- "@typescript-eslint/no-non-null-assertion": "off",
81
-
82
- // For when we do RPC calls and forget to call await on the promise
83
- // to check against a null return.
84
- "@typescript-eslint/no-unnecessary-condition": "error",
85
-
86
- // We use empty callbacks that are no-ops sometimes.
87
- "@typescript-eslint/no-empty-function": ["error", {allow: ["arrowFunctions"]}],
88
-
89
- // Typescript additions
90
- "@typescript-eslint/strict-boolean-expressions": "error",
91
-
92
- // See: https://github.com/typescript-eslint/typescript-eslint/issues/4619#issuecomment-1057096238
93
- // We want async callbacks to React event handlers
94
- "@typescript-eslint/no-misused-promises": [
95
- "error",
96
- {
97
- checksVoidReturn: {
98
- attributes: false,
99
- },
100
- },
101
- ],
102
-
103
- // https://www.reddit.com/r/typescript/comments/uiil9k/am_i_crazy_for_expecting_typescript_to_catch_this/
104
- "@typescript-eslint/no-use-before-define": ["error"],
105
- },
106
- extends: [
107
- "eslint:recommended",
108
- "plugin:react/recommended",
109
- "plugin:react-hooks/recommended",
110
- "plugin:@typescript-eslint/recommended",
111
- "plugin:@typescript-eslint/recommended-requiring-type-checking",
112
- "prettier",
113
- "plugin:import/typescript",
114
- "plugin:import/errors",
115
- "plugin:import/warnings",
116
- ],
117
- };