@theholocron/eslint-config 8.9.0-alpha.1 → 8.9.0-alpha.16

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/README.md CHANGED
@@ -51,6 +51,11 @@ import { base, typescript } from "@theholocron/eslint-config";
51
51
  export default [...base(), ...typescript()];
52
52
  ```
53
53
 
54
+ `node()` pins `n/no-unsupported-features/node-builtins` and `es-builtins` to the org-wide Node floor (`>=22.0.0`)
55
+ instead of reading `engines.node`, so a run with no `package.json` to read (Sentinel's in-memory check) does not fall
56
+ back to `>=16.0.0` and flag `Object.hasOwn` or `Response`. `packageJson()` turns both off (a JSON file has no global
57
+ scope), and so does `library({ browserPackages })` for the packages it names.
58
+
54
59
  All other presets use subpath imports:
55
60
 
56
61
  ```javascript
@@ -85,7 +90,7 @@ export default [...library()];
85
90
 
86
91
  // With browser-targeted packages (turns off a Node-builtins rule that
87
92
  // false-positives on navigator/sessionStorage/KeyboardEvent/…):
88
- export default [...library({ browserPackages: ["packages/browser-utils/src"] })];
93
+ export default [...library({ browserPackages: ["utils/browser-utils/src"] })];
89
94
  ```
90
95
 
91
96
  Add project-specific configs after the bundle — they are merged in order:
@@ -1,12 +1,14 @@
1
1
  import { Linter } from "eslint";
2
+ /** Options for the `library()` ESLint bundle. */
2
3
  export interface LibraryOptions {
3
4
  /**
4
5
  * Package (or path) globs whose code runs in the browser, not Node —
5
- * `n/no-unsupported-features/node-builtins` false-positives on browser
6
+ * `n/no-unsupported-features/node-builtins` and `es-builtins` (both pinned to the Node floor) false-positive on browser
6
7
  * APIs (`navigator`, `sessionStorage`, `KeyboardEvent`, …) it doesn't
7
8
  * recognize. Each entry gets a `<glob>/**` files match with the rule
8
- * turned off. Rare — most repos need nothing here (`theholocron/utils`
9
- * is the one org repo that does, for its browser-targeted packages).
9
+ * turned off. Rare — most repos need nothing here (`utils/` in
10
+ * `theholocron/holocron` is the one place that does, for its
11
+ * browser-targeted packages).
10
12
  */
11
13
  browserPackages?: string[];
12
14
  }
@@ -27,9 +29,9 @@ export interface LibraryOptions {
27
29
  * `recommended-module` preset sets `n/no-extraneous-import: "error"` with no
28
30
  * `files` restriction, which otherwise clobbers `base()`'s earlier, more
29
31
  * specific `docs/src/**` exemption (flat config merges in array order, later
30
- * entries win per rule per matching file). Found live: `theholocron/clients`
31
- * still needed its own local override for this despite `base()` already
32
- * covering it in isolation.
32
+ * entries win per rule per matching file). Found live: the former
33
+ * `theholocron/clients` repo still needed its own local override for this
34
+ * despite `base()` already covering it in isolation.
33
35
  */
34
36
  export declare function library(options?: LibraryOptions): Linter.Config[];
35
37
  /**
@@ -1,7 +1,7 @@
1
1
  import { base, docsSrcConfig } from "../configs/base.js";
2
+ import { node } from "../configs/node.js";
2
3
  import { packageJson } from "../configs/package-json.js";
3
4
  import { typescript } from "../configs/typescript.js";
4
- import { node } from "../configs/node.js";
5
5
  import { vitest as vitestConfig } from "../configs/vitest.js";
6
6
  // bundles/library.ts
7
7
  /**
@@ -21,9 +21,9 @@ import { vitest as vitestConfig } from "../configs/vitest.js";
21
21
  * `recommended-module` preset sets `n/no-extraneous-import: "error"` with no
22
22
  * `files` restriction, which otherwise clobbers `base()`'s earlier, more
23
23
  * specific `docs/src/**` exemption (flat config merges in array order, later
24
- * entries win per rule per matching file). Found live: `theholocron/clients`
25
- * still needed its own local override for this despite `base()` already
26
- * covering it in isolation.
24
+ * entries win per rule per matching file). Found live: the former
25
+ * `theholocron/clients` repo still needed its own local override for this
26
+ * despite `base()` already covering it in isolation.
27
27
  */
