@fitzzero/quickdraw-core 2.1.2 → 2.3.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.
@@ -0,0 +1,166 @@
1
+ import eslint from "@eslint/js";
2
+ import tseslint from "typescript-eslint";
3
+ import globals from "globals";
4
+ import nextVitals from "eslint-config-next/core-web-vitals";
5
+ import quickdrawPlugin from "../eslint-plugin-quickdraw/index.mjs";
6
+
7
+ export const base = [
8
+ {
9
+ ignores: ["**/dist/", "**/node_modules/", "**/*.js", "**/*.mjs", "**/*.cjs"],
10
+ },
11
+ eslint.configs.recommended,
12
+ ...tseslint.configs.strictTypeChecked,
13
+ ...tseslint.configs.stylisticTypeChecked,
14
+ {
15
+ languageOptions: {
16
+ globals: globals.es2022,
17
+ parserOptions: {
18
+ projectService: true,
19
+ },
20
+ },
21
+ rules: {
22
+ // Type Safety
23
+ "@typescript-eslint/no-explicit-any": "error",
24
+ "@typescript-eslint/no-unsafe-assignment": "error",
25
+ "@typescript-eslint/no-unsafe-call": "error",
26
+ "@typescript-eslint/no-unsafe-member-access": "error",
27
+ "@typescript-eslint/no-unsafe-return": "error",
28
+ "@typescript-eslint/no-unsafe-argument": "error",
29
+
30
+ // Promise handling
31
+ "@typescript-eslint/no-floating-promises": "error",
32
+ "@typescript-eslint/no-misused-promises": "error",
33
+ "@typescript-eslint/await-thenable": "error",
34
+ "@typescript-eslint/require-await": "error",
35
+
36
+ // Unused code
37
+ "@typescript-eslint/no-unused-vars": [
38
+ "error",
39
+ {
40
+ argsIgnorePattern: "^_",
41
+ varsIgnorePattern: "^_",
42
+ caughtErrorsIgnorePattern: "^_",
43
+ },
44
+ ],
45
+
46
+ // Consistency
47
+ "@typescript-eslint/consistent-type-imports": [
48
+ "error",
49
+ { prefer: "type-imports", fixStyle: "inline-type-imports" },
50
+ ],
51
+ "@typescript-eslint/consistent-type-exports": [
52
+ "error",
53
+ { fixMixedExportsWithInlineTypeSpecifier: true },
54
+ ],
55
+ "@typescript-eslint/explicit-function-return-type": [
56
+ "warn",
57
+ {
58
+ allowExpressions: true,
59
+ allowTypedFunctionExpressions: true,
60
+ allowHigherOrderFunctions: true,
61
+ allowDirectConstAssertionInArrowFunctions: true,
62
+ },
63
+ ],
64
+ "@typescript-eslint/naming-convention": [
65
+ "warn",
66
+ { selector: "interface", format: ["PascalCase"] },
67
+ { selector: "typeAlias", format: ["PascalCase"] },
68
+ ],
69
+
70
+ // Ban problematic patterns
71
+ "no-restricted-syntax": [
72
+ "error",
73
+ {
74
+ selector:
75
+ 'TSAsExpression[typeAnnotation.typeName.name="unknown"] > TSAsExpression',
76
+ message:
77
+ "Avoid double `as unknown as` casts. Use proper generics, type guards, or extend the type system.",
78
+ },
79
+ ],
80
+
81
+ // Code quality
82
+ "no-console": "warn",
83
+ eqeqeq: ["error", "always", { null: "ignore" }],
84
+ "no-duplicate-imports": "error",
85
+ "prefer-const": "error",
86
+ "no-var": "error",
87
+
88
+ // Relaxed
89
+ "@typescript-eslint/no-non-null-assertion": "warn",
90
+ "@typescript-eslint/restrict-template-expressions": "off",
91
+ "@typescript-eslint/no-unnecessary-condition": "off",
92
+ },
93
+ },
94
+ ];
95
+
96
+ export const server = [
97
+ ...base,
98
+ {
99
+ languageOptions: {
100
+ globals: globals.node,
101
+ },
102
+ plugins: { quickdraw: quickdrawPlugin },
103
+ rules: {
104
+ "quickdraw/no-direct-prisma-mutations": "warn",
105
+ "quickdraw/require-zod-schema": "warn",
106
+ "quickdraw/no-service-method-record": "error",
107
+ "quickdraw/no-unsafe-payload-cast": "warn",
108
+
109
+ "no-console": "warn",
110
+ "@typescript-eslint/no-misused-promises": [
111
+ "error",
112
+ { checksVoidReturn: { arguments: false } },
113
+ ],
114
+
115
+ "@typescript-eslint/no-unsafe-assignment": "warn",
116
+ "@typescript-eslint/no-unsafe-member-access": "warn",
117
+ "@typescript-eslint/no-unsafe-call": "warn",
118
+ "@typescript-eslint/no-unsafe-return": "warn",
119
+ "@typescript-eslint/no-unsafe-argument": "warn",
120
+ "@typescript-eslint/no-redundant-type-constituents": "off",
121
+ "@typescript-eslint/no-unnecessary-type-assertion": "off",
122
+ },
123
+ },
124
+ {
125
+ files: ["**/services/**/index.ts"],
126
+ rules: {
127
+ "quickdraw/no-direct-prisma-mutations": "off",
128
+ },
129
+ },
130
+ ];
131
+
132
+ export const client = [
133
+ ...nextVitals,
134
+ ...base,
135
+ {
136
+ rules: {
137
+ "react/react-in-jsx-scope": "off",
138
+ "react/prop-types": "off",
139
+ "react-hooks/exhaustive-deps": "error",
140
+ "react-hooks/rules-of-hooks": "error",
141
+ "@next/next/no-img-element": "warn",
142
+
143
+ "@typescript-eslint/explicit-function-return-type": "off",
144
+ "react/no-unknown-property": "off",
145
+
146
+ "@typescript-eslint/no-unsafe-assignment": "warn",
147
+ "@typescript-eslint/no-unsafe-member-access": "warn",
148
+ "@typescript-eslint/no-unsafe-call": "warn",
149
+ "@typescript-eslint/no-unsafe-return": "warn",
150
+ "@typescript-eslint/no-unsafe-argument": "warn",
151
+ "@typescript-eslint/no-redundant-type-constituents": "off",
152
+ "@typescript-eslint/no-unnecessary-type-arguments": "off",
153
+ },
154
+ },
155
+ ];
156
+
157
+ export const shared = [
158
+ ...base,
159
+ {
160
+ rules: {
161
+ "@typescript-eslint/explicit-function-return-type": "error",
162
+ "@typescript-eslint/explicit-module-boundary-types": "error",
163
+ "no-console": "error",
164
+ },
165
+ },
166
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fitzzero/quickdraw-core",
3
- "version": "2.1.2",
3
+ "version": "2.3.0",
4
4
  "description": "Fast fullstack patterns for real-time applications with Socket.io and TanStack Query",
5
5
  "type": "module",
6
6
  "main": "./dist/shared/index.js",
@@ -29,11 +29,15 @@
29
29
  },
