@acme-skunkworks/eslint-config 1.0.5 → 1.1.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/README.md CHANGED
@@ -45,12 +45,12 @@ Pull in only the presets your project needs. Array presets are spread with `...`
45
45
 
46
46
  **Core** — the everyday stack:
47
47
 
48
- | Preset | Shape | What it covers |
49
- | ------------------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
50
- | `base` | array (`...`) | Plugin-alias hack, global ignores, the canonical baseline, `package.json` lint config, CommonJS file overrides, and the `preferences` block (top-level type imports, `func-style: declaration`, Prettier integration, import resolver, `no-console` warn). The "you almost always want this" stack. |
51
- | `typescript` | single | Overrides for `**/*.{ts,tsx}` — disables `react/no-unused-prop-types` and `react/prop-types`, which are redundant under TypeScript. |
52
- | `frameworkRouting` | array (`...`) | Turns off `canonical/filename-match-exported` for routing dirs — `routes/**`, `app/**`, `pages/**` (Next.js), `src/routes/**` (SvelteKit), `src/pages/**` (Astro) — and re-allows arrow functions on `root.tsx` / `*.route.tsx`. Spread **after** `base` (see Gotchas). |
53
- | `testing` | single | Relaxes strict TypeScript rules and `import/no-extraneous-dependencies` for `**/*.{test,spec}.*`, `__tests__/**`, and setup files. |
48
+ | Preset | Shape | What it covers |
49
+ | ------------------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
50
+ | `base` | array (`...`) | Plugin-alias hack, global ignores, the canonical baseline, `package.json` lint config, CommonJS **and ESM** file overrides (Node + ES globals for `.cjs` / `.mjs` so standalone scripts parse without `no-undef`), and the `preferences` block (top-level type imports, `func-style: declaration`, Prettier integration, import resolver, `no-console` warn). The "you almost always want this" stack. |
51
+ | `typescript` | single | Overrides for `**/*.{ts,tsx}` — disables `react/no-unused-prop-types` and `react/prop-types`, which are redundant under TypeScript. |
52
+ | `frameworkRouting` | array (`...`) | Turns off `canonical/filename-match-exported` for routing dirs — `routes/**`, `app/**`, `pages/**` (Next.js), `src/routes/**` (SvelteKit), `src/pages/**` (Astro) — and re-allows arrow functions on `root.tsx` / `*.route.tsx`. Spread **after** `base` (see Gotchas). |
53
+ | `testing` | single | Relaxes strict TypeScript rules and `import/no-extraneous-dependencies` for `**/*.{test,spec}.*`, `__tests__/**`, and setup files. |
54
54
 
55
55
  **Opt-in** — pull in per project:
56
56
 
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import type { Linter } from "eslint";
2
2
  /**
3
3
  * Base preset — the "you almost always want this" stack:
4
4
  * plugin-alias hack, global ignores, the canonical baseline, packageJson
5
- * lint config, commonjs file overrides, and the big preferences block
5
+ * lint config, commonjs + esm file overrides, and the big preferences block
6
6
  * (top-level type imports, func-style, prettier, import resolver, etc.).
7
7
  */
