@simpleapps-com/augur-config 2026.11.6 → 2026.11.7
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 +22 -11
- package/dist/chunk-JKW7DZVF.js +36 -0
- package/dist/chunk-JKW7DZVF.js.map +1 -0
- package/dist/{chunk-MAEDA54H.js → chunk-VUY2UVDX.js} +7 -5
- package/dist/chunk-VUY2UVDX.js.map +1 -0
- package/dist/eslint-next.d.ts +2 -1
- package/dist/eslint-next.d.ts.map +1 -1
- package/dist/eslint-next.js +10 -4
- package/dist/eslint-next.js.map +1 -1
- package/dist/eslint-rules.d.ts +8 -0
- package/dist/eslint-rules.d.ts.map +1 -1
- package/dist/eslint.js +1 -1
- package/dist/prettier-next.d.ts.map +1 -1
- package/dist/prettier-next.js +8 -11
- package/dist/prettier-next.js.map +1 -1
- package/dist/prettier-plugins.d.ts +4 -0
- package/dist/prettier-plugins.d.ts.map +1 -0
- package/dist/prettier-rules.d.ts +28 -0
- package/dist/prettier-rules.d.ts.map +1 -0
- package/dist/prettier.d.ts.map +1 -1
- package/dist/prettier.js +6 -1
- package/dist/prettier.js.map +1 -1
- package/package.json +8 -8
- package/dist/chunk-MAEDA54H.js.map +0 -1
package/README.md
CHANGED
|
@@ -32,19 +32,27 @@ pnpm add -D @simpleapps-com/augur-config
|
|
|
32
32
|
Both ESLint presets set every `eslint-plugin-react-hooks` rule by name from a proved table
|
|
33
33
|
(`src/eslint-rules.ts`): react-hooks 7.1's `recommended` severities, every other rule off until
|
|
34
34
|
named (#85). `eslint/next` loads `@next/eslint-plugin-next` 16 itself; a site MUST NOT also
|
|
35
|
-
install `eslint-config-next`, whose second copy of the plugin ESLint refuses.
|
|
35
|
+
install `eslint-config-next`, whose second copy of the plugin ESLint refuses. It runs the typed
|
|
36
|
+
rule `@typescript-eslint/no-deprecated` only on `.ts`/`.tsx`, with `parserOptions.projectService`
|
|
37
|
+
set there by the preset (proved `typedLintExtensions`, #87), so a site needs no setup of its own.
|
|
38
|
+
Peers: `eslint` 9 or 10, `typescript` 5 or 6.0 (`@typescript-eslint`'s range), `prettier` 3.
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
The Prettier presets name their plugins in a proved list (`src/prettier-rules.ts`, #87) and hand
|
|
41
|
+
Prettier each plugin's resolved file path (`src/prettier-plugins.ts`), not a bare name, which
|
|
42
|
+
Prettier would resolve from the site, where pnpm 10 doesn't hoist augur-config's dependencies.
|
|
43
|
+
`prettier/next` sorts imports with `@ianvs/prettier-plugin-sort-imports` at its defaults, with
|
|
44
|
+
`""` entries as the blank lines between the groups; Tailwind's plugin stays last.
|
|
38
45
|
|
|
39
|
-
|
|
40
|
-
`@lhci/cli` itself, at the optional peer range `^0.16.0` (Lighthouse 13, Node 22; atlas#86).
|
|
46
|
+
## Lighthouse CI and `pnpm audit`
|
|
41
47
|
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
The presets' own plugins bring no advisory into a site: a fresh install's `pnpm audit` is clean
|
|
49
|
+
(#87, after the sort plugin moved off trivago, whose `minimatch` ^9 had GHSA-g3hv-75wg-m249).
|
|
44
50
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
`lighthousePreset()` only builds a config object; a site that runs Lighthouse CI installs
|
|
52
|
+
`@lhci/cli` itself, at the optional peer range `^0.16.1` (Lighthouse 13, Node 22; atlas#86).
|
|
53
|
+
0.16.1 moved to `proxy-agent` 8, which cleared both the peer mismatch Puppeteer reported on 0.16.0
|
|
54
|
+
and the `basic-ftp` advisory (GHSA-c475-qrg2-pj4r) that came through it (2026-11-18). Its
|
|
55
|
+
`chrome-launcher` 0.13 still installs the deprecated `rimraf` 3 / `glob` 7 / `inflight`, upstream.
|
|
48
56
|
|
|
49
57
|
`braces` 3.0.3 through `@next/eslint-plugin-next` is not one: its advisory (GHSA-vfj7-8cjw-p6xm)
|
|
50
58
|
was withdrawn on 2026-10-23 as not practically exploitable, and `pnpm audit` no longer reports it.
|
|
@@ -79,8 +87,11 @@ TypeScript in `src/`, built to `dist/` (ESM) by tsup; the tsconfig presets ship
|
|
|
79
87
|
`src/tsconfig/`. The doctor's decisions are proved (`src/doctor/rules.ts`, model
|
|
80
88
|
`models/AugurConfig.dfy`, link `models/links/augur-config-doctor-rules.dfy`), and so are the
|
|
81
89
|
Lighthouse preset's (`src/lighthouse-rules.ts`, link `models/links/augur-config-lighthouse-rules.dfy`:
|
|
82
|
-
the URL list, the start-server condition, the collect defaults)
|
|
83
|
-
(`src/eslint-rules.ts`, link `models/links/augur-config-eslint-rules.dfy`)
|
|
90
|
+
the URL list, the start-server condition, the collect defaults), the React hooks table's
|
|
91
|
+
(`src/eslint-rules.ts`, link `models/links/augur-config-eslint-rules.dfy`) and the Prettier
|
|
92
|
+
presets' plugins and import groups (`src/prettier-rules.ts`, link
|
|
93
|
+
`models/links/augur-config-prettier-rules.dfy`; `test/fixtures/next-page.*.txt` is the golden
|
|
94
|
+
`prettier/next` output); the file reads
|
|
84
95
|
(`src/doctor/checks.ts`, `node-reader.ts`), the scorecard (`report.ts`) and the preset's object
|
|
85
96
|
building (`lighthouse.ts`, which lsc can't translate: `Record<string, unknown>` and spreads) are
|
|
86
97
|
tested at 100%.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// src/prettier-plugins.ts
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
function pluginPaths(names) {
|
|
4
|
+
return names.map((name) => fileURLToPath(import.meta.resolve(name)));
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// src/prettier-rules.ts
|
|
8
|
+
function prettierPlugins() {
|
|
9
|
+
return ["prettier-plugin-tailwindcss"];
|
|
10
|
+
}
|
|
11
|
+
function prettierNextPlugins() {
|
|
12
|
+
return ["@ianvs/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss"];
|
|
13
|
+
}
|
|
14
|
+
function prettierNextImportOrder() {
|
|
15
|
+
return [
|
|
16
|
+
"^react$",
|
|
17
|
+
"",
|
|
18
|
+
"<THIRD_PARTY_MODULES>",
|
|
19
|
+
"",
|
|
20
|
+
"^@/components/(.*)$",
|
|
21
|
+
"",
|
|
22
|
+
"^@/hooks/(.*)$",
|
|
23
|
+
"",
|
|
24
|
+
"^@/lib/(.*)$",
|
|
25
|
+
"",
|
|
26
|
+
"^[./]"
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
pluginPaths,
|
|
32
|
+
prettierPlugins,
|
|
33
|
+
prettierNextPlugins,
|
|
34
|
+
prettierNextImportOrder
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=chunk-JKW7DZVF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/prettier-plugins.ts","../src/prettier-rules.ts"],"sourcesContent":["import { fileURLToPath } from \"node:url\";\nimport type { PluginName } from \"./prettier-rules\";\n\n/* The plugins resolve here, from augur-config's own dependencies, and go to Prettier as file\n paths: a bare name is resolved from the site, which on pnpm 10 can't see augur-config's\n dependencies (atlas#87). Not as module objects: Prettier's CLI reads every parser of an object\n plugin while resolving the config, and ianvs's ember and oxc parsers throw unless their own\n optional plugins are installed. Tailwind finds the sort plugin among the paths by resolving\n the same name itself. */\n\n/** The plugin files for the names a proved rule gives, in its order. */\nexport function pluginPaths(names: PluginName[]): string[] {\n return names.map((name) => fileURLToPath(import.meta.resolve(name)));\n}\n","//@ backend dafny\n\n/* The Prettier presets' plugins and prettier/next's import groups (atlas#87). Verified with\n LemmaScript → Dafny (model: models/AugurConfig.dfy, \"Prettier presets\"; link:\n models/links/augur-config-prettier-rules.dfy). `prettier.ts` and `prettier-next.ts` load the\n named plugins and decide nothing themselves; `test/prettier-rules.test.ts` pins the sort\n plugin's dependencies against its installed package.json. */\n\n/** A plugin a Prettier preset loads. */\nexport type PluginName = \"@ianvs/prettier-plugin-sort-imports\" | \"prettier-plugin-tailwindcss\";\n\n/**\n * The base preset's plugins: Tailwind class sorting only.\n *\n * @ensures exactly the model's PrettierPlugins\n */\nexport function prettierPlugins(): PluginName[] {\n //@ verify\n //@ ensures \\result.length === 1 && \\result[0] === \"prettier-plugin-tailwindcss\"\n return [\"prettier-plugin-tailwindcss\"];\n}\n\n/**\n * prettier/next's plugins: the ianvs import sorter, then Tailwind, which MUST be last.\n *\n * @ensures exactly the model's PrettierNextPlugins\n */\nexport function prettierNextPlugins(): PluginName[] {\n //@ verify\n //@ ensures \\result.length === 2 && \\result[0] === \"@ianvs/prettier-plugin-sort-imports\" && \\result[1] === \"prettier-plugin-tailwindcss\"\n return [\"@ianvs/prettier-plugin-sort-imports\", \"prettier-plugin-tailwindcss\"];\n}\n\n/**\n * prettier/next's import groups in order, with a \"\" (a blank line) between every two.\n *\n * @ensures exactly the model's ImportOrder\n */\nexport function prettierNextImportOrder(): string[] {\n //@ verify\n //@ ensures \\result.length === 11 && \\result[0] === \"^react$\" && \\result[1] === \"\" && \\result[2] === \"<THIRD_PARTY_MODULES>\" && \\result[3] === \"\" && \\result[4] === \"^@/components/(.*)$\" && \\result[5] === \"\" && \\result[6] === \"^@/hooks/(.*)$\" && \\result[7] === \"\" && \\result[8] === \"^@/lib/(.*)$\" && \\result[9] === \"\" && \\result[10] === \"^[./]\"\n return [\n \"^react$\",\n \"\",\n \"<THIRD_PARTY_MODULES>\",\n \"\",\n \"^@/components/(.*)$\",\n \"\",\n \"^@/hooks/(.*)$\",\n \"\",\n \"^@/lib/(.*)$\",\n \"\",\n \"^[./]\",\n ];\n}\n\n/**\n * The sort plugin's declared dependencies (its package.json `dependencies` keys), none of them\n * minimatch.\n *\n * @ensures exactly the model's IanvsDependencies\n */\nexport function sortPluginDependencies(): string[] {\n //@ verify\n //@ ensures \\result.length === 5 && \\result[0] === \"@babel/generator\" && \\result[1] === \"@babel/parser\" && \\result[2] === \"@babel/traverse\" && \\result[3] === \"@babel/types\" && \\result[4] === \"semver\"\n return [\"@babel/generator\", \"@babel/parser\", \"@babel/traverse\", \"@babel/types\", \"semver\"];\n}\n"],"mappings":";AAAA,SAAS,qBAAqB;AAWvB,SAAS,YAAY,OAA+B;AACzD,SAAO,MAAM,IAAI,CAAC,SAAS,cAAc,YAAY,QAAQ,IAAI,CAAC,CAAC;AACrE;;;ACGO,SAAS,kBAAgC;AAG9C,SAAO,CAAC,6BAA6B;AACvC;AAOO,SAAS,sBAAoC;AAGlD,SAAO,CAAC,uCAAuC,6BAA6B;AAC9E;AAOO,SAAS,0BAAoC;AAGlD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
// src/eslint-shared.ts
|
|
2
|
-
import tsParser from "@typescript-eslint/parser";
|
|
3
|
-
import reactHooks from "eslint-plugin-react-hooks";
|
|
4
|
-
|
|
5
1
|
// src/eslint-rules.ts
|
|
6
2
|
function hooksCompilerErrorsConfigToPurity(name) {
|
|
7
3
|
return name === "config" || name === "error-boundaries" || name === "gating" || name === "globals" || name === "immutability" || name === "preserve-manual-memoization" || name === "purity";
|
|
@@ -15,6 +11,9 @@ function hooksRuleErrors(name) {
|
|
|
15
11
|
function hooksRuleWarns(name) {
|
|
16
12
|
return name === "exhaustive-deps" || name === "unsupported-syntax" || name === "incompatible-library";
|
|
17
13
|
}
|
|
14
|
+
function typedLintExtensions() {
|
|
15
|
+
return ["ts", "tsx"];
|
|
16
|
+
}
|
|
18
17
|
function hooksRuleSetting(name) {
|
|
19
18
|
if (hooksRuleErrors(name)) return "error";
|
|
20
19
|
if (hooksRuleWarns(name)) return "warn";
|
|
@@ -22,6 +21,8 @@ function hooksRuleSetting(name) {
|
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
// src/eslint-shared.ts
|
|
24
|
+
import tsParser from "@typescript-eslint/parser";
|
|
25
|
+
import reactHooks from "eslint-plugin-react-hooks";
|
|
25
26
|
var languageOptions = {
|
|
26
27
|
parser: tsParser,
|
|
27
28
|
parserOptions: {
|
|
@@ -44,9 +45,10 @@ var sharedRules = {
|
|
|
44
45
|
var ignored = { ignores: ["dist/", "node_modules/", ".turbo/", ".next/"] };
|
|
45
46
|
|
|
46
47
|
export {
|
|
48
|
+
typedLintExtensions,
|
|
47
49
|
languageOptions,
|
|
48
50
|
reactHooksRules,
|
|
49
51
|
sharedRules,
|
|
50
52
|
ignored
|
|
51
53
|
};
|
|
52
|
-
//# sourceMappingURL=chunk-
|
|
54
|
+
//# sourceMappingURL=chunk-VUY2UVDX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eslint-rules.ts","../src/eslint-shared.ts"],"sourcesContent":["//@ backend dafny\n\n/* The setting each eslint-plugin-react-hooks rule gets in both ESLint presets (atlas#85), named\n one by one so a site sees what it is held to. Verified with LemmaScript → Dafny (model:\n models/AugurConfig.dfy, \"React hooks rules\"; link: models/links/augur-config-eslint-rules.dfy).\n The values are react-hooks 7.1.1's `recommended` as sites have run it since the import (owner\n 2026-11-12: keep them); every other rule, one a later plugin adds included, is off until named\n here, and `test/eslint-rules.test.ts` fails when the plugin's `recommended` and this table part. */\n\n/** An ESLint rule setting. */\nexport type RuleSetting = \"error\" | \"warn\" | \"off\";\n\n/**\n * The React Compiler error rules from `config` to `purity`, alphabetical (the first half).\n *\n * @ensures exactly the model's HooksCompilerErrorsConfigToPurity\n */\nexport function hooksCompilerErrorsConfigToPurity(name: string): boolean {\n //@ verify\n //@ ensures \\result === (name === \"config\" || name === \"error-boundaries\" || name === \"gating\" || name === \"globals\" || name === \"immutability\" || name === \"preserve-manual-memoization\" || name === \"purity\")\n return (\n name === \"config\" ||\n name === \"error-boundaries\" ||\n name === \"gating\" ||\n name === \"globals\" ||\n name === \"immutability\" ||\n name === \"preserve-manual-memoization\" ||\n name === \"purity\"\n );\n}\n\n/**\n * The React Compiler error rules from `refs` to `use-memo`, alphabetical (the second half).\n *\n * @ensures exactly the model's HooksCompilerErrorsRefsToUseMemo\n */\nexport function hooksCompilerErrorsRefsToUseMemo(name: string): boolean {\n //@ verify\n //@ ensures \\result === (name === \"refs\" || name === \"set-state-in-effect\" || name === \"set-state-in-render\" || name === \"static-components\" || name === \"use-memo\")\n return (\n name === \"refs\" ||\n name === \"set-state-in-effect\" ||\n name === \"set-state-in-render\" ||\n name === \"static-components\" ||\n name === \"use-memo\"\n );\n}\n\n/**\n * The rules set to `error`: the classic `rules-of-hooks`, then the React Compiler rules\n * react-hooks 7.1.1 recommends at error.\n *\n * @ensures exactly the model's HooksRuleErrors\n */\nexport function hooksRuleErrors(name: string): boolean {\n //@ verify\n //@ ensures \\result === (name === \"rules-of-hooks\" || name === \"config\" || name === \"error-boundaries\" || name === \"gating\" || name === \"globals\" || name === \"immutability\" || name === \"preserve-manual-memoization\" || name === \"purity\" || name === \"refs\" || name === \"set-state-in-effect\" || name === \"set-state-in-render\" || name === \"static-components\" || name === \"use-memo\")\n return (\n name === \"rules-of-hooks\" ||\n hooksCompilerErrorsConfigToPurity(name) ||\n hooksCompilerErrorsRefsToUseMemo(name)\n );\n}\n\n/**\n * The rules set to `warn`: the classic `exhaustive-deps`, then the React Compiler rules\n * react-hooks 7.1.1 recommends at warning.\n *\n * @ensures exactly the model's HooksRuleWarns\n */\nexport function hooksRuleWarns(name: string): boolean {\n //@ verify\n //@ ensures \\result === (name === \"exhaustive-deps\" || name === \"unsupported-syntax\" || name === \"incompatible-library\")\n return (\n name === \"exhaustive-deps\" || name === \"unsupported-syntax\" || name === \"incompatible-library\"\n );\n}\n\n/**\n * The extensions eslint/next lints with type information (`parserOptions.projectService`) and\n * runs its typed rule on (`@typescript-eslint/no-deprecated`): .ts and .tsx, which a site's\n * tsconfig covers; JS files get neither (atlas#87).\n *\n * @ensures exactly the model's TypedLintExtensions\n */\nexport function typedLintExtensions(): string[] {\n //@ verify\n //@ ensures \\result.length === 2 && \\result[0] === \"ts\" && \\result[1] === \"tsx\"\n return [\"ts\", \"tsx\"];\n}\n\n/**\n * The setting a react-hooks rule gets: error, warn, or off for every rule not named above.\n *\n * @ensures exactly the model's HooksRuleSetting\n */\nexport function hooksRuleSetting(name: string): RuleSetting {\n //@ verify\n //@ ensures \\result === (hooksRuleErrors(name) ? \"error\" : hooksRuleWarns(name) ? \"warn\" : \"off\")\n if (hooksRuleErrors(name)) return \"error\";\n if (hooksRuleWarns(name)) return \"warn\";\n return \"off\";\n}\n","import tsParser from \"@typescript-eslint/parser\";\nimport reactHooks from \"eslint-plugin-react-hooks\";\nimport { hooksRuleSetting } from \"./eslint-rules\";\n\n/**\n * A flat-config entry as these presets build it. Typed by its own shape, not ESLint's\n * `Linter.Config`: the presets serve the consumer's ESLint (peer `^9`), and the plugins'\n * declarations are written for that version, so the consumer's ESLint is what checks it.\n */\nexport interface PresetConfig {\n files?: string[];\n ignores?: string[];\n languageOptions?: Record<string, unknown>;\n plugins?: Record<string, unknown>;\n rules?: Record<string, unknown>;\n}\n\n/** The TypeScript parser with JSX, for both presets. */\nexport const languageOptions = {\n parser: tsParser,\n parserOptions: {\n ecmaFeatures: { jsx: true },\n },\n};\n\n/**\n * Every rule the installed eslint-plugin-react-hooks ships, at the proved table's setting\n * (`hooksRuleSetting`, atlas#85): named one by one, so a plugin upgrade switches no rule on by\n * itself (an unnamed rule is off).\n */\nexport const reactHooksRules: Record<string, string> = Object.fromEntries(\n Object.keys(reactHooks.rules).map((name) => [`react-hooks/${name}`, hooksRuleSetting(name)]),\n);\n\n/** The rules both presets set after the plugins' recommended ones. */\nexport const sharedRules = {\n \"@typescript-eslint/no-unused-vars\": [\n \"error\",\n { argsIgnorePattern: \"^_\", varsIgnorePattern: \"^_\" },\n ],\n \"@typescript-eslint/no-explicit-any\": \"warn\",\n complexity: [\"warn\", 15],\n \"max-depth\": [\"warn\", 4],\n \"max-nested-callbacks\": [\"warn\", 3],\n};\n\n/** The folders both presets leave alone. */\nexport const ignored: PresetConfig = { ignores: [\"dist/\", \"node_modules/\", \".turbo/\", \".next/\"] };\n"],"mappings":";AAiBO,SAAS,kCAAkC,MAAuB;AAGvE,SACE,SAAS,YACT,SAAS,sBACT,SAAS,YACT,SAAS,aACT,SAAS,kBACT,SAAS,iCACT,SAAS;AAEb;AAOO,SAAS,iCAAiC,MAAuB;AAGtE,SACE,SAAS,UACT,SAAS,yBACT,SAAS,yBACT,SAAS,uBACT,SAAS;AAEb;AAQO,SAAS,gBAAgB,MAAuB;AAGrD,SACE,SAAS,oBACT,kCAAkC,IAAI,KACtC,iCAAiC,IAAI;AAEzC;AAQO,SAAS,eAAe,MAAuB;AAGpD,SACE,SAAS,qBAAqB,SAAS,wBAAwB,SAAS;AAE5E;AASO,SAAS,sBAAgC;AAG9C,SAAO,CAAC,MAAM,KAAK;AACrB;AAOO,SAAS,iBAAiB,MAA2B;AAG1D,MAAI,gBAAgB,IAAI,EAAG,QAAO;AAClC,MAAI,eAAe,IAAI,EAAG,QAAO;AACjC,SAAO;AACT;;;ACtGA,OAAO,cAAc;AACrB,OAAO,gBAAgB;AAiBhB,IAAM,kBAAkB;AAAA,EAC7B,QAAQ;AAAA,EACR,eAAe;AAAA,IACb,cAAc,EAAE,KAAK,KAAK;AAAA,EAC5B;AACF;AAOO,IAAM,kBAA0C,OAAO;AAAA,EAC5D,OAAO,KAAK,WAAW,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe,IAAI,IAAI,iBAAiB,IAAI,CAAC,CAAC;AAC7F;AAGO,IAAM,cAAc;AAAA,EACzB,qCAAqC;AAAA,IACnC;AAAA,IACA,EAAE,mBAAmB,MAAM,mBAAmB,KAAK;AAAA,EACrD;AAAA,EACA,sCAAsC;AAAA,EACtC,YAAY,CAAC,QAAQ,EAAE;AAAA,EACvB,aAAa,CAAC,QAAQ,CAAC;AAAA,EACvB,wBAAwB,CAAC,QAAQ,CAAC;AACpC;AAGO,IAAM,UAAwB,EAAE,SAAS,CAAC,SAAS,iBAAiB,WAAW,QAAQ,EAAE;","names":[]}
|
package/dist/eslint-next.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ import { type PresetConfig } from "./eslint-shared";
|
|
|
4
4
|
* (`@next/eslint-plugin-next` 16, matching the platform's Next 16.4.5 floor), and every React
|
|
5
5
|
* hooks rule at the proved table's setting (`eslint-rules.ts`).
|
|
6
6
|
*
|
|
7
|
-
* Also warns on deprecated APIs (no-deprecated).
|
|
7
|
+
* Also warns on deprecated APIs (no-deprecated) in .ts and .tsx, which it lints with the
|
|
8
|
+
* TypeScript project service so the rule has type information (atlas#87); JS files get neither.
|
|
8
9
|
*/
|
|
9
10
|
declare const config: PresetConfig[];
|
|
10
11
|
export default config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint-next.d.ts","sourceRoot":"","sources":["../src/eslint-next.ts"],"names":[],"mappings":"AAGA,OAAO,EAKL,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"eslint-next.d.ts","sourceRoot":"","sources":["../src/eslint-next.ts"],"names":[],"mappings":"AAGA,OAAO,EAKL,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAC;AAMzB;;;;;;;GAOG;AACH,QAAA,MAAM,MAAM,EAAE,YAAY,EAuBzB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/eslint-next.js
CHANGED
|
@@ -2,13 +2,15 @@ import {
|
|
|
2
2
|
ignored,
|
|
3
3
|
languageOptions,
|
|
4
4
|
reactHooksRules,
|
|
5
|
-
sharedRules
|
|
6
|
-
|
|
5
|
+
sharedRules,
|
|
6
|
+
typedLintExtensions
|
|
7
|
+
} from "./chunk-VUY2UVDX.js";
|
|
7
8
|
|
|
8
9
|
// src/eslint-next.ts
|
|
9
10
|
import nextPlugin from "@next/eslint-plugin-next";
|
|
10
11
|
import tseslint from "@typescript-eslint/eslint-plugin";
|
|
11
12
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
13
|
+
var typedFiles = `**/*.{${typedLintExtensions().join(",")}}`;
|
|
12
14
|
var config = [
|
|
13
15
|
{
|
|
14
16
|
files: ["**/*.{ts,tsx,js,jsx}"],
|
|
@@ -23,10 +25,14 @@ var config = [
|
|
|
23
25
|
...reactHooksRules,
|
|
24
26
|
...nextPlugin.configs.recommended.rules,
|
|
25
27
|
...nextPlugin.configs["core-web-vitals"].rules,
|
|
26
|
-
...sharedRules
|
|
27
|
-
"@typescript-eslint/no-deprecated": "warn"
|
|
28
|
+
...sharedRules
|
|
28
29
|
}
|
|
29
30
|
},
|
|
31
|
+
{
|
|
32
|
+
files: [typedFiles],
|
|
33
|
+
languageOptions: { parserOptions: { projectService: true } },
|
|
34
|
+
rules: { "@typescript-eslint/no-deprecated": "warn" }
|
|
35
|
+
},
|
|
30
36
|
ignored
|
|
31
37
|
];
|
|
32
38
|
var eslint_next_default = config;
|
package/dist/eslint-next.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/eslint-next.ts"],"sourcesContent":["import nextPlugin from \"@next/eslint-plugin-next\";\nimport tseslint from \"@typescript-eslint/eslint-plugin\";\nimport reactHooks from \"eslint-plugin-react-hooks\";\nimport {\n ignored,\n languageOptions,\n reactHooksRules,\n sharedRules,\n type PresetConfig,\n} from \"./eslint-shared\";\n\n/**\n * The ESLint preset for Next.js sites: the base rules plus Next's recommended and Core Web Vitals\n * (`@next/eslint-plugin-next` 16, matching the platform's Next 16.4.5 floor), and every React\n * hooks rule at the proved table's setting (`eslint-rules.ts`).\n *\n * Also warns on deprecated APIs (no-deprecated).\n */\nconst config: PresetConfig[] = [\n {\n files: [\"**/*.{ts,tsx,js,jsx}\"],\n languageOptions,\n plugins: {\n \"@typescript-eslint\": tseslint,\n \"react-hooks\": reactHooks,\n \"@next/next\": nextPlugin,\n },\n rules: {\n ...tseslint.configs[\"recommended\"]?.rules,\n ...reactHooksRules,\n ...nextPlugin.configs.recommended.rules,\n ...nextPlugin.configs[\"core-web-vitals\"].rules,\n ...sharedRules,\n
|
|
1
|
+
{"version":3,"sources":["../src/eslint-next.ts"],"sourcesContent":["import nextPlugin from \"@next/eslint-plugin-next\";\nimport tseslint from \"@typescript-eslint/eslint-plugin\";\nimport reactHooks from \"eslint-plugin-react-hooks\";\nimport {\n ignored,\n languageOptions,\n reactHooksRules,\n sharedRules,\n type PresetConfig,\n} from \"./eslint-shared\";\nimport { typedLintExtensions } from \"./eslint-rules\";\n\n/** The files linted with type information: `**\\/*.{ts,tsx}`. */\nconst typedFiles = `**/*.{${typedLintExtensions().join(\",\")}}`;\n\n/**\n * The ESLint preset for Next.js sites: the base rules plus Next's recommended and Core Web Vitals\n * (`@next/eslint-plugin-next` 16, matching the platform's Next 16.4.5 floor), and every React\n * hooks rule at the proved table's setting (`eslint-rules.ts`).\n *\n * Also warns on deprecated APIs (no-deprecated) in .ts and .tsx, which it lints with the\n * TypeScript project service so the rule has type information (atlas#87); JS files get neither.\n */\nconst config: PresetConfig[] = [\n {\n files: [\"**/*.{ts,tsx,js,jsx}\"],\n languageOptions,\n plugins: {\n \"@typescript-eslint\": tseslint,\n \"react-hooks\": reactHooks,\n \"@next/next\": nextPlugin,\n },\n rules: {\n ...tseslint.configs[\"recommended\"]?.rules,\n ...reactHooksRules,\n ...nextPlugin.configs.recommended.rules,\n ...nextPlugin.configs[\"core-web-vitals\"].rules,\n ...sharedRules,\n },\n },\n {\n files: [typedFiles],\n languageOptions: { parserOptions: { projectService: true } },\n rules: { \"@typescript-eslint/no-deprecated\": \"warn\" },\n },\n ignored,\n];\n\nexport default config;\n"],"mappings":";;;;;;;;;AAAA,OAAO,gBAAgB;AACvB,OAAO,cAAc;AACrB,OAAO,gBAAgB;AAWvB,IAAM,aAAa,SAAS,oBAAoB,EAAE,KAAK,GAAG,CAAC;AAU3D,IAAM,SAAyB;AAAA,EAC7B;AAAA,IACE,OAAO,CAAC,sBAAsB;AAAA,IAC9B;AAAA,IACA,SAAS;AAAA,MACP,sBAAsB;AAAA,MACtB,eAAe;AAAA,MACf,cAAc;AAAA,IAChB;AAAA,IACA,OAAO;AAAA,MACL,GAAG,SAAS,QAAQ,aAAa,GAAG;AAAA,MACpC,GAAG;AAAA,MACH,GAAG,WAAW,QAAQ,YAAY;AAAA,MAClC,GAAG,WAAW,QAAQ,iBAAiB,EAAE;AAAA,MACzC,GAAG;AAAA,IACL;AAAA,EACF;AAAA,EACA;AAAA,IACE,OAAO,CAAC,UAAU;AAAA,IAClB,iBAAiB,EAAE,eAAe,EAAE,gBAAgB,KAAK,EAAE;AAAA,IAC3D,OAAO,EAAE,oCAAoC,OAAO;AAAA,EACtD;AAAA,EACA;AACF;AAEA,IAAO,sBAAQ;","names":[]}
|
package/dist/eslint-rules.d.ts
CHANGED
|
@@ -26,6 +26,14 @@ export declare function hooksRuleErrors(name: string): boolean;
|
|
|
26
26
|
* @ensures exactly the model's HooksRuleWarns
|
|
27
27
|
*/
|
|
28
28
|
export declare function hooksRuleWarns(name: string): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The extensions eslint/next lints with type information (`parserOptions.projectService`) and
|
|
31
|
+
* runs its typed rule on (`@typescript-eslint/no-deprecated`): .ts and .tsx, which a site's
|
|
32
|
+
* tsconfig covers; JS files get neither (atlas#87).
|
|
33
|
+
*
|
|
34
|
+
* @ensures exactly the model's TypedLintExtensions
|
|
35
|
+
*/
|
|
36
|
+
export declare function typedLintExtensions(): string[];
|
|
29
37
|
/**
|
|
30
38
|
* The setting a react-hooks rule gets: error, warn, or off for every rule not named above.
|
|
31
39
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint-rules.d.ts","sourceRoot":"","sources":["../src/eslint-rules.ts"],"names":[],"mappings":"AASA,8BAA8B;AAC9B,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAYvE;AAED;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAUtE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQrD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMpD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAM1D"}
|
|
1
|
+
{"version":3,"file":"eslint-rules.d.ts","sourceRoot":"","sources":["../src/eslint-rules.ts"],"names":[],"mappings":"AASA,8BAA8B;AAC9B,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAYvE;AAED;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAUtE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQrD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMpD;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,EAAE,CAI9C;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAM1D"}
|
package/dist/eslint.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prettier-next.d.ts","sourceRoot":"","sources":["../src/prettier-next.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"prettier-next.d.ts","sourceRoot":"","sources":["../src/prettier-next.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIvC,4FAA4F;AAC5F,QAAA,MAAM,MAAM,EAAE,MAWb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/prettier-next.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pluginPaths,
|
|
3
|
+
prettierNextImportOrder,
|
|
4
|
+
prettierNextPlugins
|
|
5
|
+
} from "./chunk-JKW7DZVF.js";
|
|
6
|
+
|
|
1
7
|
// src/prettier-next.ts
|
|
2
8
|
var config = {
|
|
3
9
|
semi: true,
|
|
@@ -8,17 +14,8 @@ var config = {
|
|
|
8
14
|
useTabs: false,
|
|
9
15
|
bracketSpacing: true,
|
|
10
16
|
arrowParens: "always",
|
|
11
|
-
importOrder:
|
|
12
|
-
|
|
13
|
-
"<THIRD_PARTY_MODULES>",
|
|
14
|
-
"^@/components/(.*)$",
|
|
15
|
-
"^@/hooks/(.*)$",
|
|
16
|
-
"^@/lib/(.*)$",
|
|
17
|
-
"^[./]"
|
|
18
|
-
],
|
|
19
|
-
importOrderSeparation: true,
|
|
20
|
-
importOrderSortSpecifiers: true,
|
|
21
|
-
plugins: ["@trivago/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss"]
|
|
17
|
+
importOrder: prettierNextImportOrder(),
|
|
18
|
+
plugins: pluginPaths(prettierNextPlugins())
|
|
22
19
|
};
|
|
23
20
|
var prettier_next_default = config;
|
|
24
21
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/prettier-next.ts"],"sourcesContent":["import type { Config } from \"prettier\";\n\n/** The Prettier preset for Next.js sites: the base options plus sorted, grouped imports. */\nconst config: Config = {\n semi: true,\n trailingComma: \"all\",\n singleQuote: false,\n printWidth: 100,\n tabWidth: 2,\n useTabs: false,\n bracketSpacing: true,\n arrowParens: \"always\",\n importOrder:
|
|
1
|
+
{"version":3,"sources":["../src/prettier-next.ts"],"sourcesContent":["import type { Config } from \"prettier\";\nimport { pluginPaths } from \"./prettier-plugins\";\nimport { prettierNextImportOrder, prettierNextPlugins } from \"./prettier-rules\";\n\n/** The Prettier preset for Next.js sites: the base options plus sorted, grouped imports. */\nconst config: Config = {\n semi: true,\n trailingComma: \"all\",\n singleQuote: false,\n printWidth: 100,\n tabWidth: 2,\n useTabs: false,\n bracketSpacing: true,\n arrowParens: \"always\",\n importOrder: prettierNextImportOrder(),\n plugins: pluginPaths(prettierNextPlugins()),\n};\n\nexport default config;\n"],"mappings":";;;;;;;AAKA,IAAM,SAAiB;AAAA,EACrB,MAAM;AAAA,EACN,eAAe;AAAA,EACf,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,SAAS;AAAA,EACT,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,aAAa,wBAAwB;AAAA,EACrC,SAAS,YAAY,oBAAoB,CAAC;AAC5C;AAEA,IAAO,wBAAQ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prettier-plugins.d.ts","sourceRoot":"","sources":["../src/prettier-plugins.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AASnD,wEAAwE;AACxE,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,MAAM,EAAE,CAEzD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** A plugin a Prettier preset loads. */
|
|
2
|
+
export type PluginName = "@ianvs/prettier-plugin-sort-imports" | "prettier-plugin-tailwindcss";
|
|
3
|
+
/**
|
|
4
|
+
* The base preset's plugins: Tailwind class sorting only.
|
|
5
|
+
*
|
|
6
|
+
* @ensures exactly the model's PrettierPlugins
|
|
7
|
+
*/
|
|
8
|
+
export declare function prettierPlugins(): PluginName[];
|
|
9
|
+
/**
|
|
10
|
+
* prettier/next's plugins: the ianvs import sorter, then Tailwind, which MUST be last.
|
|
11
|
+
*
|
|
12
|
+
* @ensures exactly the model's PrettierNextPlugins
|
|
13
|
+
*/
|
|
14
|
+
export declare function prettierNextPlugins(): PluginName[];
|
|
15
|
+
/**
|
|
16
|
+
* prettier/next's import groups in order, with a "" (a blank line) between every two.
|
|
17
|
+
*
|
|
18
|
+
* @ensures exactly the model's ImportOrder
|
|
19
|
+
*/
|
|
20
|
+
export declare function prettierNextImportOrder(): string[];
|
|
21
|
+
/**
|
|
22
|
+
* The sort plugin's declared dependencies (its package.json `dependencies` keys), none of them
|
|
23
|
+
* minimatch.
|
|
24
|
+
*
|
|
25
|
+
* @ensures exactly the model's IanvsDependencies
|
|
26
|
+
*/
|
|
27
|
+
export declare function sortPluginDependencies(): string[];
|
|
28
|
+
//# sourceMappingURL=prettier-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prettier-rules.d.ts","sourceRoot":"","sources":["../src/prettier-rules.ts"],"names":[],"mappings":"AAQA,wCAAwC;AACxC,MAAM,MAAM,UAAU,GAAG,qCAAqC,GAAG,6BAA6B,CAAC;AAE/F;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,UAAU,EAAE,CAI9C;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,UAAU,EAAE,CAIlD;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,EAAE,CAgBlD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAIjD"}
|
package/dist/prettier.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prettier.d.ts","sourceRoot":"","sources":["../src/prettier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"prettier.d.ts","sourceRoot":"","sources":["../src/prettier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIvC,4EAA4E;AAC5E,QAAA,MAAM,MAAM,EAAE,MAUb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/prettier.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pluginPaths,
|
|
3
|
+
prettierPlugins
|
|
4
|
+
} from "./chunk-JKW7DZVF.js";
|
|
5
|
+
|
|
1
6
|
// src/prettier.ts
|
|
2
7
|
var config = {
|
|
3
8
|
semi: true,
|
|
@@ -8,7 +13,7 @@ var config = {
|
|
|
8
13
|
useTabs: false,
|
|
9
14
|
bracketSpacing: true,
|
|
10
15
|
arrowParens: "always",
|
|
11
|
-
plugins:
|
|
16
|
+
plugins: pluginPaths(prettierPlugins())
|
|
12
17
|
};
|
|
13
18
|
var prettier_default = config;
|
|
14
19
|
export {
|
package/dist/prettier.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/prettier.ts"],"sourcesContent":["import type { Config } from \"prettier\";\n\n/** The Prettier preset for Augur packages (with Tailwind class sorting). */\nconst config: Config = {\n semi: true,\n trailingComma: \"all\",\n singleQuote: false,\n printWidth: 100,\n tabWidth: 2,\n useTabs: false,\n bracketSpacing: true,\n arrowParens: \"always\",\n plugins:
|
|
1
|
+
{"version":3,"sources":["../src/prettier.ts"],"sourcesContent":["import type { Config } from \"prettier\";\nimport { pluginPaths } from \"./prettier-plugins\";\nimport { prettierPlugins } from \"./prettier-rules\";\n\n/** The Prettier preset for Augur packages (with Tailwind class sorting). */\nconst config: Config = {\n semi: true,\n trailingComma: \"all\",\n singleQuote: false,\n printWidth: 100,\n tabWidth: 2,\n useTabs: false,\n bracketSpacing: true,\n arrowParens: \"always\",\n plugins: pluginPaths(prettierPlugins()),\n};\n\nexport default config;\n"],"mappings":";;;;;;AAKA,IAAM,SAAiB;AAAA,EACrB,MAAM;AAAA,EACN,eAAe;AAAA,EACf,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,SAAS;AAAA,EACT,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,SAAS,YAAY,gBAAgB,CAAC;AACxC;AAEA,IAAO,mBAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simpleapps-com/augur-config",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.7",
|
|
4
4
|
"description": "Shared tooling configuration presets for Augur ecommerce sites",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -45,18 +45,18 @@
|
|
|
45
45
|
"llms.txt"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.7.1",
|
|
48
49
|
"@next/eslint-plugin-next": "^16.4.5",
|
|
49
|
-
"@trivago/prettier-plugin-sort-imports": "^6.0.0",
|
|
50
50
|
"@typescript-eslint/eslint-plugin": "^8.30.0",
|
|
51
51
|
"@typescript-eslint/parser": "^8.30.0",
|
|
52
52
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
53
|
-
"prettier-plugin-tailwindcss": "^0.
|
|
53
|
+
"prettier-plugin-tailwindcss": "^0.8.1"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"
|
|
56
|
+
"@lhci/cli": "^0.16.1",
|
|
57
|
+
"eslint": "^9.0.0 || ^10.0.0",
|
|
57
58
|
"prettier": "^3.0.0",
|
|
58
|
-
"typescript": "^5.0.0"
|
|
59
|
-
"@lhci/cli": "^0.16.0"
|
|
59
|
+
"typescript": "^5.0.0 || ~6.0.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependenciesMeta": {
|
|
62
62
|
"prettier": {
|
|
@@ -76,15 +76,15 @@
|
|
|
76
76
|
"@types/node": "^26.6.6",
|
|
77
77
|
"@vitest/coverage-v8": "~5.0.3",
|
|
78
78
|
"eslint": "^10.12.0",
|
|
79
|
-
"lemmascript": "0.6.
|
|
79
|
+
"lemmascript": "0.6.10",
|
|
80
80
|
"prettier": "^3.0.0",
|
|
81
81
|
"tsup": "^9.0.0",
|
|
82
82
|
"typescript": "~6.0.3",
|
|
83
83
|
"vitest": "~5.0.3",
|
|
84
84
|
"@atlas/eslint-config": "0.0.0",
|
|
85
|
+
"@atlas/foundation": "0.0.0",
|
|
85
86
|
"@atlas/tsconfig": "0.0.0",
|
|
86
87
|
"@atlas/tsup-config": "0.0.0",
|
|
87
|
-
"@atlas/foundation": "0.0.0",
|
|
88
88
|
"@atlas/utils": "0.0.0",
|
|
89
89
|
"@atlas/vitest-config": "0.0.0"
|
|
90
90
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/eslint-shared.ts","../src/eslint-rules.ts"],"sourcesContent":["import tsParser from \"@typescript-eslint/parser\";\nimport reactHooks from \"eslint-plugin-react-hooks\";\nimport { hooksRuleSetting } from \"./eslint-rules\";\n\n/**\n * A flat-config entry as these presets build it. Typed by its own shape, not ESLint's\n * `Linter.Config`: the presets serve the consumer's ESLint (peer `^9`), and the plugins'\n * declarations are written for that version, so the consumer's ESLint is what checks it.\n */\nexport interface PresetConfig {\n files?: string[];\n ignores?: string[];\n languageOptions?: Record<string, unknown>;\n plugins?: Record<string, unknown>;\n rules?: Record<string, unknown>;\n}\n\n/** The TypeScript parser with JSX, for both presets. */\nexport const languageOptions = {\n parser: tsParser,\n parserOptions: {\n ecmaFeatures: { jsx: true },\n },\n};\n\n/**\n * Every rule the installed eslint-plugin-react-hooks ships, at the proved table's setting\n * (`hooksRuleSetting`, atlas#85): named one by one, so a plugin upgrade switches no rule on by\n * itself (an unnamed rule is off).\n */\nexport const reactHooksRules: Record<string, string> = Object.fromEntries(\n Object.keys(reactHooks.rules).map((name) => [`react-hooks/${name}`, hooksRuleSetting(name)]),\n);\n\n/** The rules both presets set after the plugins' recommended ones. */\nexport const sharedRules = {\n \"@typescript-eslint/no-unused-vars\": [\n \"error\",\n { argsIgnorePattern: \"^_\", varsIgnorePattern: \"^_\" },\n ],\n \"@typescript-eslint/no-explicit-any\": \"warn\",\n complexity: [\"warn\", 15],\n \"max-depth\": [\"warn\", 4],\n \"max-nested-callbacks\": [\"warn\", 3],\n};\n\n/** The folders both presets leave alone. */\nexport const ignored: PresetConfig = { ignores: [\"dist/\", \"node_modules/\", \".turbo/\", \".next/\"] };\n","//@ backend dafny\n\n/* The setting each eslint-plugin-react-hooks rule gets in both ESLint presets (atlas#85), named\n one by one so a site sees what it is held to. Verified with LemmaScript → Dafny (model:\n models/AugurConfig.dfy, \"React hooks rules\"; link: models/links/augur-config-eslint-rules.dfy).\n The values are react-hooks 7.1.1's `recommended` as sites have run it since the import (owner\n 2026-11-12: keep them); every other rule, one a later plugin adds included, is off until named\n here, and `test/eslint-rules.test.ts` fails when the plugin's `recommended` and this table part. */\n\n/** An ESLint rule setting. */\nexport type RuleSetting = \"error\" | \"warn\" | \"off\";\n\n/**\n * The React Compiler error rules from `config` to `purity`, alphabetical (the first half).\n *\n * @ensures exactly the model's HooksCompilerErrorsConfigToPurity\n */\nexport function hooksCompilerErrorsConfigToPurity(name: string): boolean {\n //@ verify\n //@ ensures \\result === (name === \"config\" || name === \"error-boundaries\" || name === \"gating\" || name === \"globals\" || name === \"immutability\" || name === \"preserve-manual-memoization\" || name === \"purity\")\n return (\n name === \"config\" ||\n name === \"error-boundaries\" ||\n name === \"gating\" ||\n name === \"globals\" ||\n name === \"immutability\" ||\n name === \"preserve-manual-memoization\" ||\n name === \"purity\"\n );\n}\n\n/**\n * The React Compiler error rules from `refs` to `use-memo`, alphabetical (the second half).\n *\n * @ensures exactly the model's HooksCompilerErrorsRefsToUseMemo\n */\nexport function hooksCompilerErrorsRefsToUseMemo(name: string): boolean {\n //@ verify\n //@ ensures \\result === (name === \"refs\" || name === \"set-state-in-effect\" || name === \"set-state-in-render\" || name === \"static-components\" || name === \"use-memo\")\n return (\n name === \"refs\" ||\n name === \"set-state-in-effect\" ||\n name === \"set-state-in-render\" ||\n name === \"static-components\" ||\n name === \"use-memo\"\n );\n}\n\n/**\n * The rules set to `error`: the classic `rules-of-hooks`, then the React Compiler rules\n * react-hooks 7.1.1 recommends at error.\n *\n * @ensures exactly the model's HooksRuleErrors\n */\nexport function hooksRuleErrors(name: string): boolean {\n //@ verify\n //@ ensures \\result === (name === \"rules-of-hooks\" || name === \"config\" || name === \"error-boundaries\" || name === \"gating\" || name === \"globals\" || name === \"immutability\" || name === \"preserve-manual-memoization\" || name === \"purity\" || name === \"refs\" || name === \"set-state-in-effect\" || name === \"set-state-in-render\" || name === \"static-components\" || name === \"use-memo\")\n return (\n name === \"rules-of-hooks\" ||\n hooksCompilerErrorsConfigToPurity(name) ||\n hooksCompilerErrorsRefsToUseMemo(name)\n );\n}\n\n/**\n * The rules set to `warn`: the classic `exhaustive-deps`, then the React Compiler rules\n * react-hooks 7.1.1 recommends at warning.\n *\n * @ensures exactly the model's HooksRuleWarns\n */\nexport function hooksRuleWarns(name: string): boolean {\n //@ verify\n //@ ensures \\result === (name === \"exhaustive-deps\" || name === \"unsupported-syntax\" || name === \"incompatible-library\")\n return (\n name === \"exhaustive-deps\" || name === \"unsupported-syntax\" || name === \"incompatible-library\"\n );\n}\n\n/**\n * The setting a react-hooks rule gets: error, warn, or off for every rule not named above.\n *\n * @ensures exactly the model's HooksRuleSetting\n */\nexport function hooksRuleSetting(name: string): RuleSetting {\n //@ verify\n //@ ensures \\result === (hooksRuleErrors(name) ? \"error\" : hooksRuleWarns(name) ? \"warn\" : \"off\")\n if (hooksRuleErrors(name)) return \"error\";\n if (hooksRuleWarns(name)) return \"warn\";\n return \"off\";\n}\n"],"mappings":";AAAA,OAAO,cAAc;AACrB,OAAO,gBAAgB;;;ACgBhB,SAAS,kCAAkC,MAAuB;AAGvE,SACE,SAAS,YACT,SAAS,sBACT,SAAS,YACT,SAAS,aACT,SAAS,kBACT,SAAS,iCACT,SAAS;AAEb;AAOO,SAAS,iCAAiC,MAAuB;AAGtE,SACE,SAAS,UACT,SAAS,yBACT,SAAS,yBACT,SAAS,uBACT,SAAS;AAEb;AAQO,SAAS,gBAAgB,MAAuB;AAGrD,SACE,SAAS,oBACT,kCAAkC,IAAI,KACtC,iCAAiC,IAAI;AAEzC;AAQO,SAAS,eAAe,MAAuB;AAGpD,SACE,SAAS,qBAAqB,SAAS,wBAAwB,SAAS;AAE5E;AAOO,SAAS,iBAAiB,MAA2B;AAG1D,MAAI,gBAAgB,IAAI,EAAG,QAAO;AAClC,MAAI,eAAe,IAAI,EAAG,QAAO;AACjC,SAAO;AACT;;;ADvEO,IAAM,kBAAkB;AAAA,EAC7B,QAAQ;AAAA,EACR,eAAe;AAAA,IACb,cAAc,EAAE,KAAK,KAAK;AAAA,EAC5B;AACF;AAOO,IAAM,kBAA0C,OAAO;AAAA,EAC5D,OAAO,KAAK,WAAW,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe,IAAI,IAAI,iBAAiB,IAAI,CAAC,CAAC;AAC7F;AAGO,IAAM,cAAc;AAAA,EACzB,qCAAqC;AAAA,IACnC;AAAA,IACA,EAAE,mBAAmB,MAAM,mBAAmB,KAAK;AAAA,EACrD;AAAA,EACA,sCAAsC;AAAA,EACtC,YAAY,CAAC,QAAQ,EAAE;AAAA,EACvB,aAAa,CAAC,QAAQ,CAAC;AAAA,EACvB,wBAAwB,CAAC,QAAQ,CAAC;AACpC;AAGO,IAAM,UAAwB,EAAE,SAAS,CAAC,SAAS,iBAAiB,WAAW,QAAQ,EAAE;","names":[]}
|