@simpleapps-com/augur-config 2.4.0 → 2026.11.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.
- package/EXPORTS.md +43 -44
- package/README.md +41 -29
- package/dist/augur-doctor.d.ts +13 -0
- package/dist/augur-doctor.d.ts.map +1 -0
- package/dist/augur-doctor.js +742 -0
- package/dist/augur-doctor.js.map +1 -0
- package/dist/chunk-RY3GDLDS.js +26 -0
- package/dist/chunk-RY3GDLDS.js.map +1 -0
- package/dist/chunk-ZV56KMH3.js +172 -0
- package/dist/chunk-ZV56KMH3.js.map +1 -0
- package/dist/doctor/checks.d.ts +34 -0
- package/dist/doctor/checks.d.ts.map +1 -0
- package/dist/doctor/cli.d.ts +11 -0
- package/dist/doctor/cli.d.ts.map +1 -0
- package/dist/doctor/node-reader.d.ts +7 -0
- package/dist/doctor/node-reader.d.ts.map +1 -0
- package/dist/doctor/report.d.ts +5 -0
- package/dist/doctor/report.d.ts.map +1 -0
- package/dist/doctor/rules.d.ts +227 -0
- package/dist/doctor/rules.d.ts.map +1 -0
- package/dist/eslint-next.d.ts +9 -0
- package/dist/eslint-next.d.ts.map +1 -0
- package/dist/eslint-next.js +35 -0
- package/dist/eslint-next.js.map +1 -0
- package/dist/eslint-shared.d.ts +36 -0
- package/dist/eslint-shared.d.ts.map +1 -0
- package/dist/eslint.d.ts +6 -0
- package/dist/eslint.d.ts.map +1 -0
- package/dist/eslint.js +30 -0
- package/dist/eslint.js.map +1 -0
- package/dist/lighthouse.d.ts +62 -0
- package/dist/lighthouse.d.ts.map +1 -0
- package/dist/lighthouse.js +68 -0
- package/dist/lighthouse.js.map +1 -0
- package/dist/prettier-next.d.ts +5 -0
- package/dist/prettier-next.d.ts.map +1 -0
- package/{src → dist}/prettier-next.js +9 -7
- package/dist/prettier-next.js.map +1 -0
- package/dist/prettier.d.ts +5 -0
- package/dist/prettier.d.ts.map +1 -0
- package/dist/prettier.js +17 -0
- package/dist/prettier.js.map +1 -0
- package/llms.txt +40 -20
- package/package.json +49 -12
- package/bin/augur-doctor.mjs +0 -1038
- package/src/eslint-next.js +0 -40
- package/src/eslint.js +0 -35
- package/src/lighthouse.js +0 -108
- package/src/prettier.js +0 -12
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/** A check's outcome. */
|
|
2
|
+
export type Status = "PASS" | "FAIL" | "WARN" | "SUGGEST" | "SKIP";
|
|
3
|
+
/**
|
|
4
|
+
* A file that should use a factory: there and using it passes; there without it warns; missing
|
|
5
|
+
* fails (site-config, server-site, ssr-options).
|
|
6
|
+
*
|
|
7
|
+
* @ensures exactly the model's FileUses
|
|
8
|
+
*/
|
|
9
|
+
export declare function fileUses(found: boolean, uses: boolean): Status;
|
|
10
|
+
/**
|
|
11
|
+
* actions: re-exporting passes, there otherwise warns; missing passes with the proxy pattern.
|
|
12
|
+
*
|
|
13
|
+
* @ensures exactly the model's ActionsStatus
|
|
14
|
+
*/
|
|
15
|
+
export declare function actionsStatus(found: boolean, reExports: boolean, usesProxy: boolean): Status;
|
|
16
|
+
/**
|
|
17
|
+
* site-hooks: createSiteHooks or another hooks setup passes; a file without either warns.
|
|
18
|
+
*
|
|
19
|
+
* @ensures exactly the model's SiteHooksStatus
|
|
20
|
+
*/
|
|
21
|
+
export declare function siteHooksStatus(found: boolean, createSiteHooks: boolean, hooksSetup: boolean): Status;
|
|
22
|
+
/**
|
|
23
|
+
* tsconfig: extends augur-config/tsconfig/next passes; another augur-config preset warns; else
|
|
24
|
+
* (or no tsconfig.json) fails.
|
|
25
|
+
*
|
|
26
|
+
* @ensures exactly the model's TsconfigStatus
|
|
27
|
+
*/
|
|
28
|
+
export declare function tsconfigStatus(found: boolean, extendsNext: boolean, extendsAugur: boolean): Status;
|
|
29
|
+
/**
|
|
30
|
+
* eslint and prettier: a config using the shared preset passes; every other case fails.
|
|
31
|
+
*
|
|
32
|
+
* @ensures exactly the model's PresetStatus
|
|
33
|
+
*/
|
|
34
|
+
export declare function presetStatus(found: boolean, usesPreset: boolean): Status;
|
|
35
|
+
/**
|
|
36
|
+
* eslint-deprecated: skipped without an ESLint config; on passes; named otherwise warns.
|
|
37
|
+
*
|
|
38
|
+
* @ensures exactly the model's DeprecatedStatus
|
|
39
|
+
*/
|
|
40
|
+
export declare function deprecatedStatus(hasEslint: boolean, ruleOn: boolean, named: boolean): Status;
|
|
41
|
+
/**
|
|
42
|
+
* knip: config and dependency pass; the dependency alone warns; else fails.
|
|
43
|
+
*
|
|
44
|
+
* @ensures exactly the model's KnipStatus
|
|
45
|
+
*/
|
|
46
|
+
export declare function knipStatus(hasConfig: boolean, hasDep: boolean): Status;
|
|
47
|
+
/**
|
|
48
|
+
* icons: react-icons alone passes; heroicons or lucide fails; none warns.
|
|
49
|
+
*
|
|
50
|
+
* @ensures exactly the model's IconsStatus
|
|
51
|
+
*/
|
|
52
|
+
export declare function iconsStatus(reactIcons: boolean, heroicons: boolean, lucide: boolean): Status;
|
|
53
|
+
/**
|
|
54
|
+
* tailwind: a range starting "^4" or "4" passes, "^3" or "3" fails, anything else warns.
|
|
55
|
+
*
|
|
56
|
+
* @ensures exactly the model's TailwindStatus
|
|
57
|
+
*/
|
|
58
|
+
export declare function tailwindStatus(range: string): Status;
|
|
59
|
+
/** What augur-doctor reads from next.config. */
|
|
60
|
+
export interface NextFacts {
|
|
61
|
+
hasConfig: boolean;
|
|
62
|
+
hasExternal: boolean;
|
|
63
|
+
externalHasServer: boolean;
|
|
64
|
+
usesIoredis: boolean;
|
|
65
|
+
externalHasIoredis: boolean;
|
|
66
|
+
hasAllHeaders: boolean;
|
|
67
|
+
hasHeaders: boolean;
|
|
68
|
+
hasOptimize: boolean;
|
|
69
|
+
hasStrict: boolean;
|
|
70
|
+
hasAgrMedia: boolean;
|
|
71
|
+
hasImages: boolean;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* next-external: augur-server MUST NOT be externalized; no serverExternalPackages warns.
|
|
75
|
+
*
|
|
76
|
+
* @ensures exactly the model's NextExternalStatus
|
|
77
|
+
*/
|
|
78
|
+
export declare function nextExternalStatus(n: NextFacts): Status;
|
|
79
|
+
/**
|
|
80
|
+
* next-ioredis: checked only when the site uses ioredis and has serverExternalPackages.
|
|
81
|
+
*
|
|
82
|
+
* @ensures exactly the model's IoredisStatus
|
|
83
|
+
*/
|
|
84
|
+
export declare function ioredisStatus(n: NextFacts): Status;
|
|
85
|
+
/**
|
|
86
|
+
* next-headers: HSTS, X-Content-Type-Options and Permissions-Policy all pass; some warns.
|
|
87
|
+
*
|
|
88
|
+
* @ensures exactly the model's HeadersStatus
|
|
89
|
+
*/
|
|
90
|
+
export declare function headersStatus(n: NextFacts): Status;
|
|
91
|
+
/**
|
|
92
|
+
* next-optimize: optimizePackageImports set passes, else fails.
|
|
93
|
+
*
|
|
94
|
+
* @ensures exactly the model's OptimizeStatus
|
|
95
|
+
*/
|
|
96
|
+
export declare function optimizeStatus(n: NextFacts): Status;
|
|
97
|
+
/**
|
|
98
|
+
* next-strict: reactStrictMode set passes, else warns; skipped with no config.
|
|
99
|
+
*
|
|
100
|
+
* @ensures exactly the model's StrictStatus
|
|
101
|
+
*/
|
|
102
|
+
export declare function strictStatus(n: NextFacts): Status;
|
|
103
|
+
/**
|
|
104
|
+
* image-loader: agr.media in next.config passes, else warns; skipped with no config.
|
|
105
|
+
*
|
|
106
|
+
* @ensures exactly the model's ImageLoaderStatus
|
|
107
|
+
*/
|
|
108
|
+
export declare function imageLoaderStatus(n: NextFacts): Status;
|
|
109
|
+
/**
|
|
110
|
+
* contract-tests: present passes, else fails.
|
|
111
|
+
*
|
|
112
|
+
* @ensures exactly the model's ContractTestsStatus
|
|
113
|
+
*/
|
|
114
|
+
export declare function contractTestsStatus(present: boolean): Status;
|
|
115
|
+
/**
|
|
116
|
+
* no-wrapper: skipped without lib/; a client file that wraps AugurAPI fails.
|
|
117
|
+
*
|
|
118
|
+
* @ensures exactly the model's NoWrapperStatus
|
|
119
|
+
*/
|
|
120
|
+
export declare function noWrapperStatus(hasLib: boolean, wraps: boolean): Status;
|
|
121
|
+
/**
|
|
122
|
+
* auth: a factory passes; raw NextAuth fails; otherwise (or no auth file) warns.
|
|
123
|
+
*
|
|
124
|
+
* @ensures exactly the model's AuthStatus
|
|
125
|
+
*/
|
|
126
|
+
export declare function authStatus(found: boolean, usesFactory: boolean, rawNextAuth: boolean): Status;
|
|
127
|
+
/**
|
|
128
|
+
* quality-script: typecheck, lint and test all named passes; incomplete warns; none fails.
|
|
129
|
+
*
|
|
130
|
+
* @ensures exactly the model's QualityStatus
|
|
131
|
+
*/
|
|
132
|
+
export declare function qualityStatus(hasScript: boolean, complete: boolean): Status;
|
|
133
|
+
/**
|
|
134
|
+
* pre-commit: lefthook's pre-commit section with lint-staged passes; else a suggestion.
|
|
135
|
+
*
|
|
136
|
+
* @ensures exactly the model's PreCommitStatus
|
|
137
|
+
*/
|
|
138
|
+
export declare function preCommitStatus(hasPreCommit: boolean, hasLintStaged: boolean): Status;
|
|
139
|
+
/**
|
|
140
|
+
* proxy-local-hooks: local useQuery hooks are a suggestion.
|
|
141
|
+
*
|
|
142
|
+
* @ensures exactly the model's LocalHooksStatus
|
|
143
|
+
*/
|
|
144
|
+
export declare function localHooksStatus(hasUseQuery: boolean): Status;
|
|
145
|
+
/**
|
|
146
|
+
* proxy-server-query: either proxy form passes, else a suggestion.
|
|
147
|
+
*
|
|
148
|
+
* @ensures exactly the model's ServerQueryStatus
|
|
149
|
+
*/
|
|
150
|
+
export declare function serverQueryStatus(usesServerProxy: boolean, usesAugurOptions: boolean): Status;
|
|
151
|
+
/**
|
|
152
|
+
* query-client-scope and query-gc-time: any offending file fails.
|
|
153
|
+
*
|
|
154
|
+
* @ensures exactly the model's NoOffenderStatus
|
|
155
|
+
*/
|
|
156
|
+
export declare function noOffenderStatus(offenders: number): Status;
|
|
157
|
+
/**
|
|
158
|
+
* An augur-api CalVer at or after 2026.3.7 has typed proxies.
|
|
159
|
+
*
|
|
160
|
+
* @ensures exactly the model's TypedProxyVersion
|
|
161
|
+
*/
|
|
162
|
+
export declare function typedProxyVersion(year: number, minor: number, patch: number): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* api-version: a recognised, typed CalVer passes; anything else warns.
|
|
165
|
+
*
|
|
166
|
+
* @ensures exactly the model's ApiVersionStatus
|
|
167
|
+
*/
|
|
168
|
+
export declare function apiVersionStatus(parsed: boolean, year: number, minor: number, patch: number): Status;
|
|
169
|
+
/**
|
|
170
|
+
* A range mark: ^ ~ > = < or whitespace (space, tab, line feed, carriage return).
|
|
171
|
+
*
|
|
172
|
+
* @ensures exactly the model's RangeMark on the code unit
|
|
173
|
+
*/
|
|
174
|
+
export declare function rangeMark(c: number): boolean;
|
|
175
|
+
/**
|
|
176
|
+
* A range's version: its leading range marks stripped.
|
|
177
|
+
*
|
|
178
|
+
* @ensures exactly the model's StripRange
|
|
179
|
+
*/
|
|
180
|
+
export declare function stripRange(s: string): string;
|
|
181
|
+
/** One installed augur package against its own latest. */
|
|
182
|
+
export type PackageState = "current" | "behind" | "unknown";
|
|
183
|
+
/**
|
|
184
|
+
* A package's state: unknown when npm could not say ("" here), current when its range's
|
|
185
|
+
* version is the latest, else behind.
|
|
186
|
+
*
|
|
187
|
+
* @ensures exactly the model's PackageStateOf
|
|
188
|
+
*/
|
|
189
|
+
export declare function packageStateOf(range: string, latest: string): PackageState;
|
|
190
|
+
/**
|
|
191
|
+
* How many of the states from index `i` are `s`.
|
|
192
|
+
*
|
|
193
|
+
* @ensures exactly the model's CountState
|
|
194
|
+
*/
|
|
195
|
+
export declare function countStateFrom(states: PackageState[], s: PackageState, i: number): number;
|
|
196
|
+
/**
|
|
197
|
+
* augur-version-latest: skipped with none installed; any package behind its own latest fails;
|
|
198
|
+
* else any unknown skips; else passes.
|
|
199
|
+
*
|
|
200
|
+
* @ensures exactly the model's LatestStatus
|
|
201
|
+
*/
|
|
202
|
+
export declare function latestStatus(states: PackageState[]): Status;
|
|
203
|
+
/**
|
|
204
|
+
* How many of the results from index `i` are `s`.
|
|
205
|
+
*
|
|
206
|
+
* @ensures exactly the model's CountStatus
|
|
207
|
+
*/
|
|
208
|
+
export declare function countStatusFrom(results: Status[], s: Status, i: number): number;
|
|
209
|
+
/**
|
|
210
|
+
* The scored total: skips and suggestions left out.
|
|
211
|
+
*
|
|
212
|
+
* @ensures exactly the model's ScoredTotal
|
|
213
|
+
*/
|
|
214
|
+
export declare function scoredTotal(results: Status[]): number;
|
|
215
|
+
/**
|
|
216
|
+
* The exit code: 1 on any failure, else 0.
|
|
217
|
+
*
|
|
218
|
+
* @ensures exactly the model's ExitCode
|
|
219
|
+
*/
|
|
220
|
+
export declare function exitCodeOf(results: Status[]): number;
|
|
221
|
+
/**
|
|
222
|
+
* Lighthouse: a URL starting "http" is used as is; a path gets the base URL in front.
|
|
223
|
+
*
|
|
224
|
+
* @ensures exactly the model's ResolveUrl
|
|
225
|
+
*/
|
|
226
|
+
export declare function resolveUrl(u: string, baseUrl: string): string;
|
|
227
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/doctor/rules.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type PresetConfig } from "./eslint-shared";
|
|
2
|
+
/**
|
|
3
|
+
* The ESLint preset for Next.js sites: the base rules plus Next's recommended and Core Web Vitals.
|
|
4
|
+
*
|
|
5
|
+
* Also warns on deprecated APIs (no-deprecated).
|
|
6
|
+
*/
|
|
7
|
+
declare const config: PresetConfig[];
|
|
8
|
+
export default config;
|
|
9
|
+
//# sourceMappingURL=eslint-next.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-next.d.ts","sourceRoot":"","sources":["../src/eslint-next.ts"],"names":[],"mappings":"AAGA,OAAO,EAAyC,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE3F;;;;GAIG;AACH,QAAA,MAAM,MAAM,EAAE,YAAY,EAmBzB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ignored,
|
|
3
|
+
languageOptions,
|
|
4
|
+
sharedRules
|
|
5
|
+
} from "./chunk-RY3GDLDS.js";
|
|
6
|
+
|
|
7
|
+
// src/eslint-next.ts
|
|
8
|
+
import nextPlugin from "@next/eslint-plugin-next";
|
|
9
|
+
import tseslint from "@typescript-eslint/eslint-plugin";
|
|
10
|
+
import reactHooks from "eslint-plugin-react-hooks";
|
|
11
|
+
var config = [
|
|
12
|
+
{
|
|
13
|
+
files: ["**/*.{ts,tsx,js,jsx}"],
|
|
14
|
+
languageOptions,
|
|
15
|
+
plugins: {
|
|
16
|
+
"@typescript-eslint": tseslint,
|
|
17
|
+
"react-hooks": reactHooks,
|
|
18
|
+
"@next/next": nextPlugin
|
|
19
|
+
},
|
|
20
|
+
rules: {
|
|
21
|
+
...tseslint.configs["recommended"]?.rules,
|
|
22
|
+
...reactHooks.configs.recommended.rules,
|
|
23
|
+
...nextPlugin.configs.recommended.rules,
|
|
24
|
+
...nextPlugin.configs["core-web-vitals"].rules,
|
|
25
|
+
...sharedRules,
|
|
26
|
+
"@typescript-eslint/no-deprecated": "warn"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
ignored
|
|
30
|
+
];
|
|
31
|
+
var eslint_next_default = config;
|
|
32
|
+
export {
|
|
33
|
+
eslint_next_default as default
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=eslint-next.js.map
|
|
@@ -0,0 +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 { ignored, languageOptions, sharedRules, type PresetConfig } 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 *\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 ...reactHooks.configs.recommended.rules,\n ...nextPlugin.configs.recommended.rules,\n ...nextPlugin.configs[\"core-web-vitals\"].rules,\n ...sharedRules,\n \"@typescript-eslint/no-deprecated\": \"warn\",\n },\n },\n ignored,\n];\n\nexport default config;\n"],"mappings":";;;;;;;AAAA,OAAO,gBAAgB;AACvB,OAAO,cAAc;AACrB,OAAO,gBAAgB;AAQvB,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,WAAW,QAAQ,YAAY;AAAA,MAClC,GAAG,WAAW,QAAQ,YAAY;AAAA,MAClC,GAAG,WAAW,QAAQ,iBAAiB,EAAE;AAAA,MACzC,GAAG;AAAA,MACH,oCAAoC;AAAA,IACtC;AAAA,EACF;AAAA,EACA;AACF;AAEA,IAAO,sBAAQ;","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import tsParser from "@typescript-eslint/parser";
|
|
2
|
+
/**
|
|
3
|
+
* A flat-config entry as these presets build it. Typed by its own shape, not ESLint's
|
|
4
|
+
* `Linter.Config`: the presets serve the consumer's ESLint (peer `^9`), and the plugins'
|
|
5
|
+
* declarations are written for that version, so the consumer's ESLint is what checks it.
|
|
6
|
+
*/
|
|
7
|
+
export interface PresetConfig {
|
|
8
|
+
files?: string[];
|
|
9
|
+
ignores?: string[];
|
|
10
|
+
languageOptions?: Record<string, unknown>;
|
|
11
|
+
plugins?: Record<string, unknown>;
|
|
12
|
+
rules?: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
/** The TypeScript parser with JSX, for both presets. */
|
|
15
|
+
export declare const languageOptions: {
|
|
16
|
+
parser: typeof tsParser;
|
|
17
|
+
parserOptions: {
|
|
18
|
+
ecmaFeatures: {
|
|
19
|
+
jsx: boolean;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/** The rules both presets set after the plugins' recommended ones. */
|
|
24
|
+
export declare const sharedRules: {
|
|
25
|
+
"@typescript-eslint/no-unused-vars": (string | {
|
|
26
|
+
argsIgnorePattern: string;
|
|
27
|
+
varsIgnorePattern: string;
|
|
28
|
+
})[];
|
|
29
|
+
"@typescript-eslint/no-explicit-any": string;
|
|
30
|
+
complexity: (string | number)[];
|
|
31
|
+
"max-depth": (string | number)[];
|
|
32
|
+
"max-nested-callbacks": (string | number)[];
|
|
33
|
+
};
|
|
34
|
+
/** The folders both presets leave alone. */
|
|
35
|
+
export declare const ignored: PresetConfig;
|
|
36
|
+
//# sourceMappingURL=eslint-shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-shared.d.ts","sourceRoot":"","sources":["../src/eslint-shared.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,2BAA2B,CAAC;AAEjD;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,wDAAwD;AACxD,eAAO,MAAM,eAAe;;;;;;;CAK3B,CAAC;AAEF,sEAAsE;AACtE,eAAO,MAAM,WAAW;;;;;;;;;CASvB,CAAC;AAEF,4CAA4C;AAC5C,eAAO,MAAM,OAAO,EAAE,YAA2E,CAAC"}
|
package/dist/eslint.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type PresetConfig } from "./eslint-shared";
|
|
2
|
+
export type { PresetConfig } from "./eslint-shared";
|
|
3
|
+
/** The ESLint preset for Augur packages and React sites. */
|
|
4
|
+
declare const config: PresetConfig[];
|
|
5
|
+
export default config;
|
|
6
|
+
//# sourceMappingURL=eslint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint.d.ts","sourceRoot":"","sources":["../src/eslint.ts"],"names":[],"mappings":"AAEA,OAAO,EAAyC,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE3F,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,4DAA4D;AAC5D,QAAA,MAAM,MAAM,EAAE,YAAY,EAezB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/eslint.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ignored,
|
|
3
|
+
languageOptions,
|
|
4
|
+
sharedRules
|
|
5
|
+
} from "./chunk-RY3GDLDS.js";
|
|
6
|
+
|
|
7
|
+
// src/eslint.ts
|
|
8
|
+
import tseslint from "@typescript-eslint/eslint-plugin";
|
|
9
|
+
import reactHooks from "eslint-plugin-react-hooks";
|
|
10
|
+
var config = [
|
|
11
|
+
{
|
|
12
|
+
files: ["**/*.{ts,tsx}"],
|
|
13
|
+
languageOptions,
|
|
14
|
+
plugins: {
|
|
15
|
+
"@typescript-eslint": tseslint,
|
|
16
|
+
"react-hooks": reactHooks
|
|
17
|
+
},
|
|
18
|
+
rules: {
|
|
19
|
+
...tseslint.configs["recommended"]?.rules,
|
|
20
|
+
...reactHooks.configs.recommended.rules,
|
|
21
|
+
...sharedRules
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
ignored
|
|
25
|
+
];
|
|
26
|
+
var eslint_default = config;
|
|
27
|
+
export {
|
|
28
|
+
eslint_default as default
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=eslint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eslint.ts"],"sourcesContent":["import tseslint from \"@typescript-eslint/eslint-plugin\";\nimport reactHooks from \"eslint-plugin-react-hooks\";\nimport { ignored, languageOptions, sharedRules, type PresetConfig } from \"./eslint-shared\";\n\nexport type { PresetConfig } from \"./eslint-shared\";\n\n/** The ESLint preset for Augur packages and React sites. */\nconst config: PresetConfig[] = [\n {\n files: [\"**/*.{ts,tsx}\"],\n languageOptions,\n plugins: {\n \"@typescript-eslint\": tseslint,\n \"react-hooks\": reactHooks,\n },\n rules: {\n ...tseslint.configs[\"recommended\"]?.rules,\n ...reactHooks.configs.recommended.rules,\n ...sharedRules,\n },\n },\n ignored,\n];\n\nexport default config;\n"],"mappings":";;;;;;;AAAA,OAAO,cAAc;AACrB,OAAO,gBAAgB;AAMvB,IAAM,SAAyB;AAAA,EAC7B;AAAA,IACE,OAAO,CAAC,eAAe;AAAA,IACvB;AAAA,IACA,SAAS;AAAA,MACP,sBAAsB;AAAA,MACtB,eAAe;AAAA,IACjB;AAAA,IACA,OAAO;AAAA,MACL,GAAG,SAAS,QAAQ,aAAa,GAAG;AAAA,MACpC,GAAG,WAAW,QAAQ,YAAY;AAAA,MAClC,GAAG;AAAA,IACL;AAAA,EACF;AAAA,EACA;AACF;AAEA,IAAO,iBAAQ;","names":[]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lighthouse CI preset for Augur e-commerce sites.
|
|
3
|
+
*
|
|
4
|
+
* Provides battle-tested Core Web Vitals thresholds tuned for e-commerce.
|
|
5
|
+
* Sites extend this preset and provide their own URLs and server config.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```js
|
|
9
|
+
* // lighthouserc.js
|
|
10
|
+
* import { lighthousePreset } from "@simpleapps-com/augur-config/lighthouse";
|
|
11
|
+
*
|
|
12
|
+
* export default lighthousePreset({
|
|
13
|
+
* urls: ["/", "/products", "/items/WAFL112", "/cart"],
|
|
14
|
+
* startServerCommand: "npm run start",
|
|
15
|
+
* // override any threshold
|
|
16
|
+
* assertions: {
|
|
17
|
+
* "largest-contentful-paint": ["error", { maxNumericValue: 3000 }],
|
|
18
|
+
* },
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
/** A Lighthouse CI assertion: a level, optionally with its options. */
|
|
23
|
+
type Assertion = string | [string, Record<string, unknown>];
|
|
24
|
+
/** Default assertion thresholds for Augur e-commerce sites. */
|
|
25
|
+
declare const defaultAssertions: Record<string, Assertion>;
|
|
26
|
+
export interface LighthousePresetOptions {
|
|
27
|
+
/** Pages to audit (paths appended to baseUrl). */
|
|
28
|
+
urls?: string[];
|
|
29
|
+
/** Base URL for the dev server. Default: "http://localhost:3000". */
|
|
30
|
+
baseUrl?: string;
|
|
31
|
+
/** Command to start the dev server. */
|
|
32
|
+
startServerCommand?: string;
|
|
33
|
+
/** Pattern indicating the server is ready. Default: "ready on". */
|
|
34
|
+
startServerReadyPattern?: string;
|
|
35
|
+
/** Number of Lighthouse runs per URL. Default: 3. */
|
|
36
|
+
numberOfRuns?: number;
|
|
37
|
+
/** Lighthouse settings preset. Default: "desktop". */
|
|
38
|
+
preset?: "desktop" | "perf";
|
|
39
|
+
/** Override or extend default assertion thresholds. */
|
|
40
|
+
assertions?: Record<string, Assertion>;
|
|
41
|
+
/** Override any collect options. */
|
|
42
|
+
collect?: Record<string, unknown>;
|
|
43
|
+
/** Override upload config (default: temporary-public-storage). */
|
|
44
|
+
upload?: Record<string, unknown>;
|
|
45
|
+
}
|
|
46
|
+
/** Creates a Lighthouse CI config with Augur e-commerce defaults. */
|
|
47
|
+
export declare function lighthousePreset(options?: LighthousePresetOptions): {
|
|
48
|
+
ci: {
|
|
49
|
+
collect: Record<string, unknown>;
|
|
50
|
+
assert: {
|
|
51
|
+
preset: string;
|
|
52
|
+
assertions: {
|
|
53
|
+
[x: string]: Assertion;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
upload: {
|
|
57
|
+
target: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
export { defaultAssertions };
|
|
62
|
+
//# sourceMappingURL=lighthouse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lighthouse.d.ts","sourceRoot":"","sources":["../src/lighthouse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,uEAAuE;AACvE,KAAK,SAAS,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAE5D,+DAA+D;AAC/D,QAAA,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAuBhD,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mEAAmE;IACnE,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,qDAAqD;IACrD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sDAAsD;IACtD,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC5B,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACvC,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAyBD,qEAAqE;AACrE,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,uBAA4B;;;;;;;;;;;;;EAYrE;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveUrl
|
|
3
|
+
} from "./chunk-ZV56KMH3.js";
|
|
4
|
+
|
|
5
|
+
// src/lighthouse.ts
|
|
6
|
+
var defaultAssertions = {
|
|
7
|
+
// Performance — Core Web Vitals
|
|
8
|
+
"first-contentful-paint": ["warn", { maxNumericValue: 2e3 }],
|
|
9
|
+
"largest-contentful-paint": ["warn", { maxNumericValue: 2500 }],
|
|
10
|
+
"cumulative-layout-shift": ["warn", { maxNumericValue: 0.1 }],
|
|
11
|
+
"total-blocking-time": ["warn", { maxNumericValue: 300 }],
|
|
12
|
+
"speed-index": ["warn", { maxNumericValue: 3e3 }],
|
|
13
|
+
// Accessibility
|
|
14
|
+
"color-contrast": "warn",
|
|
15
|
+
"heading-order": "warn",
|
|
16
|
+
"link-name": "warn",
|
|
17
|
+
"button-name": "warn",
|
|
18
|
+
// Best Practices
|
|
19
|
+
"errors-in-console": "warn",
|
|
20
|
+
deprecations: "warn",
|
|
21
|
+
// SEO
|
|
22
|
+
"document-title": "error",
|
|
23
|
+
"meta-description": "error",
|
|
24
|
+
"http-status-code": "error",
|
|
25
|
+
// PWA — off for e-commerce sites
|
|
26
|
+
"installable-manifest": "off",
|
|
27
|
+
"service-worker": "off",
|
|
28
|
+
"maskable-icon": "off"
|
|
29
|
+
};
|
|
30
|
+
function collectConfigOf({
|
|
31
|
+
urls,
|
|
32
|
+
baseUrl = "http://localhost:3000",
|
|
33
|
+
startServerCommand,
|
|
34
|
+
startServerReadyPattern = "ready on",
|
|
35
|
+
numberOfRuns = 3,
|
|
36
|
+
preset = "desktop",
|
|
37
|
+
collect = {}
|
|
38
|
+
}) {
|
|
39
|
+
const collectConfig = {
|
|
40
|
+
url: (urls || ["/"]).map((u) => resolveUrl(u, baseUrl)),
|
|
41
|
+
numberOfRuns,
|
|
42
|
+
settings: { preset },
|
|
43
|
+
...collect
|
|
44
|
+
};
|
|
45
|
+
if (startServerCommand) {
|
|
46
|
+
collectConfig["startServerCommand"] = startServerCommand;
|
|
47
|
+
collectConfig["startServerReadyPattern"] = startServerReadyPattern;
|
|
48
|
+
}
|
|
49
|
+
return collectConfig;
|
|
50
|
+
}
|
|
51
|
+
function lighthousePreset(options = {}) {
|
|
52
|
+
const { assertions = {}, upload = {} } = options;
|
|
53
|
+
return {
|
|
54
|
+
ci: {
|
|
55
|
+
collect: collectConfigOf(options),
|
|
56
|
+
assert: {
|
|
57
|
+
preset: "lighthouse:recommended",
|
|
58
|
+
assertions: { ...defaultAssertions, ...assertions }
|
|
59
|
+
},
|
|
60
|
+
upload: { target: "temporary-public-storage", ...upload }
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
defaultAssertions,
|
|
66
|
+
lighthousePreset
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=lighthouse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lighthouse.ts"],"sourcesContent":["/**\n * Lighthouse CI preset for Augur e-commerce sites.\n *\n * Provides battle-tested Core Web Vitals thresholds tuned for e-commerce.\n * Sites extend this preset and provide their own URLs and server config.\n *\n * @example\n * ```js\n * // lighthouserc.js\n * import { lighthousePreset } from \"@simpleapps-com/augur-config/lighthouse\";\n *\n * export default lighthousePreset({\n * urls: [\"/\", \"/products\", \"/items/WAFL112\", \"/cart\"],\n * startServerCommand: \"npm run start\",\n * // override any threshold\n * assertions: {\n * \"largest-contentful-paint\": [\"error\", { maxNumericValue: 3000 }],\n * },\n * });\n * ```\n */\n\nimport { resolveUrl } from \"./doctor/rules\";\n\n/** A Lighthouse CI assertion: a level, optionally with its options. */\ntype Assertion = string | [string, Record<string, unknown>];\n\n/** Default assertion thresholds for Augur e-commerce sites. */\nconst defaultAssertions: Record<string, Assertion> = {\n // Performance — Core Web Vitals\n \"first-contentful-paint\": [\"warn\", { maxNumericValue: 2000 }],\n \"largest-contentful-paint\": [\"warn\", { maxNumericValue: 2500 }],\n \"cumulative-layout-shift\": [\"warn\", { maxNumericValue: 0.1 }],\n \"total-blocking-time\": [\"warn\", { maxNumericValue: 300 }],\n \"speed-index\": [\"warn\", { maxNumericValue: 3000 }],\n // Accessibility\n \"color-contrast\": \"warn\",\n \"heading-order\": \"warn\",\n \"link-name\": \"warn\",\n \"button-name\": \"warn\",\n // Best Practices\n \"errors-in-console\": \"warn\",\n deprecations: \"warn\",\n // SEO\n \"document-title\": \"error\",\n \"meta-description\": \"error\",\n \"http-status-code\": \"error\",\n // PWA — off for e-commerce sites\n \"installable-manifest\": \"off\",\n \"service-worker\": \"off\",\n \"maskable-icon\": \"off\",\n};\n\nexport interface LighthousePresetOptions {\n /** Pages to audit (paths appended to baseUrl). */\n urls?: string[];\n /** Base URL for the dev server. Default: \"http://localhost:3000\". */\n baseUrl?: string;\n /** Command to start the dev server. */\n startServerCommand?: string;\n /** Pattern indicating the server is ready. Default: \"ready on\". */\n startServerReadyPattern?: string;\n /** Number of Lighthouse runs per URL. Default: 3. */\n numberOfRuns?: number;\n /** Lighthouse settings preset. Default: \"desktop\". */\n preset?: \"desktop\" | \"perf\";\n /** Override or extend default assertion thresholds. */\n assertions?: Record<string, Assertion>;\n /** Override any collect options. */\n collect?: Record<string, unknown>;\n /** Override upload config (default: temporary-public-storage). */\n upload?: Record<string, unknown>;\n}\n\n/** The collect section: the URLs, runs and preset, the caller's collect options, the server. */\nfunction collectConfigOf({\n urls,\n baseUrl = \"http://localhost:3000\",\n startServerCommand,\n startServerReadyPattern = \"ready on\",\n numberOfRuns = 3,\n preset = \"desktop\",\n collect = {},\n}: LighthousePresetOptions): Record<string, unknown> {\n const collectConfig: Record<string, unknown> = {\n url: (urls || [\"/\"]).map((u) => resolveUrl(u, baseUrl)),\n numberOfRuns,\n settings: { preset },\n ...collect,\n };\n if (startServerCommand) {\n collectConfig[\"startServerCommand\"] = startServerCommand;\n collectConfig[\"startServerReadyPattern\"] = startServerReadyPattern;\n }\n return collectConfig;\n}\n\n/** Creates a Lighthouse CI config with Augur e-commerce defaults. */\nexport function lighthousePreset(options: LighthousePresetOptions = {}) {\n const { assertions = {}, upload = {} } = options;\n return {\n ci: {\n collect: collectConfigOf(options),\n assert: {\n preset: \"lighthouse:recommended\",\n assertions: { ...defaultAssertions, ...assertions },\n },\n upload: { target: \"temporary-public-storage\", ...upload },\n },\n };\n}\n\nexport { defaultAssertions };\n"],"mappings":";;;;;AA4BA,IAAM,oBAA+C;AAAA;AAAA,EAEnD,0BAA0B,CAAC,QAAQ,EAAE,iBAAiB,IAAK,CAAC;AAAA,EAC5D,4BAA4B,CAAC,QAAQ,EAAE,iBAAiB,KAAK,CAAC;AAAA,EAC9D,2BAA2B,CAAC,QAAQ,EAAE,iBAAiB,IAAI,CAAC;AAAA,EAC5D,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,IAAI,CAAC;AAAA,EACxD,eAAe,CAAC,QAAQ,EAAE,iBAAiB,IAAK,CAAC;AAAA;AAAA,EAEjD,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,eAAe;AAAA;AAAA,EAEf,qBAAqB;AAAA,EACrB,cAAc;AAAA;AAAA,EAEd,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,oBAAoB;AAAA;AAAA,EAEpB,wBAAwB;AAAA,EACxB,kBAAkB;AAAA,EAClB,iBAAiB;AACnB;AAwBA,SAAS,gBAAgB;AAAA,EACvB;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA,0BAA0B;AAAA,EAC1B,eAAe;AAAA,EACf,SAAS;AAAA,EACT,UAAU,CAAC;AACb,GAAqD;AACnD,QAAM,gBAAyC;AAAA,IAC7C,MAAM,QAAQ,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC;AAAA,IACtD;AAAA,IACA,UAAU,EAAE,OAAO;AAAA,IACnB,GAAG;AAAA,EACL;AACA,MAAI,oBAAoB;AACtB,kBAAc,oBAAoB,IAAI;AACtC,kBAAc,yBAAyB,IAAI;AAAA,EAC7C;AACA,SAAO;AACT;AAGO,SAAS,iBAAiB,UAAmC,CAAC,GAAG;AACtE,QAAM,EAAE,aAAa,CAAC,GAAG,SAAS,CAAC,EAAE,IAAI;AACzC,SAAO;AAAA,IACL,IAAI;AAAA,MACF,SAAS,gBAAgB,OAAO;AAAA,MAChC,QAAQ;AAAA,QACN,QAAQ;AAAA,QACR,YAAY,EAAE,GAAG,mBAAmB,GAAG,WAAW;AAAA,MACpD;AAAA,MACA,QAAQ,EAAE,QAAQ,4BAA4B,GAAG,OAAO;AAAA,IAC1D;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +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;AAEvC,4FAA4F;AAC5F,QAAA,MAAM,MAAM,EAAE,MAoBb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// src/prettier-next.ts
|
|
2
|
+
var config = {
|
|
3
3
|
semi: true,
|
|
4
4
|
trailingComma: "all",
|
|
5
5
|
singleQuote: false,
|
|
@@ -14,12 +14,14 @@ export default {
|
|
|
14
14
|
"^@/components/(.*)$",
|
|
15
15
|
"^@/hooks/(.*)$",
|
|
16
16
|
"^@/lib/(.*)$",
|
|
17
|
-
"^[./]"
|
|
17
|
+
"^[./]"
|
|
18
18
|
],
|
|
19
19
|
importOrderSeparation: true,
|
|
20
20
|
importOrderSortSpecifiers: true,
|
|
21
|
-
plugins: [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
plugins: ["@trivago/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss"]
|
|
22
|
+
};
|
|
23
|
+
var prettier_next_default = config;
|
|
24
|
+
export {
|
|
25
|
+
prettier_next_default as default
|
|
25
26
|
};
|
|
27
|
+
//# sourceMappingURL=prettier-next.js.map
|
|
@@ -0,0 +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: [\n \"^react$\",\n \"<THIRD_PARTY_MODULES>\",\n \"^@/components/(.*)$\",\n \"^@/hooks/(.*)$\",\n \"^@/lib/(.*)$\",\n \"^[./]\",\n ],\n importOrderSeparation: true,\n importOrderSortSpecifiers: true,\n plugins: [\"@trivago/prettier-plugin-sort-imports\", \"prettier-plugin-tailwindcss\"],\n};\n\nexport default config;\n"],"mappings":";AAGA,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;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,uBAAuB;AAAA,EACvB,2BAA2B;AAAA,EAC3B,SAAS,CAAC,yCAAyC,6BAA6B;AAClF;AAEA,IAAO,wBAAQ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prettier.d.ts","sourceRoot":"","sources":["../src/prettier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,4EAA4E;AAC5E,QAAA,MAAM,MAAM,EAAE,MAUb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/prettier.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/prettier.ts
|
|
2
|
+
var config = {
|
|
3
|
+
semi: true,
|
|
4
|
+
trailingComma: "all",
|
|
5
|
+
singleQuote: false,
|
|
6
|
+
printWidth: 100,
|
|
7
|
+
tabWidth: 2,
|
|
8
|
+
useTabs: false,
|
|
9
|
+
bracketSpacing: true,
|
|
10
|
+
arrowParens: "always",
|
|
11
|
+
plugins: ["prettier-plugin-tailwindcss"]
|
|
12
|
+
};
|
|
13
|
+
var prettier_default = config;
|
|
14
|
+
export {
|
|
15
|
+
prettier_default as default
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=prettier.js.map
|
|
@@ -0,0 +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: [\"prettier-plugin-tailwindcss\"],\n};\n\nexport default config;\n"],"mappings":";AAGA,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,CAAC,6BAA6B;AACzC;AAEA,IAAO,mBAAQ;","names":[]}
|