@theholocron/eslint-config 8.9.0-alpha.1 → 8.9.0-alpha.15
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 +1 -1
- package/dist/bundles/library.d.ts +7 -5
- package/dist/bundles/library.js +4 -4
- package/dist/bundles/next-app.d.ts +4 -0
- package/dist/bundles/next-app.js +7 -3
- package/dist/bundles/node-app.d.ts +4 -0
- package/dist/bundles/node-app.js +5 -1
- package/dist/bundles/react-app.d.ts +4 -0
- package/dist/bundles/react-app.js +6 -2
- package/dist/configs/base.d.ts +1 -0
- package/dist/configs/base.js +1 -0
- package/dist/configs/cypress.d.ts +1 -0
- package/dist/configs/cypress.js +1 -0
- package/dist/configs/jsdoc.d.ts +1 -0
- package/dist/configs/jsdoc.js +1 -0
- package/dist/configs/next.d.ts +1 -0
- package/dist/configs/next.js +1 -0
- package/dist/configs/node.d.ts +4 -0
- package/dist/configs/node.js +4 -0
- package/dist/configs/package-json.d.ts +1 -0
- package/dist/configs/package-json.js +1 -0
- package/dist/configs/react.d.ts +1 -0
- package/dist/configs/react.js +1 -0
- package/dist/configs/storybook.d.ts +4 -0
- package/dist/configs/storybook.js +4 -0
- package/dist/configs/typescript.d.ts +1 -0
- package/dist/configs/typescript.js +1 -0
- package/dist/configs/vitest.d.ts +1 -0
- package/dist/configs/vitest.js +1 -0
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -85,7 +85,7 @@ export default [...library()];
|
|
|
85
85
|
|
|
86
86
|
// With browser-targeted packages (turns off a Node-builtins rule that
|
|
87
87
|
// false-positives on navigator/sessionStorage/KeyboardEvent/…):
|
|
88
|
-
export default [...library({ browserPackages: ["
|
|
88
|
+
export default [...library({ browserPackages: ["utils/browser-utils/src"] })];
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
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
6
|
* `n/no-unsupported-features/node-builtins` false-positives 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 (`
|
|
9
|
-
* is the one
|
|
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:
|
|
31
|
-
* still needed its own local override for this
|
|
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
|
/**
|
package/dist/bundles/library.js
CHANGED
|
@@ -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:
|
|
25
|
-
* still needed its own local override for this
|
|
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 [
|
package/dist/bundles/next-app.js
CHANGED
|
@@ -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(),
|
package/dist/bundles/node-app.js
CHANGED
|
@@ -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,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(),
|
package/dist/configs/base.d.ts
CHANGED
|
@@ -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[];
|
package/dist/configs/base.js
CHANGED
|
@@ -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 [
|
package/dist/configs/cypress.js
CHANGED
package/dist/configs/jsdoc.d.ts
CHANGED
package/dist/configs/jsdoc.js
CHANGED
package/dist/configs/next.d.ts
CHANGED
package/dist/configs/next.js
CHANGED
package/dist/configs/node.d.ts
CHANGED
package/dist/configs/node.js
CHANGED
|
@@ -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",
|
|
@@ -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",
|
package/dist/configs/react.d.ts
CHANGED
package/dist/configs/react.js
CHANGED
|
@@ -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,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",
|
package/dist/configs/vitest.d.ts
CHANGED
package/dist/configs/vitest.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/eslint-config",
|
|
3
|
-
"version": "8.9.0-alpha.
|
|
3
|
+
"version": "8.9.0-alpha.15",
|
|
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.
|
|
109
|
-
"eslint-package-json": "^
|
|
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
|
|
114
|
-
"@vitest/eslint-plugin": "^1.6.
|
|
115
|
-
"eslint-plugin-n": "^18.
|
|
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.
|
|
118
|
-
"tsdown": "^0.23.
|
|
117
|
+
"globals": "^17.14.0",
|
|
118
|
+
"tsdown": "^0.23.5",
|
|
119
119
|
"typescript": "^5.9.3",
|
|
120
|
-
"typescript-eslint": "^8.
|
|
121
|
-
"vitest": "^5.0
|
|
122
|
-
"@theholocron/tsconfig": "8.9.0-alpha.
|
|
123
|
-
"@theholocron/vitest-config": "8.9.0-alpha.
|
|
120
|
+
"typescript-eslint": "^8.72.1",
|
|
121
|
+
"vitest": "^5.1.0",
|
|
122
|
+
"@theholocron/tsconfig": "8.9.0-alpha.15",
|
|
123
|
+
"@theholocron/vitest-config": "8.9.0-alpha.15"
|
|
124
124
|
},
|
|
125
125
|
"peerDependencies": {
|
|
126
126
|
"@eslint/js": "^10",
|
|
@@ -160,10 +160,10 @@
|
|
|
160
160
|
"access": "public"
|
|
161
161
|
},
|
|
162
162
|
"scripts": {
|
|
163
|
-
"
|
|
164
|
-
"
|
|
163
|
+
"build": "tsdown",
|
|
164
|
+
"lint:code": "eslint .",
|
|
165
|
+
"test:unit": "vitest run --coverage",
|
|
165
166
|
"test:watch": "vitest",
|
|
166
|
-
"
|
|
167
|
-
"verification.unitTests": "vitest run"
|
|
167
|
+
"typecheck": "tsc --noEmit"
|
|
168
168
|
}
|
|
169
169
|
}
|