@yoltra/eslint-config-base 0.2.1

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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +30 -0
  3. package/index.js +71 -0
  4. package/package.json +35 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Yoltra — Copyright (c) 2026 Manu Ramirez <@pixerael>
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,30 @@
1
+ # @yoltra/eslint-config-base
2
+
3
+ Shared ESLint **flat config** for Node.js + browser TypeScript libraries in the Yoltra monorepo.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ npm install --save-dev @yoltra/eslint-config-base eslint typescript-eslint
9
+ ```
10
+
11
+ `eslint` is a peer dependency (`>=9`).
12
+
13
+ ## Usage
14
+
15
+ In your `eslint.config.js` (flat config):
16
+
17
+ ```js
18
+ import base from "@yoltra/eslint-config-base";
19
+
20
+ export default [
21
+ ...base,
22
+ // your project-specific overrides
23
+ ];
24
+ ```
25
+
26
+ For React projects, use [`@yoltra/eslint-config-react`](../eslint-config-react), which extends this base.
27
+
28
+ ## License
29
+
30
+ MIT
package/index.js ADDED
@@ -0,0 +1,71 @@
1
+ import js from "@eslint/js";
2
+ import tseslint from "typescript-eslint";
3
+ import globals from "globals";
4
+
5
+ /**
6
+ * Shared ESLint flat config for Node.js + browser TypeScript libraries.
7
+ *
8
+ * Extends:
9
+ * - @eslint/js recommended
10
+ * - typescript-eslint recommended
11
+ *
12
+ * Targets files matching **\/*.{ts,tsx,mts,cts}.
13
+ *
14
+ * Usage in a consuming package:
15
+ *
16
+ * // eslint.config.mjs
17
+ * import baseConfig from "@yoltra/eslint-config-base";
18
+ * export default baseConfig;
19
+ *
20
+ * Or extend with package-specific overrides:
21
+ *
22
+ * // eslint.config.mjs
23
+ * import baseConfig from "@yoltra/eslint-config-base";
24
+ * export default [
25
+ * ...baseConfig,
26
+ * { rules: { "no-console": "off" } },
27
+ * ];
28
+ *
29
+ * @type {import("typescript-eslint").Config}
30
+ */
31
+ export default tseslint.config(
32
+ {
33
+ // Patterns that should never be linted
34
+ ignores: [
35
+ "dist/**",
36
+ "coverage/**",
37
+ "node_modules/**",
38
+ ".typedoc/**",
39
+ "**/*.d.ts",
40
+ ],
41
+ },
42
+ {
43
+ files: ["**/*.{ts,tsx,mts,cts}"],
44
+ extends: [js.configs.recommended, ...tseslint.configs.recommended],
45
+ languageOptions: {
46
+ ecmaVersion: 2020,
47
+ globals: {
48
+ ...globals.browser,
49
+ ...globals.node,
50
+ },
51
+ },
52
+ rules: {
53
+ // Downgrade to a warning so it does not block PRs when experimenting,
54
+ // but still surfaces typing gaps in code review.
55
+ "@typescript-eslint/no-explicit-any": "warn",
56
+
57
+ // Allow unused vars/args that are intentionally prefixed with underscore.
58
+ "@typescript-eslint/no-unused-vars": [
59
+ "error",
60
+ {
61
+ argsIgnorePattern: "^_",
62
+ varsIgnorePattern: "^_",
63
+ caughtErrorsIgnorePattern: "^_",
64
+ },
65
+ ],
66
+
67
+ // Allow console.warn and console.error for library-level diagnostics.
68
+ "no-console": ["warn", { allow: ["warn", "error"] }],
69
+ },
70
+ },
71
+ );
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@yoltra/eslint-config-base",
3
+ "version": "0.2.1",
4
+ "description": "Shared ESLint flat config for Node.js + browser TypeScript libraries",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "Manu Ramirez <@pixerael>",
8
+ "email": "manu@yoltra.dev"
9
+ },
10
+ "type": "module",
11
+ "main": "index.js",
12
+ "exports": {
13
+ ".": "./index.js"
14
+ },
15
+ "files": [
16
+ "index.js",
17
+ "LICENSE",
18
+ "README.md"
19
+ ],
20
+ "peerDependencies": {
21
+ "eslint": ">=9.0.0"
22
+ },
23
+ "dependencies": {
24
+ "@eslint/js": "^9.30.1",
25
+ "globals": "^16.3.0",
26
+ "typescript-eslint": "^8.35.1"
27
+ },
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "scripts": {
32
+ "build": "exit 0",
33
+ "lint": "exit 0"
34
+ }
35
+ }