8
8
  export declare const base: Linter.Config[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAerC;;;;;GAKG;AACH,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAS/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAA4B,CAAC;AAE7D;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAG3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAkB,CAAC;AAEhD;;GAEG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD;;GAEG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;;;;;;GAQG;AACH,QAAA,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EASjC,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAerC;;;;;GAKG;AACH,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAU/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAA4B,CAAC;AAE7D;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAG3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAkB,CAAC;AAEhD;;GAEG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD;;GAEG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;;;;;;GAQG;AACH,QAAA,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EASjC,CAAC;AAEF,eAAe,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  /* eslint-disable @typescript-eslint/no-explicit-any */
3
3
  import { astro } from "./rules/astro.js";
4
4
  import { commonjs } from "./rules/commonjs.js";
5
+ import { esm } from "./rules/esm.js";
5
6
  import { frameworkRouting as frameworkRoutingRule } from "./rules/frameworkRouting.js";
6
7
  import { ignoredFileAndFolders } from "./rules/ignoredFileAndFolders.js";
7
8
  import { packageJson } from "./rules/packageJson.js";
@@ -26,7 +27,7 @@ const importXAlias = {
26
27
  /**
27
28
  * Base preset — the "you almost always want this" stack:
28
29
  * plugin-alias hack, global ignores, the canonical baseline, packageJson
29
- * lint config, commonjs file overrides, and the big preferences block
30
+ * lint config, commonjs + esm file overrides, and the big preferences block
30
31
  * (top-level type imports, func-style, prettier, import resolver, etc.).
31
32
  */
32
33
  export const base = [
@@ -37,6 +38,7 @@ export const base = [
37
38
  ...eslintConfigCanonicalAuto,
38
39
  packageJson,
39
40
  commonjs,
41
+ esm,
40
42
  preferences,
41
43
  ];
42
44
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"check-changelog-completeness.d.ts","sourceRoot":"","sources":["../../../infrastructure/scripts/check-changelog-completeness.ts"],"names":[],"mappings":";AAuBA,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAG5D;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAI1E;AAED,MAAM,MAAM,kBAAkB,GAAG;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjE,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,SAAS,MAAM,EAAE,GAC9B,kBAAkB,CAmBpB"}
1
+ {"version":3,"file":"check-changelog-completeness.d.ts","sourceRoot":"","sources":["../../../infrastructure/scripts/check-changelog-completeness.ts"],"names":[],"mappings":";AAwBA,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAG5D;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAI1E;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,SAAS,MAAM,EAAE,GAC9B,kBAAkB,CAmBpB"}
@@ -1,13 +1,14 @@
1
1
  #!/usr/bin/env -S npx tsx
2
2
  // Changelog-completeness gate (SK-371). A release-triggering PR title
3
- // (`feat`/`fix`/breaking) MUST carry a dated `changelog/` entry. This restores
3
+ // (`feat`/`fix`/`perf`/`revert`/breaking) MUST carry a dated `changelog/` entry. This restores
4
4
  // the coupling Changesets gave for free — no changeset → no release — now that
5
5
  // release-please infers the bump from the Conventional-Commit PR title rather
6
6
  // than an explicit file. Wired into ci.yml's build-and-lint job.
7
7
  //
8
- // "Release-triggering" mirrors release-please's default node bump table exactly:
9
- // only `feat` (minor), `fix` (patch), and a `!` breaking marker (major) cut a
10
- // release; `docs`/`chore`/`ci`/`refactor`/`perf`/`test`/`build`/`style` do not.
8
+ // "Release-triggering" mirrors release-please's default node bump table:
9
+ // `feat` (minor), `fix`/`perf`/`revert` (patch), and a `!` breaking marker
10
+ // (major) cut a release; `docs`/`chore`/`ci`/`refactor`/`test`/`build`/`style`
11
+ // do not.
11
12
  //
12
13
  // Inputs (env, set by the workflow):
13
14
  // PR_TITLE — the pull request title (github.event.pull_request.title)
@@ -15,7 +16,7 @@
15
16
  // Reads changed files from `git diff --name-only origin/<BASE_REF>...HEAD`.
16
17
  // Pure functions live exported for vitest.
17
18
  import { execFileSync } from "node:child_process";
18
- const RELEASE_TRIGGERING_TYPE = /^(feat|fix)(\([^)]+\))?:/;
19
+ const RELEASE_TRIGGERING_TYPE = /^(feat|fix|perf|revert)(\([^)]+\))?:/;
19
20
  const BREAKING_SUBJECT = /^[a-z]+(\([^)]+\))?!:/;
20
21
  const CHANGELOG_ENTRY = /^changelog\/.+\.md$/;