28
28
  function library(options = {}) {
29
29
  return [
@@ -43,7 +43,10 @@ function library(options = {}) {
43
43
  ...options.browserPackages?.length ? [{
44
44
  name: "@theholocron/library/browser-packages",
45
45
  files: options.browserPackages.map((pkg) => `${pkg}/**`),
46
- rules: { "n/no-unsupported-features/node-builtins": "off" }
46
+ rules: {
47
+ "n/no-unsupported-features/node-builtins": "off",
48
+ "n/no-unsupported-features/es-builtins": "off"
49
+ }
47
50
  }] : []
48
51
  ];
49
52
  }
@@ -1,2 +1,6 @@
1
1
  import { Linter } from "eslint";
2
+ /**
3
+ * The ESLint bundle for a Next.js application: the base, TypeScript, React, Storybook, Cypress, Next.js and Vitest
4
+ * rules, plus the `package.json` rules.
5
+ */
2
6
  export declare function nextApp(): Linter.FlatConfig[];
@@ -1,12 +1,16 @@
1
1
  import { base } from "../configs/base.js";
2
- import { packageJson } from "../configs/package-json.js";
3
- import { typescript } from "../configs/typescript.js";
4
- import { vitest as vitestConfig } from "../configs/vitest.js";
5
2
  import { cypress as cypressConfig } from "../configs/cypress.js";
6
3
  import { next as nextConfig } from "../configs/next.js";
4
+ import { packageJson } from "../configs/package-json.js";
7
5
  import { react as reactConfig } from "../configs/react.js";
8
6
  import { storybook as storybookConfig } from "../configs/storybook.js";
7
+ import { typescript } from "../configs/typescript.js";
8
+ import { vitest as vitestConfig } from "../configs/vitest.js";
9
9
  // bundles/next-app.ts
10
+ /**
11
+ * The ESLint bundle for a Next.js application: the base, TypeScript, React, Storybook, Cypress, Next.js and Vitest
12
+ * rules, plus the `package.json` rules.
13
+ */
10
14
  function nextApp() {
11
15
  return [
12
16
  ...base(),
@@ -1,2 +1,6 @@
1
1
  import { Linter } from "eslint";
2
+ /**
3
+ * The ESLint bundle for a Node application: the base, Node, TypeScript and Vitest rules, plus the `package.json`
4
+ * rules.
5
+ */
2
6
  export declare function nodeApp(): Linter.Config[];
@@ -1,9 +1,13 @@
1
1
  import { base, docsSrcConfig } from "../configs/base.js";
2
+ import { node } from "../configs/node.js";
2
3
  import { packageJson } from "../configs/package-json.js";
3
4
  import { typescript } from "../configs/typescript.js";
4
- import { node } from "../configs/node.js";
5
5
  import { vitest as vitestConfig } from "../configs/vitest.js";
6
6
  // bundles/node-app.ts
7
+ /**
8
+ * The ESLint bundle for a Node application: the base, Node, TypeScript and Vitest rules, plus the `package.json`
9
+ * rules.
10
+ */
7
11
  function nodeApp() {
8
12
  return [
9
13
  ...base(),
@@ -1,2 +1,6 @@
1
1
  import { Linter } from "eslint";
2
+ /**
3
+ * The ESLint bundle for a React application: the base, TypeScript, React, Storybook and Vitest rules, plus the
4
+ * `package.json` rules.
5
+ */
2
6
  export declare function reactApp(): Linter.Config[];
@@ -1,10 +1,14 @@
1
1
  import { base } from "../configs/base.js";
2
2
  import { packageJson } from "../configs/package-json.js";
3
- import { typescript } from "../configs/typescript.js";
4
- import { vitest as vitestConfig } from "../configs/vitest.js";
5
3
  import { react as reactConfig } from "../configs/react.js";
6
4
  import { storybook as storybookConfig } from "../configs/storybook.js";
5
+ import { typescript } from "../configs/typescript.js";
6
+ import { vitest as vitestConfig } from "../configs/vitest.js";
7
7
  // bundles/react-app.ts
8
+ /**
9
+ * The ESLint bundle for a React application: the base, TypeScript, React, Storybook and Vitest rules, plus the
10
+ * `package.json` rules.
11
+ */
8
12
  function reactApp() {
9
13
  return [
10
14
  ...base(),
@@ -8,4 +8,5 @@ import { Linter } from "eslint";
8
8
  * than opt into per repo.
9
9
  */
10
10
  export declare const docsSrcConfig: Linter.Config;
11
+ /** The base ESLint flat config: the repo's `.gitignore` as ignores, browser and Node globals, `@eslint/js` recommended rules, import and export sorting, and a relaxed `n/no-extraneous-import` for `docs/src`. */
11
12
  export declare function base(): Linter.Config[];
@@ -51,6 +51,7 @@ const docsSrcConfig = {
51
51
  files: ["docs/src/**"],
52
52
  rules: { "n/no-extraneous-import": "off" }
53
53
  };
54
+ /** The base ESLint flat config: the repo's `.gitignore` as ignores, browser and Node globals, `@eslint/js` recommended rules, import and export sorting, and a relaxed `n/no-extraneous-import` for `docs/src`. */
54
55
  function base() {
55
56
  const gitignore = gitignoreConfig();
56
57
  return [
@@ -1,3 +1,4 @@
1
1
  import { Linter } from "eslint";
2
+ /** ESLint rules for Cypress tests (`cypress/**`). */
2
3
  export declare function cypressConfig(): Linter.FlatConfig[];
3
4
  export { cypressConfig as cypress };
@@ -1,5 +1,6 @@
1
1
  import cypress from "eslint-plugin-cypress";
2
2
  // configs/cypress.ts
3
+ /** ESLint rules for Cypress tests (`cypress/**`). */
3
4
  function cypressConfig() {
4
5
  return [{
5
6
  name: "@theholocron/cypress",
@@ -1,3 +1,4 @@
1
1
  import { Linter } from "eslint";
2
+ /** ESLint rules for JSDoc comments: the plugin's recommended TypeScript set, plus this repo's own rules. */
2
3
  export declare function jsdocConfig(): Linter.Config[];
3
4
  export { jsdocConfig as jsdoc };
@@ -1,5 +1,6 @@
1
1
  import jsdoc from "eslint-plugin-jsdoc";
2
2
  // configs/jsdoc.ts
3
+ /** ESLint rules for JSDoc comments: the plugin's recommended TypeScript set, plus this repo's own rules. */
3
4
  function jsdocConfig() {
4
5
  return [{
5
6
  ...jsdoc.configs["flat/recommended-typescript"],
@@ -1,3 +1,4 @@
1
1
  import { Linter } from "eslint";
2
+ /** ESLint rules for a Next.js app: the plugin's recommended and Core Web Vitals sets. */
2
3
  export declare function nextConfig(): Linter.FlatConfig[];
3
4
  export { nextConfig as next };
@@ -1,5 +1,6 @@
1
1
  import next from "@next/eslint-plugin-next";
2
2
  // configs/next.ts
3
+ /** ESLint rules for a Next.js app: the plugin's recommended and Core Web Vitals sets. */
3
4
  function nextConfig() {
4
5
  return [{
5
6
  name: "@theholocron/next",
@@ -1,2 +1,6 @@
1
1
  import { Linter } from "eslint";
2
+ /**
3
+ * ESLint rules for Node code: the `n` plugin's recommended ES module set, with the checks TypeScript already makes
4
+ * turned off.
5
+ */
2
6
  export declare function node(): Linter.FlatConfig[];
@@ -1,5 +1,9 @@
1
1
  import n from "eslint-plugin-n";
2
2
  // configs/node.ts
3
+ /**
4
+ * ESLint rules for Node code: the `n` plugin's recommended ES module set, with the checks TypeScript already makes
5
+ * turned off.
6
+ */
3
7
  function node() {
4
8
  return [n.configs["flat/recommended-module"], {
5
9
  name: "@theholocron/node",
@@ -7,7 +11,8 @@ function node() {
7
11
  "n/no-process-exit": "off",
8
12
  "n/no-missing-import": "off",
9
13
  "n/no-unsupported-features/es-syntax": "off",
10
- "n/no-unsupported-features/node-builtins": ["error", { version: ">=22.0.0" }]
14
+ "n/no-unsupported-features/node-builtins": ["error", { version: ">=22.0.0" }],
15
+ "n/no-unsupported-features/es-builtins": ["error", { version: ">=22.0.0" }]
11
16
  }
12
17
  }];
13
18
  }
@@ -1,2 +1,3 @@
1
1
  import { Linter } from "eslint";
2
+ /** ESLint flat config for `package.json` files: the `eslint-package-json` recommended rules, with the rules that misfire on pnpm catalogs and workspaces turned off. */
2
3
  export declare function packageJson(): Linter.Config[];
@@ -1,5 +1,6 @@
1
1
  import eslintPackageJson from "eslint-package-json";
2
2
  // configs/package-json.ts
3
+ /** ESLint flat config for `package.json` files: the `eslint-package-json` recommended rules, with the rules that misfire on pnpm catalogs and workspaces turned off. */
3
4
  function packageJson() {
4
5
  return [{
5
6
  name: "@theholocron/package-json",
@@ -11,6 +12,7 @@ function packageJson() {
11
12
  "package-json/no-workspace-protocol-in-published-package": "off",
12
13
  "no-irregular-whitespace": "off",
13
14
  "n/no-unsupported-features/node-builtins": "off",
15
+ "n/no-unsupported-features/es-builtins": "off",
14
16
  "n/no-extraneous-require": "off",
15
17
  "package-json/no-nested-exports": "off",
16
18
  "package-json/sort-properties": ["error", { order: [
@@ -1,3 +1,4 @@
1
1
  import { Linter } from "eslint";
2
+ /** ESLint rules for React: the recommended and JSX-runtime sets, applied to every script file. */
2
3
  export declare function reactConfig(): Linter.FlatConfig[];
3
4
  export { reactConfig as react };
@@ -1,6 +1,7 @@
1
1
  import { fixupConfigRules } from "@eslint/compat";
2
2
  import react from "eslint-plugin-react";
3
3
  // configs/react.ts
4
+ /** ESLint rules for React: the recommended and JSX-runtime sets, applied to every script file. */
4
5
  function reactConfig() {
5
6
  return fixupConfigRules([react.configs.flat.recommended, react.configs.flat["jsx-runtime"]]).map((config) => ({
6
7
  ...config,
@@ -1,3 +1,7 @@
1
1
  import { Linter } from "eslint";
2
+ /**
3
+ * ESLint rules for Storybook: the plugin's recommended set, with this repo's overrides for `.storybook/` and
4
+ * stories.
5
+ */
2
6
  export declare function storybookConfig(): Linter.FlatConfig[];
3
7
  export { storybookConfig as storybook };
@@ -1,5 +1,9 @@
1
1
  import storybook from "eslint-plugin-storybook";
2
2
  // configs/storybook.ts
3
+ /**
4
+ * ESLint rules for Storybook: the plugin's recommended set, with this repo's overrides for `.storybook/` and
5
+ * stories.
6
+ */
3
7
  function storybookConfig() {
4
8
  return [...storybook.configs["flat/recommended"], {
5
9
  name: "@theholocron/storybook-overrides",
@@ -1,2 +1,3 @@
1
1
  import { Linter } from "eslint";
2
+ /** ESLint flat config for TypeScript: the `typescript-eslint` recommended rules, with `no-unused-vars` ignoring names that start with an underscore. */
2
3
  export declare function typescript(): Linter.Config[];
@@ -1,5 +1,6 @@
1
1
  import tseslint from "typescript-eslint";
2
2
  // configs/typescript.ts
3
+ /** ESLint flat config for TypeScript: the `typescript-eslint` recommended rules, with `no-unused-vars` ignoring names that start with an underscore. */
3
4
  function typescript() {
4
5
  return [...tseslint.configs.recommended, {
5
6
  name: "@theholocron/typescript",
@@ -1,3 +1,4 @@
1
1
  import { Linter } from "eslint";
2
+ /** ESLint rules for Vitest test and setup files. */
2
3
  export declare function vitestConfig(): Linter.Config[];
3
4
  export { vitestConfig as vitest };
@@ -1,5 +1,6 @@
1
1
  import vitest from "@vitest/eslint-plugin";
2
2
  // configs/vitest.ts
3
+ /** ESLint rules for Vitest test and setup files. */
3
4
  function vitestConfig() {
4
5
  return [{
5
6
  name: "@theholocron/vitest",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/eslint-config",
3
- "version": "8.9.0-alpha.1",
3
+ "version": "8.9.0-alpha.16",
4
4
  "description": "A ESLint configuration for writing well-formed Javascript within the Galaxy.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -105,22 +105,22 @@
105
105
  "dist/"
106
106
  ],
107
107
  "dependencies": {
108
- "@eslint/compat": "^2.1.0",
109
- "eslint-package-json": "^0.3.0"
108
+ "@eslint/compat": "^2.1.1",
109
+ "eslint-package-json": "^3.0.0"
110
110
  },
111
111
  "devDependencies": {
112
112
  "@eslint/js": "^10.0.0",
113
- "@vitest/coverage-v8": "^5.0.5",
114
- "@vitest/eslint-plugin": "^1.6.23",
115
- "eslint-plugin-n": "^18.3.0",
113
+ "@vitest/coverage-v8": "^5.1.0",
114
+ "@vitest/eslint-plugin": "^1.6.28",
115
+ "eslint-plugin-n": "^18.5.0",
116
116
  "eslint-plugin-simple-import-sort": "^14.0.0",
117
- "globals": "^17.11.0",
118
- "tsdown": "^0.23.3",
117
+ "globals": "^17.14.0",
118
+ "tsdown": "^0.23.5",
119
119
  "typescript": "^5.9.3",
120
- "typescript-eslint": "^8.67.0",
121
- "vitest": "^5.0.5",
122
- "@theholocron/tsconfig": "8.9.0-alpha.1",
123
- "@theholocron/vitest-config": "8.9.0-alpha.1"
120
+ "typescript-eslint": "^8.72.1",
121
+ "vitest": "^5.1.0",
122
+ "@theholocron/tsconfig": "8.9.0-alpha.16",
123
+ "@theholocron/vitest-config": "8.9.0-alpha.16"
124
124
  },
125
125
  "peerDependencies": {
126
126
  "@eslint/js": "^10",
@@ -160,10 +160,10 @@
160
160
  "access": "public"
161
161
  },
162
162
  "scripts": {
163
- "delivery.build": "tsdown",
164
- "sourceQuality.staticAnalysis": "eslint .",
163
+ "build": "tsdown",
164
+ "lint:code": "eslint .",
165
+ "test:unit": "vitest run --coverage",
165
166
  "test:watch": "vitest",
166
- "verification.typeSafety": "tsc --noEmit",
167
- "verification.unitTests": "vitest run"
167
+ "typecheck": "tsc --noEmit"
168
168
  }
169
169
  }