30
30
  "./eslint-plugin": {
31
31
  "import": "./eslint-plugin-quickdraw/index.mjs"
32
+ },
33
+ "./eslint-config": {
34
+ "import": "./eslint-config/index.mjs"
32
35
  }
33
36
  },
34
37
  "files": [
35
38
  "dist",
36
- "eslint-plugin-quickdraw"
39
+ "eslint-plugin-quickdraw",
40
+ "eslint-config"
37
41
  ],
38
42
  "scripts": {
39
43
  "build": "tsup",
@@ -61,7 +65,12 @@
61
65
  "@tanstack/react-query": ">=5.0.0",
62
66
  "react": ">=18.0.0",
63
67
  "socket.io": ">=4.0.0",
64
- "socket.io-client": ">=4.0.0"
68
+ "socket.io-client": ">=4.0.0",
69
+ "eslint": ">=9.0.0",
70
+ "@eslint/js": ">=9.0.0",
71
+ "typescript-eslint": ">=8.0.0",
72
+ "globals": ">=16.0.0",
73
+ "eslint-config-next": ">=16.0.0"
65
74
  },
66
75
  "peerDependenciesMeta": {
67
76
  "@prisma/client": {
@@ -78,6 +87,21 @@
78
87
  },
79
88
  "socket.io-client": {
80
89
  "optional": true
90
+ },
91
+ "eslint": {
92
+ "optional": true
93
+ },
94
+ "@eslint/js": {
95
+ "optional": true
96
+ },
97
+ "typescript-eslint": {
98
+ "optional": true
99
+ },
100
+ "globals": {
101
+ "optional": true
102
+ },
103
+ "eslint-config-next": {
104
+ "optional": true
81
105
  }
82
106
  },
83
107
  "dependencies": {