21
22
  export function isReleaseTriggering(prTitle) {
@@ -40,7 +41,7 @@ export function checkCompleteness(prTitle, changedFiles) {
40
41
  }
41
42
  return {
42
43
  ok: false,
43
- reason: `PR title "${prTitle}" triggers a release (feat/fix/breaking) but no changelog/*.md entry is present in the diff vs the base branch. Run /send-it (or add a dated changelog/ entry) so the release carries notes.`,
44
+ reason: `PR title "${prTitle}" triggers a release (feat/fix/perf/revert/breaking) but no changelog/*.md entry is present in the diff vs the base branch. Run /send-it (or add a dated changelog/ entry) so the release carries notes.`,
44
45
  };
45
46
  }
46
47
  function readChangedFiles(baseRef) {
@@ -0,0 +1,166 @@
1
+ /**
2
+ * Part of `base` — applied to every consumer.
3
+ *
4
+ * `.mjs` parser shim: the ESM counterpart to `commonjs`. Standalone ES-module
5
+ * scripts (`.mjs`) — build/maintenance tooling, skill helpers — run in Node but
6
+ * are not members of any tsconfig project, so the flat config gives them no
7
+ * environment globals and `console` / `process` trip `no-undef`. This sets
8
+ * `sourceType: "module"` plus Node + ES2021 globals so they parse cleanly. No
9
+ * rules — only `languageOptions`.
10
+ * @see https://eslint.org/docs/latest/use/configure/language-options
11
+ */
12
+ export declare const esm: {
13
+ files: string[];
14
+ ignores: string[];
15
+ languageOptions: {
16
+ globals: {
17
+ AggregateError: false;
18
+ Array: false;
19
+ ArrayBuffer: false;
20
+ Atomics: false;
21
+ BigInt: false;
22
+ BigInt64Array: false;
23
+ BigUint64Array: false;
24
+ Boolean: false;
25
+ DataView: false;
26
+ Date: false;
27
+ decodeURI: false;
28
+ decodeURIComponent: false;
29
+ encodeURI: false;
30
+ encodeURIComponent: false;
31
+ Error: false;
32
+ escape: false;
33
+ eval: false;
34
+ EvalError: false;
35
+ FinalizationRegistry: false;
36
+ Float32Array: false;
37
+ Float64Array: false;
38
+ Function: false;
39
+ globalThis: false;
40
+ Infinity: false;
41
+ Int16Array: false;
42
+ Int32Array: false;
43
+ Int8Array: false;
44
+ Intl: false;
45
+ isFinite: false;
46
+ isNaN: false;
47
+ JSON: false;
48
+ Map: false;
49
+ Math: false;
50
+ NaN: false;
51
+ Number: false;
52
+ Object: false;
53
+ parseFloat: false;
54
+ parseInt: false;
55
+ Promise: false;
56
+ Proxy: false;
57
+ RangeError: false;
58
+ ReferenceError: false;
59
+ Reflect: false;
60
+ RegExp: false;
61
+ Set: false;
62
+ SharedArrayBuffer: false;
63
+ String: false;
64
+ Symbol: false;
65
+ SyntaxError: false;
66
+ TypeError: false;
67
+ Uint16Array: false;
68
+ Uint32Array: false;
69
+ Uint8Array: false;
70
+ Uint8ClampedArray: false;
71
+ undefined: false;
72
+ unescape: false;
73
+ URIError: false;
74
+ WeakMap: false;
75
+ WeakRef: false;
76
+ WeakSet: false;
77
+ __dirname: false;
78
+ __filename: false;
79
+ AbortController: false;
80
+ AbortSignal: false;
81
+ AsyncDisposableStack: false;
82
+ atob: false;
83
+ Blob: false;
84
+ BroadcastChannel: false;
85
+ btoa: false;
86
+ Buffer: false;
87
+ ByteLengthQueuingStrategy: false;
88
+ clearImmediate: false;
89
+ clearInterval: false;
90
+ clearTimeout: false;
91
+ CloseEvent: false;
92
+ CompressionStream: false;
93
+ console: false;
94
+ CountQueuingStrategy: false;
95
+ crypto: false;
96
+ Crypto: false;
97
+ CryptoKey: false;
98
+ CustomEvent: false;
99
+ DecompressionStream: false;
100
+ DisposableStack: false;
101
+ DOMException: false;
102
+ ErrorEvent: false;
103
+ Event: false;
104
+ EventTarget: false;
105
+ exports: true;
106
+ fetch: false;
107
+ File: false;
108
+ FormData: false;
109
+ global: false;
110
+ Headers: false;
111
+ localStorage: false;
112
+ MessageChannel: false;
113
+ MessageEvent: false;
114
+ MessagePort: false;
115
+ module: false;
116
+ navigator: false;
117
+ Navigator: false;
118
+ performance: false;
119
+ Performance: false;
120
+ PerformanceEntry: false;
121
+ PerformanceMark: false;
122
+ PerformanceMeasure: false;
123
+ PerformanceObserver: false;
124
+ PerformanceObserverEntryList: false;
125
+ PerformanceResourceTiming: false;
126
+ process: false;
127
+ queueMicrotask: false;
128
+ ReadableByteStreamController: false;
129
+ ReadableStream: false;
130
+ ReadableStreamBYOBReader: false;
131
+ ReadableStreamBYOBRequest: false;
132
+ ReadableStreamDefaultController: false;
133
+ ReadableStreamDefaultReader: false;
134
+ Request: false;
135
+ require: false;
136
+ Response: false;
137
+ sessionStorage: false;
138
+ setImmediate: false;
139
+ setInterval: false;
140
+ setTimeout: false;
141
+ Storage: false;
142
+ structuredClone: false;
143
+ SubtleCrypto: false;
144
+ SuppressedError: false;
145
+ TextDecoder: false;
146
+ TextDecoderStream: false;
147
+ TextEncoder: false;
148
+ TextEncoderStream: false;
149
+ TransformStream: false;
150
+ TransformStreamDefaultController: false;
151
+ URL: false;
152
+ URLPattern: false;
153
+ URLSearchParams: false;
154
+ WebAssembly: false;
155
+ WebSocket: false;
156
+ WritableStream: false;
157
+ WritableStreamDefaultController: false;
158
+ WritableStreamDefaultWriter: false;
159
+ };
160
+ parserOptions: {
161
+ ecmaVersion: string;
162
+ };
163
+ sourceType: string;
164
+ };
165
+ };
166
+ //# sourceMappingURL=esm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esm.d.ts","sourceRoot":"","sources":["../../rules/esm.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcS,CAAC"}
@@ -0,0 +1,27 @@
1
+ import globals from "globals";
2
+ /**
3
+ * Part of `base` — applied to every consumer.
4
+ *
5
+ * `.mjs` parser shim: the ESM counterpart to `commonjs`. Standalone ES-module
6
+ * scripts (`.mjs`) — build/maintenance tooling, skill helpers — run in Node but
7
+ * are not members of any tsconfig project, so the flat config gives them no
8
+ * environment globals and `console` / `process` trip `no-undef`. This sets
9
+ * `sourceType: "module"` plus Node + ES2021 globals so they parse cleanly. No
10
+ * rules — only `languageOptions`.
11
+ * @see https://eslint.org/docs/latest/use/configure/language-options
12
+ */
13
+ export const esm = {
14
+ files: ["**/*.mjs"],
15
+ // Exclude node_modules
16
+ ignores: ["**/node_modules/**"],
17
+ languageOptions: {
18
+ globals: {
19
+ ...globals.node,
20
+ ...globals.es2021,
21
+ },
22
+ parserOptions: {
23
+ ecmaVersion: "latest",
24
+ },
25
+ sourceType: "module",
26
+ },
27
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acme-skunkworks/eslint-config",
3
- "version": "1.0.5",
3
+ "version": "1.1.0",
4
4
  "description": "Shared ESLint flat-config preset with TypeScript, React, Astro, Sanity, and Storybook support",
5
5
  "keywords": [
6
6
  "eslint",