@withsummon/oxlint-config 0.0.0-stage → 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Summon
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/oxlintrc.json ADDED
@@ -0,0 +1,90 @@
1
+ {
2
+ "$schema": "../../node_modules/oxlint/configuration_schema.json",
3
+ "plugins": ["typescript", "unicorn", "oxc", "react", "node", "import"],
4
+ "jsPlugins": ["./plugin/index.js"],
5
+ "categories": {
6
+ "correctness": "error",
7
+ "suspicious": "error"
8
+ },
9
+ "env": {
10
+ "builtin": true,
11
+ "browser": true
12
+ },
13
+ "rules": {
14
+ "typescript/consistent-type-assertions": [
15
+ "error",
16
+ {
17
+ "assertionStyle": "never"
18
+ }
19
+ ],
20
+ "typescript/no-floating-promises": "error",
21
+ "typescript/no-unsafe-type-assertion": "error",
22
+ "react/exhaustive-deps": "error",
23
+ "node/no-process-env": "error",
24
+ "no-console": "error",
25
+ "no-restricted-globals": [
26
+ "error",
27
+ {
28
+ "name": "fetch",
29
+ "message": "Call the API through the Eden or Hono RPC client."
30
+ }
31
+ ],
32
+ "no-restricted-imports": [
33
+ "error",
34
+ {
35
+ "paths": [
36
+ {
37
+ "name": "@phosphor-icons/react",
38
+ "message": "Use Icon or SelectableIcon from the ui package."
39
+ },
40
+ {
41
+ "name": "@tanstack/react-table",
42
+ "message": "Use useDataTable from the ui package."
43
+ },
44
+ {
45
+ "name": "lucide-react",
46
+ "message": "Summon uses Phosphor through the ui package."
47
+ }
48
+ ],
49
+ "patterns": [
50
+ {
51
+ "group": ["@ai-sdk/*"],
52
+ "message": "Call models through the ai package."
53
+ }
54
+ ]
55
+ }
56
+ ],
57
+ "summon/no-bare-json-parse": "error",
58
+ "summon/no-raw-env": "error",
59
+ "summon/no-literal-query-key": "error"
60
+ },
61
+ "overrides": [
62
+ {
63
+ "files": ["**/scripts/**", "**/*.config.{ts,js,mjs}", "**/e2e/**", "**/*.test.{ts,tsx}"],
64
+ "rules": {
65
+ "no-console": "off",
66
+ "node/no-process-env": "off",
67
+ "summon/no-raw-env": "off"
68
+ }
69
+ },
70
+ {
71
+ "files": ["**/packages/ui/**"],
72
+ "rules": {
73
+ "no-restricted-imports": "off"
74
+ }
75
+ },
76
+ {
77
+ "files": ["**/packages/ai/**"],
78
+ "rules": {
79
+ "no-restricted-imports": "off"
80
+ }
81
+ },
82
+ {
83
+ "files": ["**/packages/env/**"],
84
+ "rules": {
85
+ "node/no-process-env": "off",
86
+ "summon/no-raw-env": "off"
87
+ }
88
+ }
89
+ ]
90
+ }
package/package.json CHANGED
@@ -1,6 +1,28 @@
1
1
  {
2
2
  "name": "@withsummon/oxlint-config",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Summon's shared oxlint config: owner bans, type-aware rules and the summon plugin.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/withsummon/summon-kit.git",
9
+ "directory": "packages/oxlint-config"
10
+ },
11
+ "files": [
12
+ "oxlintrc.json",
13
+ "plugin"
14
+ ],
15
+ "type": "module",
16
+ "exports": {
17
+ "./oxlintrc.json": "./oxlintrc.json",
18
+ "./plugin": "./plugin/index.js"
19
+ },
20
+ "publishConfig": {
21
+ "access": "public",
22
+ "provenance": true
23
+ },
24
+ "peerDependencies": {
25
+ "oxlint": ">=1.92.0",
26
+ "oxlint-tsgolint": ">=7.0.2006"
27
+ }
28
+ }
@@ -0,0 +1,51 @@
1
+ // Summon rules that oxlint has no built-in for. Each rule names the owner to use instead.
2
+
3
+ function rule(message, create) {
4
+ return { meta: { type: "problem", messages: { use: message } }, create };
5
+ }
6
+
7
+ function isMember(node, objectName, propertyName) {
8
+ return (
9
+ node.type === "MemberExpression" &&
10
+ node.object.type === "Identifier" &&
11
+ node.object.name === objectName &&
12
+ !node.computed &&
13
+ node.property.name === propertyName
14
+ );
15
+ }
16
+
17
+ export default {
18
+ meta: { name: "summon" },
19
+ rules: {
20
+ "no-bare-json-parse": rule("Validate parsed JSON: Schema.parse(JSON.parse(text)).", (context) => ({
21
+ CallExpression(node) {
22
+ if (!isMember(node.callee, "JSON", "parse")) return;
23
+ const outer = node.parent;
24
+ const validated =
25
+ outer?.type === "CallExpression" &&
26
+ outer.arguments[0] === node &&
27
+ outer.callee.type === "MemberExpression" &&
28
+ !outer.callee.computed &&
29
+ ["parse", "safeParse"].includes(outer.callee.property.name);
30
+ if (!validated) context.report({ node, messageId: "use" });
31
+ },
32
+ })),
33
+
34
+ "no-raw-env": rule("Read env from the varlock ENV export, not import.meta.env or Bun.env.", (context) => ({
35
+ MemberExpression(node) {
36
+ const metaEnv = node.object.type === "MetaProperty" && !node.computed && node.property.name === "env";
37
+ if (metaEnv || isMember(node, "Bun", "env")) context.report({ node, messageId: "use" });
38
+ },
39
+ })),
40
+
41
+ "no-literal-query-key": rule(
42
+ "Build query keys in the feature's queryOptions factory (features/<x>/api.ts).",
43
+ (context) => ({
44
+ Property(node) {
45
+ const key = node.key.type === "Identifier" ? node.key.name : node.key.value;
46
+ if (key === "queryKey" && node.value.type === "ArrayExpression") context.report({ node, messageId: "use" });
47
+ },
48
+ }),
49
+ ),
50
+ },
51
+ };
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.