@fitzzero/quickdraw-core 2.1.2 → 3.0.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": "3.0.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,22 +29,28 @@
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",
40
44
  "dev": "tsup --watch",
41
- "typecheck": "tsc --noEmit",
42
- "lint": "eslint src --ext .ts,.tsx",
43
- "lint:fix": "eslint src --ext .ts,.tsx --fix",
45
+ "typecheck": "tsgo --noEmit",
46
+ "lint": "oxlint src",
47
+ "lint:fix": "oxlint --fix src",
48
+ "format": "oxfmt --write .",
49
+ "format:check": "oxfmt --check .",
44
50
  "test": "vitest run",
45
51
  "test:watch": "vitest",
46
52
  "test:coverage": "vitest run --coverage",
47
- "prepublishOnly": "pnpm build"
53
+ "prepublishOnly": "bun run build"
48
54
  },
49
55
  "keywords": [
50
56
  "socket.io",
@@ -61,7 +67,12 @@
61
67
  "@tanstack/react-query": ">=5.0.0",
62
68
  "react": ">=18.0.0",
63
69
  "socket.io": ">=4.0.0",
64
- "socket.io-client": ">=4.0.0"
70
+ "socket.io-client": ">=4.0.0",
71
+ "eslint": ">=9.0.0",
72
+ "@eslint/js": ">=9.0.0",
73
+ "typescript-eslint": ">=8.0.0",
74
+ "globals": ">=16.0.0",
75
+ "eslint-config-next": ">=16.0.0"
65
76
  },
66
77
  "peerDependenciesMeta": {
67
78
  "@prisma/client": {
@@ -78,6 +89,21 @@
78
89
  },
79
90
  "socket.io-client": {
80
91
  "optional": true
92
+ },
93
+ "eslint": {
94
+ "optional": true
95
+ },
96
+ "@eslint/js": {
97
+ "optional": true
98
+ },
99
+ "typescript-eslint": {
100
+ "optional": true
101
+ },
102
+ "globals": {
103
+ "optional": true
104
+ },
105
+ "eslint-config-next": {
106
+ "optional": true
81
107
  }
82
108
  },
83
109
  "dependencies": {
@@ -91,12 +117,12 @@
91
117
  "@types/express": "^4.17.21",
92
118
  "@types/node": "^20.11.0",
93
119
  "@types/react": "^18.2.0",
94
- "@typescript-eslint/eslint-plugin": "^7.0.0",
95
- "@typescript-eslint/parser": "^7.0.0",
120
+ "@typescript/native-preview": "^7.0.0-dev",
96
121
  "@vitest/coverage-v8": "^1.3.0",
97
- "eslint": "^8.56.0",
98
122
  "express": "^4.18.2",
99
123
  "jsdom": "^24.0.0",
124
+ "oxfmt": "^0.37.0",
125
+ "oxlint": "^1.52.0",
100
126
  "react": "^18.2.0",
101
127
  "react-dom": "^18.2.0",
102
128
  "socket.io": "^4.7.4",