@adamaho/nopeus-oxlint-config 0.4.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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nopeus contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,71 @@
1
+ # @adamaho/nopeus-oxlint-config
2
+
3
+ Ordinary source and test filenames use kebab-case through the built-in
4
+ `unicorn/filename-case` rule: `user-service.ts`, `user-service.test.ts`, and
5
+ `effect.integration.test.ts`. `index.ts` and compound extensions such as `.d.ts`
6
+ retain Oxlint's built-in handling. Framework-mandated filenames should have a
7
+ narrow, documented override in the consuming project's config.
8
+
9
+ Use ESM imports and exports. `typescript/no-require-imports` rejects `require()`
10
+ (including conditional calls) and `import x = require(...)`;
11
+ `import/no-commonjs` rejects `module.exports` and `exports.*`. The custom plugin
12
+ also rejects TypeScript's `export =` syntax. ESM imports of dependencies that
13
+ internally use CommonJS remain allowed.
14
+
15
+ Package/test ownership is enforced separately by the custom plugin's `/base`
16
+ and `/effect` presets.
17
+
18
+ Use package-local Node import aliases for imports that would climb to a parent
19
+ directory. `import/no-relative-parent-imports` rejects `../` and `../../` imports
20
+ in source and tests. Same-directory `./` imports remain allowed.
21
+
22
+ Define aliases in each package's `package.json`, preserving file extensions:
23
+
24
+ ```json
25
+ {
26
+ "imports": {
27
+ "#src/*": "./src/*",
28
+ "#test/*": "./test/*"
29
+ }
30
+ }
31
+ ```
32
+
33
+ For example, use `#src/receipts/repository.ts` instead of
34
+ `../../src/receipts/repository.ts`. Across packages, use the target package's
35
+ name and public exports.
36
+
37
+ Shared configuration selecting built-in Oxlint rules for TypeScript codebases.
38
+ This package has no Effect runtime or LSP dependency.
39
+
40
+ ## Usage
41
+
42
+ Install the config and its Oxlint peer:
43
+
44
+ ```bash
45
+ pnpm add --save-dev @adamaho/nopeus-oxlint-config oxlint
46
+ ```
47
+
48
+ Extend the base config from an `oxlint.config.ts` file:
49
+
50
+ ```ts
51
+ import base from "@adamaho/nopeus-oxlint-config";
52
+ import { defineConfig } from "oxlint";
53
+
54
+ export default defineConfig({
55
+ extends: [base],
56
+ });
57
+ ```
58
+
59
+ Oxlint does not resolve package imports from `.oxlintrc.json`; use a TypeScript
60
+ config when consuming this package.
61
+
62
+ The package publishes compiled ESM and requires Node.js 22.18 or newer, or
63
+ Node.js 24 or newer.
64
+
65
+ ## Custom Nopeus rules
66
+
67
+ The separate `@adamaho/nopeus-oxlint-plugin` package implements custom rules.
68
+ Its `/base` preset adds general TypeScript rules without requiring any Effect
69
+ packages. Its `/effect` preset adds Effect syntax checks, including the v4 import
70
+ restrictions previously included in this base config. Use the Effect preset
71
+ for Effect projects. See the [plugin setup](../nopeus-oxlint-plugin/README.md).
@@ -0,0 +1,23 @@
1
+ //#region src/base.d.ts
2
+ declare const _default: {
3
+ plugins: ("eslint" | "import" | "oxc" | "typescript" | "unicorn")[];
4
+ rules: {
5
+ "import/no-commonjs": ["error", {
6
+ allowRequire: true;
7
+ }];
8
+ "import/no-relative-parent-imports": "error";
9
+ "typescript/no-require-imports": "error";
10
+ "unicorn/filename-case": ["error", {
11
+ case: string;
12
+ }];
13
+ "eslint/no-debugger": "error";
14
+ "eslint/no-duplicate-imports": "error";
15
+ };
16
+ overrides: {
17
+ files: string[];
18
+ plugins: ("eslint" | "import" | "oxc" | "typescript" | "unicorn" | "vitest")[];
19
+ }[];
20
+ };
21
+ //#endregion
22
+ export { _default as default };
23
+ //# sourceMappingURL=base.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.mts","names":[],"sources":["../src/base.ts"],"mappings":""}
package/dist/base.mjs ADDED
@@ -0,0 +1,34 @@
1
+ import { defineConfig } from "oxlint";
2
+ //#region src/base.ts
3
+ var base_default = defineConfig({
4
+ plugins: [
5
+ "eslint",
6
+ "typescript",
7
+ "oxc",
8
+ "unicorn",
9
+ "import"
10
+ ],
11
+ rules: {
12
+ "import/no-commonjs": ["error", { allowRequire: true }],
13
+ "import/no-relative-parent-imports": "error",
14
+ "typescript/no-require-imports": "error",
15
+ "unicorn/filename-case": ["error", { case: "kebabCase" }],
16
+ "eslint/no-debugger": "error",
17
+ "eslint/no-duplicate-imports": "error"
18
+ },
19
+ overrides: [{
20
+ files: ["**/*.{test,spec}.{js,jsx,ts,tsx}"],
21
+ plugins: [
22
+ "eslint",
23
+ "typescript",
24
+ "oxc",
25
+ "unicorn",
26
+ "import",
27
+ "vitest"
28
+ ]
29
+ }]
30
+ });
31
+ //#endregion
32
+ export { base_default as default };
33
+
34
+ //# sourceMappingURL=base.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.mjs","names":[],"sources":["../src/base.ts"],"sourcesContent":["import { defineConfig } from \"oxlint\";\n\nexport default defineConfig({\n plugins: [\"eslint\", \"typescript\", \"oxc\", \"unicorn\", \"import\"],\n rules: {\n // Let the TypeScript rule own all require forms without duplicate reports.\n \"import/no-commonjs\": [\"error\", { allowRequire: true }],\n \"import/no-relative-parent-imports\": \"error\",\n \"typescript/no-require-imports\": \"error\",\n \"unicorn/filename-case\": [\"error\", { case: \"kebabCase\" }],\n \"eslint/no-debugger\": \"error\",\n \"eslint/no-duplicate-imports\": \"error\",\n },\n overrides: [\n {\n files: [\"**/*.{test,spec}.{js,jsx,ts,tsx}\"],\n plugins: [\"eslint\", \"typescript\", \"oxc\", \"unicorn\", \"import\", \"vitest\"],\n },\n ],\n});\n"],"mappings":";;AAEA,IAAA,eAAe,aAAa;CAC1B,SAAS;EAAC;EAAU;EAAc;EAAO;EAAW;CAAQ;CAC5D,OAAO;EAEL,sBAAsB,CAAC,SAAS,EAAE,cAAc,KAAK,CAAC;EACtD,qCAAqC;EACrC,iCAAiC;EACjC,yBAAyB,CAAC,SAAS,EAAE,MAAM,YAAY,CAAC;EACxD,sBAAsB;EACtB,+BAA+B;CACjC;CACA,WAAW,CACT;EACE,OAAO,CAAC,kCAAkC;EAC1C,SAAS;GAAC;GAAU;GAAc;GAAO;GAAW;GAAU;EAAQ;CACxE,CACF;AACF,CAAC"}
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@adamaho/nopeus-oxlint-config",
3
+ "version": "0.4.0",
4
+ "description": "Shared base Oxlint configuration for strict TypeScript codebases.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/adamaho/nopeus.git",
9
+ "directory": "packages/nopeus-oxlint-config"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "LICENSE",
14
+ "README.md"
15
+ ],
16
+ "type": "module",
17
+ "sideEffects": false,
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/base.d.mts",
21
+ "import": "./dist/base.mjs"
22
+ },
23
+ "./base": {
24
+ "types": "./dist/base.d.mts",
25
+ "import": "./dist/base.mjs"
26
+ }
27
+ },
28
+ "publishConfig": {
29
+ "access": "public",
30
+ "registry": "https://registry.npmjs.org"
31
+ },
32
+ "devDependencies": {
33
+ "@nopeus/tool-tsconfig": "0.0.0",
34
+ "@nopeus/tool-tsdown-config": "0.0.0",
35
+ "@types/node": "24.13.3",
36
+ "oxlint": "1.81.0",
37
+ "rimraf": "6.1.3",
38
+ "tsdown": "0.23.0",
39
+ "typescript": "7.0.2"
40
+ },
41
+ "peerDependencies": {
42
+ "oxlint": ">=1.79.0 <2"
43
+ },
44
+ "engines": {
45
+ "node": "^22.18.0 || >=24.0.0"
46
+ },
47
+ "scripts": {
48
+ "build": "tsdown",
49
+ "clean": "rimraf node_modules dist build .turbo coverage",
50
+ "lint": "oxlint --config ./src/base.ts src",
51
+ "tsc": "tsc --noEmit"
52
+ }
53
+ }