reactivated 0.44.6 → 0.45.0

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,3 @@
1
+ import type { TSESLint } from "@typescript-eslint/utils";
2
+ declare const _default: TSESLint.FlatConfig.ConfigArray;
3
+ export default _default;
@@ -1,10 +1,50 @@
1
- module.exports = {
2
- root: true,
3
- parser: "@typescript-eslint/parser",
4
- parserOptions: {
5
- project: ["./tsconfig.json"],
1
+ import eslint from "@eslint/js";
2
+ import eslintConfigPrettier from "eslint-config-prettier";
3
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
4
+ // @ts-ignore
5
+ import importPlugin from "eslint-plugin-import";
6
+ import reactPlugin from "eslint-plugin-react";
7
+ // @ts-ignore
8
+ import hooksPlugin from "eslint-plugin-react-hooks";
9
+ import unusedImports from "eslint-plugin-unused-imports";
10
+ import tseslint from "typescript-eslint";
11
+ export default tseslint.config({
12
+ languageOptions: {
13
+ parserOptions: {
14
+ project: ["./tsconfig.json"],
15
+ projectService: true,
16
+ tsconfigRootDir: __dirname,
17
+ },
18
+ },
19
+ }, {
20
+ ignores: [
21
+ ".venv/**/*",
22
+ "**/*/*.pyc",
23
+ "**/.DS_Store",
24
+ ".mypy_cache",
25
+ ".pytest_cache",
26
+ "static/dist/**/*",
27
+ ],
28
+ }, eslint.configs.recommended, ...(reactPlugin.configs.flat
29
+ ? [reactPlugin.configs.flat.recommended]
30
+ : []), {
31
+ plugins: {
32
+ /* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment */
33
+ "react-hooks": hooksPlugin,
34
+ },
35
+ /* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment */
36
+ rules: {
37
+ /* eslint-disable-next-line @typescript-eslint/no-unsafe-member-access */
38
+ ...hooksPlugin.configs.recommended.rules,
39
+ },
40
+ }, ...tseslint.configs.recommendedTypeChecked, eslintConfigPrettier,
41
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
42
+ importPlugin.flatConfigs.typescript, importPlugin.flatConfigs.errors, importPlugin.flatConfigs.warnings,
43
+ /* eslint-enable @typescript-eslint/no-unsafe-member-access */
44
+ {
45
+ plugins: {
46
+ "unused-imports": unusedImports,
6
47
  },
7
- plugins: ["@typescript-eslint", "unused-imports"],
8
48
  settings: {
9
49
  react: {
10
50
  version: "detect",
@@ -12,7 +52,12 @@ module.exports = {
12
52
  "import/resolver": "typescript",
13
53
  },
14
54
  rules: {
15
- "sort-imports": ["error", { ignoreDeclarationSort: true }],
55
+ "sort-imports": [
56
+ "error",
57
+ {
58
+ ignoreDeclarationSort: true,
59
+ },
60
+ ],
16
61
  // TypeScript handles this for us.
17
62
  "import/namespace": 0,
18
63
  "import/named": 0,
@@ -26,7 +71,9 @@ module.exports = {
26
71
  "import/order": [
27
72
  "error",
28
73
  {
29
- alphabetize: { order: "asc" },
74
+ alphabetize: {
75
+ order: "asc",
76
+ },
30
77
  "newlines-between": "always",
31
78
  pathGroups: [
32
79
  {
@@ -77,7 +124,12 @@ module.exports = {
77
124
  // to check against a null return.
78
125
  "@typescript-eslint/no-unnecessary-condition": "error",
79
126
  // We use empty callbacks that are no-ops sometimes.
80
- "@typescript-eslint/no-empty-function": ["error", { allow: ["arrowFunctions"] }],
127
+ "@typescript-eslint/no-empty-function": [
128
+ "error",
129
+ {
130
+ allow: ["arrowFunctions"],
131
+ },
132
+ ],
81
133
  // Typescript additions
82
134
  "@typescript-eslint/strict-boolean-expressions": "error",
83
135
  // See: https://github.com/typescript-eslint/typescript-eslint/issues/4619#issuecomment-1057096238
@@ -93,16 +145,5 @@ module.exports = {
93
145
  // https://www.reddit.com/r/typescript/comments/uiil9k/am_i_crazy_for_expecting_typescript_to_catch_this/
94
146
  "@typescript-eslint/no-use-before-define": ["error"],
95
147
  },
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
148
+ });
149
+ //# sourceMappingURL=eslint.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eslint.config.js","sourceRoot":"","sources":["../src/eslint.config.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,YAAY,CAAC;AAEhC,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAE1D,sDAAsD;AACtD,aAAa;AACb,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAC9C,aAAa;AACb,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,aAAa,MAAM,8BAA8B,CAAC;AACzD,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AAEzC,eAAe,QAAQ,CAAC,MAAM,CAC1B;IACI,eAAe,EAAE;QACb,aAAa,EAAE;YACX,OAAO,EAAE,CAAC,iBAAiB,CAAC;YAC5B,cAAc,EAAE,IAAI;YACpB,eAAe,EAAE,SAAS;SAC7B;KACJ;CACJ,EACD;IACI,OAAO,EAAE;QACL,YAAY;QACZ,YAAY;QACZ,cAAc;QACd,aAAa;QACb,eAAe;QACf,kBAAkB;KACrB;CACJ,EAED,MAAM,CAAC,OAAO,CAAC,WAAW,EAC1B,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI;IACxB,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CA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qBACpB;oBACD;wBACI,KAAK,EAAE,UAAU;wBACjB,OAAO,EAAE,mBAAmB;wBAC5B,QAAQ,EAAE,QAAQ;qBACrB;oBACD;wBACI,KAAK,EAAE,UAAU;wBACjB,OAAO,EACH,qGAAqG;wBACzG,QAAQ,EAAE,QAAQ;qBACrB;iBACJ;gBAED,MAAM,EAAE;oBACJ,SAAS;oBACT,UAAU;oBACV,UAAU;oBACV,QAAQ;oBACR,SAAS;oBACT,OAAO;iBACV;gBACD,6BAA6B,EAAE,CAAC,SAAS,CAAC;aAC7C;SACJ;QACD,kBAAkB;QAClB,kBAAkB,EAAE,KAAK;QACzB,iDAAiD;QACjD,oBAAoB,EAAE,KAAK;QAC3B,wCAAwC;QACxC,6BAA6B,EAAE,KAAK;QAEpC,wCAAwC;QACxC,mCAAmC,EAAE,KAAK;QAC1C,kCAAkC,EAAE,OAAO;QAC3C,+BAA+B,EAAE,OAAO;QACxC,mDAAmD,EAAE,KAAK;QAC1D,0CAA0C,EAAE,KAAK;QAEjD,mEAAmE;QACnE,kCAAkC;QAClC,6CAA6C,EAAE,OAAO;QAEtD,oDAAoD;QACpD,sCAAsC,EAAE;YACpC,OAAO;YACP;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/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "reactivated",
3
- "version": "0.44.6",
3
+ "version": "0.45.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": "./dist/index.js",
8
+ "./dist/eslint.config": "./dist/eslint.config.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,41 @@
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/js": "^9.14.0",
34
+ "@types/eslint__eslintrc": "^2.1.2",
35
+ "@types/eslint__js": "^8.42.3",
36
+ "@types/eslint-config-prettier": "^6.11.3",
37
+ "@types/express": "^5.0.0",
38
+ "@types/react": "^18.3.12",
39
+ "@types/react-dom": "^18.3.1",
40
+ "@vanilla-extract/css": "^1.16.0",
41
+ "@vanilla-extract/css-utils": "^0.1.4",
42
+ "@vanilla-extract/dynamic": "^2.1.2",
43
+ "@vanilla-extract/esbuild-plugin": "^2.3.11",
44
+ "@vanilla-extract/recipes": "^0.5.5",
45
+ "@vanilla-extract/sprinkles": "^1.6.3",
46
+ "@vanilla-extract/vite-plugin": "^4.0.17",
47
+ "@vitejs/plugin-react": "^4.3.3",
48
+ "eslint": "^9.14.0",
46
49
  "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"
50
+ "eslint-import-resolver-typescript": "^3.6.3",
51
+ "eslint-plugin-import": "^2.31.0",
52
+ "eslint-plugin-react": "^7.37.2",
53
+ "eslint-plugin-react-hooks": "^5.0.0",
54
+ "eslint-plugin-unused-imports": "^4.1.4",
55
+ "express": "^5.0.1",
56
+ "immer": "^10.1.1",
57
+ "jiti": "^2.4.1",
58
+ "json-schema-to-typescript": "^15.0.2",
59
+ "prettier": "^3.3.3",
60
+ "react": "^18.3.1",
61
+ "react-dom": "^18.3.1",
62
+ "react-helmet-async": "^2.0.5",
63
+ "terser": "^5.36.0",
64
+ "ts-morph": "^24.0.0",
65
+ "typescript": "^5.6.3",
66
+ "typescript-eslint": "^8.13.0",
67
+ "vite": "^5.4.10",
68
+ "vite-plugin-cjs-interop": "^2.1.5"
64
69
  }
65
70
  }
@@ -0,0 +1,180 @@
1
+ import eslint from "@eslint/js";
2
+ import type {TSESLint} from "@typescript-eslint/utils";
3
+ import eslintConfigPrettier from "eslint-config-prettier";
4
+
5
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
6
+ // @ts-ignore
7
+ import importPlugin from "eslint-plugin-import";
8
+ import reactPlugin from "eslint-plugin-react";
9
+ // @ts-ignore
10
+ import hooksPlugin from "eslint-plugin-react-hooks";
11
+ import unusedImports from "eslint-plugin-unused-imports";
12
+ import tseslint from "typescript-eslint";
13
+
14
+ export default tseslint.config(
15
+ {
16
+ languageOptions: {
17
+ parserOptions: {
18
+ project: ["./tsconfig.json"],
19
+ projectService: true,
20
+ tsconfigRootDir: __dirname,
21
+ },
22
+ },
23
+ },
24
+ {
25
+ ignores: [
26
+ ".venv/**/*",
27
+ "**/*/*.pyc",
28
+ "**/.DS_Store",
29
+ ".mypy_cache",
30
+ ".pytest_cache",
31
+ "static/dist/**/*",
32
+ ],
33
+ },
34
+
35
+ eslint.configs.recommended,
36
+ ...(reactPlugin.configs.flat
37
+ ? [reactPlugin.configs.flat.recommended as TSESLint.FlatConfig.Config]
38
+ : []),
39
+
40
+ {
41
+ plugins: {
42
+ /* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment */
43
+ "react-hooks": hooksPlugin,
44
+ },
45
+ /* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment */
46
+ rules: {
47
+ /* eslint-disable-next-line @typescript-eslint/no-unsafe-member-access */
48
+ ...hooksPlugin.configs.recommended.rules,
49
+ },
50
+ },
51
+ ...tseslint.configs.recommendedTypeChecked,
52
+ eslintConfigPrettier,
53
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
54
+ importPlugin.flatConfigs.typescript as TSESLint.FlatConfig.Config,
55
+ importPlugin.flatConfigs.errors as TSESLint.FlatConfig.Config,
56
+ importPlugin.flatConfigs.warnings as TSESLint.FlatConfig.Config,
57
+ /* eslint-enable @typescript-eslint/no-unsafe-member-access */
58
+ {
59
+ plugins: {
60
+ "unused-imports": unusedImports,
61
+ },
62
+
63
+ settings: {
64
+ react: {
65
+ version: "detect",
66
+ },
67
+
68
+ "import/resolver": "typescript",
69
+ },
70
+
71
+ rules: {
72
+ "sort-imports": [
73
+ "error",
74
+ {
75
+ ignoreDeclarationSort: true,
76
+ },
77
+ ],
78
+
79
+ // TypeScript handles this for us.
80
+ "import/namespace": 0,
81
+ "import/named": 0,
82
+ "import/no-unresolved": 0,
83
+
84
+ // immer's default export is produce, not matching the filename.
85
+ // TODO: I think immer can be specifically imported now.
86
+ "import/no-named-as-default": 0,
87
+ "import/no-named-as-default-member": 0,
88
+
89
+ "import/newline-after-import": ["error"],
90
+ "import/first": ["error"],
91
+
92
+ "import/order": [
93
+ "error",
94
+ {
95
+ alphabetize: {
96
+ order: "asc",
97
+ },
98
+
99
+ "newlines-between": "always",
100
+
101
+ pathGroups: [
102
+ {
103
+ group: "builtin",
104
+ pattern: "{react,react-dom}",
105
+ position: "before",
106
+ },
107
+ {
108
+ group: "builtin",
109
+ pattern: "{@reactivated,react-*}",
110
+ position: "after",
111
+ },
112
+ {
113
+ group: "internal",
114
+ pattern: "@client/actions/*",
115
+ position: "before",
116
+ },
117
+ {
118
+ group: "internal",
119
+ pattern:
120
+ "@client/{app/graphics,shared/analytics,dates,utils,routes,models,style,shared/typography,constants}",
121
+ position: "before",
122
+ },
123
+ ],
124
+
125
+ groups: [
126
+ "builtin",
127
+ "external",
128
+ "internal",
129
+ "parent",
130
+ "sibling",
131
+ "index",
132
+ ],
133
+ pathGroupsExcludedImportTypes: ["builtin"],
134
+ },
135
+ ],
136
+ // React overrides
137
+ "react/prop-types": "off",
138
+ // We create way too many components dynamically.
139
+ "react/display-name": "off",
140
+ // We use empty arrays to run once, etc.
141
+ "react-hooks/exhaustive-deps": "off",
142
+
143
+ // Typescript overrides from recommended
144
+ "@typescript-eslint/no-unused-vars": "off",
145
+ "unused-imports/no-unused-imports": "error",
146
+ "unused-imports/no-unused-vars": "error",
147
+ "@typescript-eslint/explicit-module-boundary-types": "off",
148
+ "@typescript-eslint/no-non-null-assertion": "off",
149
+
150
+ // For when we do RPC calls and forget to call await on the promise
151
+ // to check against a null return.
152
+ "@typescript-eslint/no-unnecessary-condition": "error",
153
+
154
+ // We use empty callbacks that are no-ops sometimes.
155
+ "@typescript-eslint/no-empty-function": [
156
+ "error",
157
+ {
158
+ allow: ["arrowFunctions"],
159
+ },
160
+ ],
161
+
162
+ // Typescript additions
163
+ "@typescript-eslint/strict-boolean-expressions": "error",
164
+
165
+ // See: https://github.com/typescript-eslint/typescript-eslint/issues/4619#issuecomment-1057096238
166
+ // We want async callbacks to React event handlers
167
+ "@typescript-eslint/no-misused-promises": [
168
+ "error",
169
+ {
170
+ checksVoidReturn: {
171
+ attributes: false,
172
+ },
173
+ },
174
+ ],
175
+
176
+ // https://www.reddit.com/r/typescript/comments/uiil9k/am_i_crazy_for_expecting_typescript_to_catch_this/
177
+ "@typescript-eslint/no-use-before-define": ["error"],
178
+ },
179
+ },
180
+ );
@@ -1 +0,0 @@
1
- {"version":3,"file":"eslintrc.cjs","sourceRoot":"","sources":["../src/eslintrc.cts"],"names":[],"mappings":"AAAA,MA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;gBACD,6BAA6B,EAAE,CAAC,SAAS,CAAC;aAC7C;SACJ;QACD,kBAAkB;QAClB,kBAAkB,EAAE,KAAK;QACzB,iDAAiD;QACjD,oBAAoB,EAAE,KAAK;QAC3B,wCAAwC;QACxC,6BAA6B,EAAE,KAAK;QAEpC,wCAAwC;QACxC,mCAAmC,EAAE,KAAK;QAC1C,kCAAkC,EAAE,OAAO;QAC3C,+BAA+B,EAAE,OAAO;QACxC,mDAAmD,EAAE,KAAK;QAC1D,0CAA0C,EAAE,KAAK;QAEjD,mEAAmE;QACnE,kCAAkC;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
- };