@adamaho/nopeus-oxlint-plugin 0.7.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,31 @@
1
+ //#region src/base.d.ts
2
+ /** General Nopeus syntax rules for TypeScript projects. */
3
+ declare const _default: {
4
+ jsPlugins: {
5
+ name: string;
6
+ specifier: string;
7
+ }[];
8
+ rules: {
9
+ "nopeus/no-export-assignment": "error";
10
+ "nopeus/no-cross-package-internals": "error";
11
+ "nopeus/no-test-imports": "error";
12
+ "nopeus/require-test-location": "error";
13
+ "nopeus/no-conditional-empty-object-spread": "error";
14
+ "nopeus/no-known-value-widening": "error";
15
+ "nopeus/no-module-mocking": "error";
16
+ "nopeus/no-object-parameters": "error";
17
+ "nopeus/no-reflect-apply": "error";
18
+ "nopeus/no-reflect-get": "error";
19
+ "nopeus/no-runtime-typeof": ["error", {
20
+ allowInTypeGuards: boolean;
21
+ }];
22
+ "nopeus/no-type-assertions": "error";
23
+ "nopeus/no-unknown-returns": "error";
24
+ "nopeus/no-unknown-type-aliases": "error";
25
+ "nopeus/no-unsafe-dictionary-type": "error";
26
+ "nopeus/require-public-jsdoc": "error";
27
+ };
28
+ };
29
+ //#endregion
30
+ export { _default as default };
31
+ //# sourceMappingURL=base.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.mts","names":[],"sources":["../src/base.ts"],"mappings":";;cAEA"}
package/dist/base.mjs ADDED
@@ -0,0 +1,31 @@
1
+ import { defineConfig } from "oxlint";
2
+ //#region src/base.ts
3
+ /** General Nopeus syntax rules for TypeScript projects. */
4
+ var base_default = defineConfig({
5
+ jsPlugins: [{
6
+ name: "nopeus",
7
+ specifier: "@adamaho/nopeus-oxlint-plugin"
8
+ }],
9
+ rules: {
10
+ "nopeus/no-export-assignment": "error",
11
+ "nopeus/no-cross-package-internals": "error",
12
+ "nopeus/no-test-imports": "error",
13
+ "nopeus/require-test-location": "error",
14
+ "nopeus/no-conditional-empty-object-spread": "error",
15
+ "nopeus/no-known-value-widening": "error",
16
+ "nopeus/no-module-mocking": "error",
17
+ "nopeus/no-object-parameters": "error",
18
+ "nopeus/no-reflect-apply": "error",
19
+ "nopeus/no-reflect-get": "error",
20
+ "nopeus/no-runtime-typeof": ["error", { allowInTypeGuards: true }],
21
+ "nopeus/no-type-assertions": "error",
22
+ "nopeus/no-unknown-returns": "error",
23
+ "nopeus/no-unknown-type-aliases": "error",
24
+ "nopeus/no-unsafe-dictionary-type": "error",
25
+ "nopeus/require-public-jsdoc": "error"
26
+ }
27
+ });
28
+ //#endregion
29
+ export { base_default as default };
30
+
31
+ //# sourceMappingURL=base.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.mjs","names":[],"sources":["../src/base.ts"],"sourcesContent":["import { defineConfig } from \"oxlint\";\n\n/** General Nopeus syntax rules for TypeScript projects. */\nexport default defineConfig({\n jsPlugins: [{ name: \"nopeus\", specifier: \"@adamaho/nopeus-oxlint-plugin\" }],\n rules: {\n \"nopeus/no-export-assignment\": \"error\",\n \"nopeus/no-cross-package-internals\": \"error\",\n \"nopeus/no-test-imports\": \"error\",\n \"nopeus/require-test-location\": \"error\",\n \"nopeus/no-conditional-empty-object-spread\": \"error\",\n \"nopeus/no-known-value-widening\": \"error\",\n \"nopeus/no-module-mocking\": \"error\",\n \"nopeus/no-object-parameters\": \"error\",\n \"nopeus/no-reflect-apply\": \"error\",\n \"nopeus/no-reflect-get\": \"error\",\n \"nopeus/no-runtime-typeof\": [\"error\", { allowInTypeGuards: true }],\n \"nopeus/no-type-assertions\": \"error\",\n \"nopeus/no-unknown-returns\": \"error\",\n \"nopeus/no-unknown-type-aliases\": \"error\",\n \"nopeus/no-unsafe-dictionary-type\": \"error\",\n \"nopeus/require-public-jsdoc\": \"error\",\n },\n});\n"],"mappings":";;;AAGA,IAAA,eAAe,aAAa;CAC1B,WAAW,CAAC;EAAE,MAAM;EAAU,WAAW;CAAgC,CAAC;CAC1E,OAAO;EACL,+BAA+B;EAC/B,qCAAqC;EACrC,0BAA0B;EAC1B,gCAAgC;EAChC,6CAA6C;EAC7C,kCAAkC;EAClC,4BAA4B;EAC5B,+BAA+B;EAC/B,2BAA2B;EAC3B,yBAAyB;EACzB,4BAA4B,CAAC,SAAS,EAAE,mBAAmB,KAAK,CAAC;EACjE,6BAA6B;EAC7B,6BAA6B;EAC7B,kCAAkC;EAClC,oCAAoC;EACpC,+BAA+B;CACjC;AACF,CAAC"}
@@ -0,0 +1,67 @@
1
+ //#region src/effect.d.ts
2
+ export interface NopeusEffectOptions {
3
+ /** The consuming repository's root package name. */
4
+ readonly packageName: string;
5
+ /** Files that own Effect runtime execution, relative to the repository root. */
6
+ readonly runtimeEntryPoints?: readonly string[];
7
+ }
8
+ /** Convert a root package name into its owned Effect identifier prefix. */
9
+ export declare function serviceKeyPrefixFromPackageName(packageName: string): string;
10
+ /** Build the canonical Nopeus policy for an Effect repository. */
11
+ export default function effect({ packageName, runtimeEntryPoints }: NopeusEffectOptions): {
12
+ jsPlugins: {
13
+ name: string;
14
+ specifier: string;
15
+ }[];
16
+ rules: {
17
+ "nopeus/no-export-assignment": "error";
18
+ "nopeus/no-cross-package-internals": "error";
19
+ "nopeus/no-test-imports": "error";
20
+ "nopeus/require-test-location": "error";
21
+ "nopeus/no-conditional-empty-object-spread": "error";
22
+ "nopeus/no-known-value-widening": "error";
23
+ "nopeus/no-module-mocking": "error";
24
+ "nopeus/no-object-parameters": "error";
25
+ "nopeus/no-reflect-apply": "error";
26
+ "nopeus/no-reflect-get": "error";
27
+ "nopeus/no-runtime-typeof": ["error", {
28
+ allowInTypeGuards: boolean;
29
+ }];
30
+ "nopeus/no-type-assertions": "error";
31
+ "nopeus/no-unknown-returns": "error";
32
+ "nopeus/no-unknown-type-aliases": "error";
33
+ "nopeus/no-unsafe-dictionary-type": "error";
34
+ "nopeus/require-public-jsdoc": "error";
35
+ "eslint/no-restricted-imports": ["error", {
36
+ paths: {
37
+ name: string;
38
+ message: string;
39
+ }[];
40
+ patterns: {
41
+ group: string[];
42
+ message: string;
43
+ }[];
44
+ }];
45
+ "nopeus/no-module-level-mutable-state": "error";
46
+ "nopeus/require-fetch-abort-signal": "error";
47
+ "nopeus/no-effect-runners-in-library": ["error", {
48
+ allowFiles: string[];
49
+ }];
50
+ "nopeus/no-fallible-effect-promise": "error";
51
+ "nopeus/no-inline-live-layer": "error";
52
+ "nopeus/no-unscoped-fork": "error";
53
+ "nopeus/no-untyped-effect-errors": "error";
54
+ "nopeus/prefer-effect-platform-services": "error";
55
+ "nopeus/prefer-effect-void": "error";
56
+ "nopeus/require-effect-fn-name": "error";
57
+ "nopeus/require-service-key-prefix": ["error", {
58
+ prefix: string;
59
+ }];
60
+ "nopeus/require-effect-namespace": ["error", {
61
+ prefix: string;
62
+ }];
63
+ "nopeus/require-service-constructor-names": "error";
64
+ };
65
+ };
66
+ //#endregion
67
+ //# sourceMappingURL=effect.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effect.d.mts","names":[],"sources":["../src/effect.ts"],"mappings":";iBAIiB;;WAEN;;WAEA;;;wBAIK,gCAAgC;;wBAUxB,SAAS,aAAa,sBAA2B"}
@@ -0,0 +1,64 @@
1
+ import base_default from "./base.mjs";
2
+ import { defineConfig } from "oxlint";
3
+ //#region src/effect.ts
4
+ /** Convert a root package name into its owned Effect identifier prefix. */
5
+ function serviceKeyPrefixFromPackageName(packageName) {
6
+ const projectName = packageName.split("/").at(-1);
7
+ if (projectName === void 0 || projectName.length === 0) throw new TypeError("packageName must contain a project name");
8
+ return "@" + projectName + "/";
9
+ }
10
+ /** Build the canonical Nopeus policy for an Effect repository. */
11
+ function effect({ packageName, runtimeEntryPoints = [] }) {
12
+ return defineConfig({
13
+ ...base_default,
14
+ rules: {
15
+ ...base_default.rules,
16
+ "eslint/no-restricted-imports": ["error", {
17
+ paths: [
18
+ {
19
+ name: "@effect/platform",
20
+ message: "Use Effect v4 consolidated modules from `effect` (for example `effect/unstable/httpapi` or `effect/unstable/http`)."
21
+ },
22
+ {
23
+ name: "@effect/sql",
24
+ message: "Use `effect/unstable/sql` and driver-specific `@effect/sql-*` packages in Effect v4."
25
+ },
26
+ {
27
+ name: "@effect/rpc",
28
+ message: "Use `effect/unstable/rpc` in Effect v4."
29
+ },
30
+ {
31
+ name: "@effect/cluster",
32
+ message: "Use `effect/unstable/cluster` in Effect v4."
33
+ }
34
+ ],
35
+ patterns: [{
36
+ group: [
37
+ "@effect/platform/*",
38
+ "@effect/sql/*",
39
+ "@effect/rpc/*",
40
+ "@effect/cluster/*"
41
+ ],
42
+ message: "Do not import v3 split Effect packages. Use consolidated `effect` module imports in v4."
43
+ }]
44
+ }],
45
+ "nopeus/no-module-level-mutable-state": "error",
46
+ "nopeus/require-fetch-abort-signal": "error",
47
+ "nopeus/no-effect-runners-in-library": ["error", { allowFiles: [...runtimeEntryPoints] }],
48
+ "nopeus/no-fallible-effect-promise": "error",
49
+ "nopeus/no-inline-live-layer": "error",
50
+ "nopeus/no-unscoped-fork": "error",
51
+ "nopeus/no-untyped-effect-errors": "error",
52
+ "nopeus/prefer-effect-platform-services": "error",
53
+ "nopeus/prefer-effect-void": "error",
54
+ "nopeus/require-effect-fn-name": "error",
55
+ "nopeus/require-service-key-prefix": ["error", { prefix: serviceKeyPrefixFromPackageName(packageName) }],
56
+ "nopeus/require-effect-namespace": ["error", { prefix: serviceKeyPrefixFromPackageName(packageName) }],
57
+ "nopeus/require-service-constructor-names": "error"
58
+ }
59
+ });
60
+ }
61
+ //#endregion
62
+ export { effect as default, serviceKeyPrefixFromPackageName };
63
+
64
+ //# sourceMappingURL=effect.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effect.mjs","names":["base"],"sources":["../src/effect.ts"],"sourcesContent":["import { defineConfig } from \"oxlint\";\n\nimport base from \"./base.ts\";\n\nexport interface NopeusEffectOptions {\n /** The consuming repository's root package name. */\n readonly packageName: string;\n /** Files that own Effect runtime execution, relative to the repository root. */\n readonly runtimeEntryPoints?: readonly string[];\n}\n\n/** Convert a root package name into its owned Effect identifier prefix. */\nexport function serviceKeyPrefixFromPackageName(packageName: string): string {\n const projectName = packageName.split(\"/\").at(-1);\n if (projectName === undefined || projectName.length === 0) {\n throw new TypeError(\"packageName must contain a project name\");\n }\n\n return \"@\" + projectName + \"/\";\n}\n\n/** Build the canonical Nopeus policy for an Effect repository. */\nexport default function effect({ packageName, runtimeEntryPoints = [] }: NopeusEffectOptions) {\n return defineConfig({\n ...base,\n rules: {\n ...base.rules,\n \"eslint/no-restricted-imports\": [\n \"error\",\n {\n paths: [\n {\n name: \"@effect/platform\",\n message:\n \"Use Effect v4 consolidated modules from `effect` (for example `effect/unstable/httpapi` or `effect/unstable/http`).\",\n },\n {\n name: \"@effect/sql\",\n message:\n \"Use `effect/unstable/sql` and driver-specific `@effect/sql-*` packages in Effect v4.\",\n },\n {\n name: \"@effect/rpc\",\n message: \"Use `effect/unstable/rpc` in Effect v4.\",\n },\n {\n name: \"@effect/cluster\",\n message: \"Use `effect/unstable/cluster` in Effect v4.\",\n },\n ],\n patterns: [\n {\n group: [\"@effect/platform/*\", \"@effect/sql/*\", \"@effect/rpc/*\", \"@effect/cluster/*\"],\n message:\n \"Do not import v3 split Effect packages. Use consolidated `effect` module imports in v4.\",\n },\n ],\n },\n ],\n \"nopeus/no-module-level-mutable-state\": \"error\",\n \"nopeus/require-fetch-abort-signal\": \"error\",\n \"nopeus/no-effect-runners-in-library\": [\"error\", { allowFiles: [...runtimeEntryPoints] }],\n \"nopeus/no-fallible-effect-promise\": \"error\",\n \"nopeus/no-inline-live-layer\": \"error\",\n \"nopeus/no-unscoped-fork\": \"error\",\n \"nopeus/no-untyped-effect-errors\": \"error\",\n \"nopeus/prefer-effect-platform-services\": \"error\",\n \"nopeus/prefer-effect-void\": \"error\",\n \"nopeus/require-effect-fn-name\": \"error\",\n \"nopeus/require-service-key-prefix\": [\n \"error\",\n { prefix: serviceKeyPrefixFromPackageName(packageName) },\n ],\n \"nopeus/require-effect-namespace\": [\n \"error\",\n { prefix: serviceKeyPrefixFromPackageName(packageName) },\n ],\n \"nopeus/require-service-constructor-names\": \"error\",\n },\n });\n}\n"],"mappings":";;;;AAYA,SAAgB,gCAAgC,aAA6B;CAC3E,MAAM,cAAc,YAAY,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE;CAChD,IAAI,gBAAgB,KAAA,KAAa,YAAY,WAAW,GACtD,MAAM,IAAI,UAAU,yCAAyC;CAG/D,OAAO,MAAM,cAAc;AAC7B;;AAGA,SAAwB,OAAO,EAAE,aAAa,qBAAqB,CAAC,KAA0B;CAC5F,OAAO,aAAa;EAClB,GAAGA;EACH,OAAO;GACL,GAAGA,aAAK;GACR,gCAAgC,CAC9B,SACA;IACE,OAAO;KACL;MACE,MAAM;MACN,SACE;KACJ;KACA;MACE,MAAM;MACN,SACE;KACJ;KACA;MACE,MAAM;MACN,SAAS;KACX;KACA;MACE,MAAM;MACN,SAAS;KACX;IACF;IACA,UAAU,CACR;KACE,OAAO;MAAC;MAAsB;MAAiB;MAAiB;KAAmB;KACnF,SACE;IACJ,CACF;GACF,CACF;GACA,wCAAwC;GACxC,qCAAqC;GACrC,uCAAuC,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,kBAAkB,EAAE,CAAC;GACxF,qCAAqC;GACrC,+BAA+B;GAC/B,2BAA2B;GAC3B,mCAAmC;GACnC,0CAA0C;GAC1C,6BAA6B;GAC7B,iCAAiC;GACjC,qCAAqC,CACnC,SACA,EAAE,QAAQ,gCAAgC,WAAW,EAAE,CACzD;GACA,mCAAmC,CACjC,SACA,EAAE,QAAQ,gCAAgC,WAAW,EAAE,CACzD;GACA,4CAA4C;EAC9C;CACF,CAAC;AACH"}
@@ -0,0 +1,6 @@
1
+ //#region src/index.d.ts
2
+ /** Strict Oxlint rules for preserving type evidence and explicit Effect architecture. */
3
+ declare const nopeusPlugin: import("@oxlint/plugins").Plugin;
4
+ //#endregion
5
+ export { nopeusPlugin as default };
6
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;cAiCM,wCAAY"}