@ploaness/config 1.0.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/LICENSE +21 -0
- package/README.md +13 -0
- package/biome-core.json +128 -0
- package/biome.json +12 -0
- package/dependency-cruiser-core.json +59 -0
- package/dependency-cruiser.json +32 -0
- package/dist/a11y.d.ts +3 -0
- package/dist/a11y.d.ts.map +1 -0
- package/dist/a11y.js +9 -0
- package/dist/a11y.js.map +1 -0
- package/dist/access.d.ts +4 -0
- package/dist/access.d.ts.map +1 -0
- package/dist/access.js +4 -0
- package/dist/access.js.map +1 -0
- package/dist/eslint-core.d.ts +167 -0
- package/dist/eslint-core.d.ts.map +1 -0
- package/dist/eslint-core.js +698 -0
- package/dist/eslint-core.js.map +1 -0
- package/dist/eslint-library.d.ts +3 -0
- package/dist/eslint-library.d.ts.map +1 -0
- package/dist/eslint-library.js +53 -0
- package/dist/eslint-library.js.map +1 -0
- package/dist/eslint.d.ts +3 -0
- package/dist/eslint.d.ts.map +1 -0
- package/dist/eslint.js +261 -0
- package/dist/eslint.js.map +1 -0
- package/dist/playwright.d.ts +3 -0
- package/dist/playwright.d.ts.map +1 -0
- package/dist/playwright.js +108 -0
- package/dist/playwright.js.map +1 -0
- package/dist/project-settings.d.ts +3 -0
- package/dist/project-settings.d.ts.map +1 -0
- package/dist/project-settings.js +23 -0
- package/dist/project-settings.js.map +1 -0
- package/dist/vitest-core.d.ts +90 -0
- package/dist/vitest-core.d.ts.map +1 -0
- package/dist/vitest-core.js +101 -0
- package/dist/vitest-core.js.map +1 -0
- package/dist/vitest-library.d.ts +3 -0
- package/dist/vitest-library.d.ts.map +1 -0
- package/dist/vitest-library.js +37 -0
- package/dist/vitest-library.js.map +1 -0
- package/dist/vitest-setup.d.ts +2 -0
- package/dist/vitest-setup.d.ts.map +1 -0
- package/dist/vitest-setup.js +150 -0
- package/dist/vitest-setup.js.map +1 -0
- package/dist/vitest.d.ts +3 -0
- package/dist/vitest.d.ts.map +1 -0
- package/dist/vitest.js +117 -0
- package/dist/vitest.js.map +1 -0
- package/knip.json +5 -0
- package/package.json +117 -0
- package/pins.json +52 -0
- package/stylelint.json +49 -0
- package/tsconfig-core.json +34 -0
- package/tsconfig.json +11 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-core.js","sourceRoot":"","sources":["../src/eslint-core.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,EAAE;AACF,sGAAsG;AACtG,oGAAoG;AACpG,qGAAqG;AACrG,wGAAwG;AACxG,0EAA0E;AAC1E,EAAE;AACF,uGAAuG;AACvG,wEAAwE;AACxE,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,QAAQ,MAAM,yDAAyD,CAAA;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,MAAM,MAAM,uBAAuB,CAAA;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,QAAQ,MAAM,wBAAwB,CAAA;AAC7C,OAAO,UAAU,MAAM,0BAA0B,CAAA;AACjD,OAAO,KAAK,MAAM,qBAAqB,CAAA;AACvC,OAAO,MAAM,MAAM,sBAAsB,CAAA;AACzC,OAAO,OAAO,MAAM,uBAAuB,CAAA;AAC3C,OAAO,OAAO,MAAM,uBAAuB,CAAA;AAC3C,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AAoDxC,wGAAwG;AACxG,6DAA6D;AAC7D,MAAM,WAAW,GAAG,CAAC,KAAc,EAAsB,EAAE,CACzD,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAA;AAE7C,MAAM,cAAc,GAAW,CAAC,CAAA;AAChC,MAAM,UAAU,GAAW,CAAC,CAAA;AAC5B,MAAM,SAAS,GAAW,CAAC,CAAA;AAC3B,MAAM,kBAAkB,GAAW,GAAG,CAAA;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,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAoB,EAAE,CAAC,CAAC;IAC1D,KAAK,EAAE,CAAC,UAAU,CAAC;IACnB,qGAAqG;IACrG,mCAAmC;IACnC,OAAO,EAAE,EAAE,UAAU,EAAE;IACvB,KAAK,EAAE;QACL,2BAA2B,EAAE,aAAa,CAAC,CAAC,mBAAmB,CAAC,CAAC;KAClE;CACF,CAAC,CAAA;AAEF,+FAA+F;AAC/F,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,GACrB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-library.d.ts","sourceRoot":"","sources":["../src/eslint-library.ts"],"names":[],"mappings":";AA0CA,wBAqCC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// The ESLint configuration for a member that serves no application.
|
|
2
|
+
//
|
|
3
|
+
// It composes the same blocks the Payload configuration does, minus the ones keyed to paths only a
|
|
4
|
+
// Payload application has - the generated mount under `src/app/(payload)`, the collection-config ban,
|
|
5
|
+
// the centralised environment module. Those are not relaxations a library is being granted; they are
|
|
6
|
+
// carve-outs for files it does not contain, and applying them would have it judged against a layout it
|
|
7
|
+
// never claimed. Every cap, ban and suppression rule in `eslint-core.ts` still applies in full.
|
|
8
|
+
import { REEXPORT_CONFIG_FILES } from '@ploaness/governance';
|
|
9
|
+
import { baseLayers, compose, guidelineRules, immutabilityBlock, javascriptBlock, prettierLast, processConfigBlock, specEnvironmentBlock, testIdiomRules, testIntegrityRules, testSuiteSyntaxRules, typeAwareParsing, vitestPlugin, } from './eslint-core.js';
|
|
10
|
+
const IGNORED = ['dist/**', 'node_modules/**', 'coverage/**', '.next/**'];
|
|
11
|
+
/** The JavaScript a library may legitimately carry: its own flat ESLint config, and nothing else. */
|
|
12
|
+
const JAVASCRIPT_FILES = ['eslint.config.mjs'];
|
|
13
|
+
// `unicorn/prefer-export-from` rewrites `import x from 'y'` + `export default x` into
|
|
14
|
+
// `export { default } from 'y'` - and it AUTOFIXES, so `ploaness format` turned a correctly wired
|
|
15
|
+
// project into one the `wiring` gate then rejected, every time it ran. Two rules this harness owns,
|
|
16
|
+
// contradicting each other, with the formatter casting the deciding vote.
|
|
17
|
+
//
|
|
18
|
+
// The paths come from `REEXPORT_CONFIG_FILES`, declared beside the rule that requires the shape, so
|
|
19
|
+
// this exemption cannot fall out of step with what `wiring` asks for.
|
|
20
|
+
const reexportConfigBlock = {
|
|
21
|
+
files: [...REEXPORT_CONFIG_FILES],
|
|
22
|
+
rules: { 'unicorn/prefer-export-from': 'off' },
|
|
23
|
+
};
|
|
24
|
+
export default compose({ ignores: [...IGNORED] }, ...baseLayers, typeAwareParsing({ projectService: true }), { rules: { ...guidelineRules } },
|
|
25
|
+
// Immutability applies to every hand-written module. A library has no generated files to exempt, so
|
|
26
|
+
// the block is applied without the Payload carve-outs rather than with an empty list of them.
|
|
27
|
+
immutabilityBlock(['**/*.ts', '**/*.mts'], []),
|
|
28
|
+
// The setup file's role, straight after the block it narrows. It must come later: a block that sets
|
|
29
|
+
// this rule replaces its options, so stating the role first would have the general block undo it.
|
|
30
|
+
processConfigBlock(),
|
|
31
|
+
// And the spec's, which is to vary the environment rather than to fix it. Same ordering constraint.
|
|
32
|
+
specEnvironmentBlock(), javascriptBlock(JAVASCRIPT_FILES),
|
|
33
|
+
// A library's specs are held to the same integrity rules as an application's: the suite is a gate, so
|
|
34
|
+
// a test that cannot fail is a gate that cannot fail.
|
|
35
|
+
//
|
|
36
|
+
// The plugin is mounted here rather than spread as an entry of its own. A plugin is not a config
|
|
37
|
+
// block - ESLint rejects the whole config on the `meta` key it carries - and it belongs in the block
|
|
38
|
+
// that states the rules naming it, so the two cannot be separated by an edit.
|
|
39
|
+
//
|
|
40
|
+
// All three tables are the shared ones. This block used to carry the integrity rules alone, which read
|
|
41
|
+
// as complete and was not: a library's specs were held to the bare-number ban a Payload consumer's
|
|
42
|
+
// specs are exempt from, and guarded by two of the nineteen selectors rather than all of them. Neither
|
|
43
|
+
// gap is about serving an application, which is the only thing this config is meant to differ about.
|
|
44
|
+
{
|
|
45
|
+
files: ['tests/**'],
|
|
46
|
+
plugins: { vitest: vitestPlugin },
|
|
47
|
+
rules: {
|
|
48
|
+
...testIdiomRules,
|
|
49
|
+
...testIntegrityRules,
|
|
50
|
+
...testSuiteSyntaxRules,
|
|
51
|
+
},
|
|
52
|
+
}, reexportConfigBlock, prettierLast);
|
|
53
|
+
//# sourceMappingURL=eslint-library.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-library.js","sourceRoot":"","sources":["../src/eslint-library.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,mGAAmG;AACnG,sGAAsG;AACtG,qGAAqG;AACrG,uGAAuG;AACvG,gGAAgG;AAChG,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EACL,UAAU,EACV,OAAO,EAEP,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,GACb,MAAM,kBAAkB,CAAA;AAEzB,MAAM,OAAO,GAAsB,CAAC,SAAS,EAAE,iBAAiB,EAAE,aAAa,EAAE,UAAU,CAAC,CAAA;AAE5F,qGAAqG;AACrG,MAAM,gBAAgB,GAAsB,CAAC,mBAAmB,CAAC,CAAA;AAEjE,sFAAsF;AACtF,kGAAkG;AAClG,oGAAoG;AACpG,0EAA0E;AAC1E,EAAE;AACF,oGAAoG;AACpG,sEAAsE;AACtE,MAAM,mBAAmB,GAAoB;IAC3C,KAAK,EAAE,CAAC,GAAG,qBAAqB,CAAC;IACjC,KAAK,EAAE,EAAE,4BAA4B,EAAE,KAAK,EAAE;CAC/C,CAAA;AAED,eAAe,OAAO,CACpB,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,EAAE,EACzB,GAAG,UAAU,EACb,gBAAgB,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,EAC1C,EAAE,KAAK,EAAE,EAAE,GAAG,cAAc,EAAE,EAA4B;AAC1D,oGAAoG;AACpG,8FAA8F;AAC9F,iBAAiB,CAAC,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC;AAE9C,oGAAoG;AACpG,kGAAkG;AAClG,kBAAkB,EAAE;AACpB,oGAAoG;AACpG,oBAAoB,EAAE,EACtB,eAAe,CAAC,gBAAgB,CAAC;AACjC,sGAAsG;AACtG,sDAAsD;AACtD,EAAE;AACF,iGAAiG;AACjG,qGAAqG;AACrG,8EAA8E;AAC9E,EAAE;AACF,uGAAuG;AACvG,mGAAmG;AACnG,uGAAuG;AACvG,qGAAqG;AACrG;IACE,KAAK,EAAE,CAAC,UAAU,CAAC;IACnB,OAAO,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE;IACjC,KAAK,EAAE;QACL,GAAG,cAAc;QACjB,GAAG,kBAAkB;QACrB,GAAG,oBAAoB;KACxB;CACwB,EAC3B,mBAAmB,EACnB,YAAY,CACb,CAAA"}
|
package/dist/eslint.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint.d.ts","sourceRoot":"","sources":["../src/eslint.ts"],"names":[],"mappings":";AA0DA,wBA0PC"}
|
package/dist/eslint.js
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
//
|
|
3
|
+
// Type-aware ESLint flat config - the second enforcement layer, alongside Biome.
|
|
4
|
+
//
|
|
5
|
+
// It runs with the TypeScript type-checker wired in (`projectService`), so it catches semantic
|
|
6
|
+
// defects a syntax-only linter cannot see: floating promises, unsafe `any` flow, non-exhaustive
|
|
7
|
+
// switches, conditions that are always truthy. It also caps complexity so functions stay small and
|
|
8
|
+
// flat. Formatting is intentionally NOT handled here - Biome is the single formatter, and
|
|
9
|
+
// `eslint-config-prettier` (loaded last) disables every stylistic rule that would conflict.
|
|
10
|
+
//
|
|
11
|
+
// Philosophy: maximum-explicit. The build should be hard to satisfy by accident, so that code which
|
|
12
|
+
// passes is verbose, explicit and readable by construction.
|
|
13
|
+
import { REEXPORT_CONFIG_FILES } from '@ploaness/governance';
|
|
14
|
+
//
|
|
15
|
+
// The framework-neutral half - the caps, the explicitness rules, the naming ban, the suppression
|
|
16
|
+
// discipline, the mock ban - lives in ./eslint-core.js and is shared with the ploaness repository's own
|
|
17
|
+
// lint run. What stays here is what is genuinely about Payload and Next: the generated mount, the
|
|
18
|
+
// collection configs, the environment module, the a11y layer, and the test-integrity block.
|
|
19
|
+
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
|
20
|
+
import testingLibrary from 'eslint-plugin-testing-library';
|
|
21
|
+
import { baseLayers, compose, guidelineRules, immutabilityBlock, NO_INHERITANCE, NO_MOCK_PROPERTIES, NO_NETWORK_GUARD_ESCAPE, prettierLast, processConfigBlock, specEnvironmentBlock, testIdiomRules, testIntegrityRules, testSuiteSyntaxRules, typeAwareParsing, vitestPlugin, } from './eslint-core.js';
|
|
22
|
+
import { projectSettings as settings } from './project-settings.js';
|
|
23
|
+
const NO_INLINE_CONFIG_FUNCTIONS_SELECTOR = 'ArrowFunctionExpression, FunctionExpression';
|
|
24
|
+
const NO_INLINE_CONFIG_FUNCTIONS_MESSAGE = 'No inline functions in collection/global/field/block configs. Define behavior (access, hooks, ' +
|
|
25
|
+
'validate) in src/access or src/lib so it is unit-tested, then import it by reference.';
|
|
26
|
+
// `unicorn/prefer-export-from` rewrites `import x from 'y'` + `export default x` into
|
|
27
|
+
// `export { default } from 'y'` - and it AUTOFIXES, so `ploaness format` turned a correctly wired
|
|
28
|
+
// project into one the `wiring` gate then rejected, every time it ran. Two rules this harness owns,
|
|
29
|
+
// contradicting each other, with the formatter casting the deciding vote.
|
|
30
|
+
//
|
|
31
|
+
// The paths come from `REEXPORT_CONFIG_FILES`, declared beside the rule that requires the shape, so
|
|
32
|
+
// this exemption cannot fall out of step with what `wiring` asks for.
|
|
33
|
+
const reexportConfigBlock = {
|
|
34
|
+
files: [...REEXPORT_CONFIG_FILES],
|
|
35
|
+
rules: { 'unicorn/prefer-export-from': 'off' },
|
|
36
|
+
};
|
|
37
|
+
export default compose(
|
|
38
|
+
// ── What is never linted ────────────────────────────────────────────────────────────────────
|
|
39
|
+
{
|
|
40
|
+
ignores: [
|
|
41
|
+
'.next/**',
|
|
42
|
+
'node_modules/**',
|
|
43
|
+
'coverage/**',
|
|
44
|
+
'pgadmin/**',
|
|
45
|
+
'**/*.d.ts',
|
|
46
|
+
'src/payload-types.ts',
|
|
47
|
+
...settings.generatedArtefacts,
|
|
48
|
+
// Tooling configs are formatted/checked by Biome + tsc, not type-linted here.
|
|
49
|
+
// NOTE: `src/payload.config.ts` is deliberately NOT ignored - it is application code
|
|
50
|
+
// (reads env, wires collections) and must be linted like the rest of `src`.
|
|
51
|
+
'eslint.config.mjs',
|
|
52
|
+
'next.config.ts',
|
|
53
|
+
'playwright.config.ts',
|
|
54
|
+
'postcss.config.mjs',
|
|
55
|
+
'vitest.config.mts',
|
|
56
|
+
// A tool that keeps its configuration in a dot-directory - Storybook is the common one - cannot
|
|
57
|
+
// have it type-linted by anybody. The `include` block ploaness dictates reaches such a file with
|
|
58
|
+
// `**/*.ts`, and TypeScript's `**` does not descend into a directory whose name begins with a
|
|
59
|
+
// dot, so the file is outside the project the type-aware pass reads. Left unignored it reports a
|
|
60
|
+
// parsing error rather than a finding, on every run, with no edit a project is permitted to make
|
|
61
|
+
// that would clear it: `include` is dictated and this config is re-exported verbatim. Biome and
|
|
62
|
+
// the conventions gate still read these files.
|
|
63
|
+
'.*/**',
|
|
64
|
+
],
|
|
65
|
+
}, ...baseLayers,
|
|
66
|
+
// Type-aware parsing against the consuming project's own tsconfig, plus the shared rule set.
|
|
67
|
+
typeAwareParsing({ projectService: true }), { rules: guidelineRules },
|
|
68
|
+
// Immutability: every hand-written TypeScript, with the framework's own scaffolding exempt by role.
|
|
69
|
+
// The role is declarable rather than a fixed path, because a project that mounts its framework
|
|
70
|
+
// elsewhere has the same generated files under a name ploaness cannot guess.
|
|
71
|
+
immutabilityBlock(['**/*.ts', '**/*.tsx'], [...settings.frameworkGlue, 'src/payload-types.ts', 'src/payload-generated-schema.ts']),
|
|
72
|
+
// The setup file's role, straight after the block it narrows. It must come later: a block that sets
|
|
73
|
+
// this rule replaces its options, so stating the role first would have the general block undo it.
|
|
74
|
+
processConfigBlock(),
|
|
75
|
+
// And the spec's, which is to vary the environment rather than to fix it. Same ordering constraint.
|
|
76
|
+
specEnvironmentBlock(),
|
|
77
|
+
// ── Documenting comment blocks on hand-written modules. Default-safe: every src/ TypeScript module
|
|
78
|
+
// is in scope, with only the app/route layer, scripts, and generated files exempted (they carry
|
|
79
|
+
// no reusable API). A new logic directory is therefore held to the rule the moment it exists. ──
|
|
80
|
+
{
|
|
81
|
+
files: ['src/**/*.ts'],
|
|
82
|
+
ignores: ['src/app/**', 'src/seed/**', 'src/payload.config.ts', 'src/payload-types.ts'],
|
|
83
|
+
rules: {
|
|
84
|
+
'jsdoc/require-jsdoc': [
|
|
85
|
+
'error',
|
|
86
|
+
{
|
|
87
|
+
publicOnly: true,
|
|
88
|
+
require: { FunctionDeclaration: true, ClassDeclaration: true, MethodDefinition: true },
|
|
89
|
+
contexts: [
|
|
90
|
+
'ExportNamedDeclaration > VariableDeclaration > VariableDeclarator > ArrowFunctionExpression',
|
|
91
|
+
'TSInterfaceDeclaration',
|
|
92
|
+
'TSTypeAliasDeclaration',
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
// Payload access/field helpers intentionally return `boolean | Where` (a query constraint).
|
|
97
|
+
'sonarjs/function-return-type': 'off',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
// ── React components: return-type/boundary annotations add noise, not safety ─────────────────
|
|
101
|
+
{
|
|
102
|
+
files: ['**/*.tsx'],
|
|
103
|
+
rules: {
|
|
104
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
105
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
// ── Accessibility: lint JSX for a11y defects - missing alt text, unlabeled controls, invalid or
|
|
109
|
+
// misused ARIA, click handlers with no keyboard equivalent, non-focusable interactive elements.
|
|
110
|
+
// This is pure static analysis, so it is deterministic (never flaky) and the baseline every site
|
|
111
|
+
// needs. What it CANNOT see (it does not render): color contrast, focus order, real keyboard
|
|
112
|
+
// navigation - those need a browser and are covered by axe-in-e2e (see AGENTS.md testing policy).
|
|
113
|
+
{
|
|
114
|
+
files: ['**/*.tsx'],
|
|
115
|
+
plugins: { 'jsx-a11y': jsxA11y },
|
|
116
|
+
rules: jsxA11y.flatConfigs.recommended.rules,
|
|
117
|
+
},
|
|
118
|
+
// ── Generated Payload mount only: relax type-safety the framework legitimately defeats.
|
|
119
|
+
// Scoped to `src/app/(payload)/**` (the create-payload-app scaffold + API re-exports), NOT all
|
|
120
|
+
// of `src/app/**` - `(frontend)`, `oauth`, and any route you hand-write are real code and stay
|
|
121
|
+
// fully strict so the gate keeps biting as the app grows. ─────────────────────────────────────
|
|
122
|
+
{
|
|
123
|
+
files: [...settings.frameworkGlue],
|
|
124
|
+
rules: {
|
|
125
|
+
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
126
|
+
'@typescript-eslint/no-unsafe-call': 'off',
|
|
127
|
+
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
128
|
+
'@typescript-eslint/no-unsafe-return': 'off',
|
|
129
|
+
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
130
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
131
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
132
|
+
'@typescript-eslint/require-await': 'off', // async Server Components/layouts are idiomatic.
|
|
133
|
+
'@typescript-eslint/consistent-type-definitions': 'off',
|
|
134
|
+
'@typescript-eslint/consistent-indexed-object-style': 'off',
|
|
135
|
+
'sonarjs/prefer-read-only-props': 'off',
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
// ── Generated route handlers / scaffold under src/app/(payload): don't force annotations on
|
|
139
|
+
// framework re-exports like `export const GET = REST_GET(config)`. Custom app code is NOT
|
|
140
|
+
// exempted, and payload.config.ts keeps typedef. ───────────────────────────────────────────
|
|
141
|
+
{
|
|
142
|
+
files: [...settings.frameworkGlue],
|
|
143
|
+
rules: {
|
|
144
|
+
'@typescript-eslint/typedef': 'off',
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
// ── Collection configs: no inline behavior ──────────────────────────────────────────────────
|
|
148
|
+
// Collections/globals/fields/blocks are declarative wiring, so a function inlined there has no
|
|
149
|
+
// unit-test seam and escapes the test gates. Force every behavior (access, hooks, validate, and
|
|
150
|
+
// the like) into src/access or src/lib, where unit tests cover it, and import it by reference.
|
|
151
|
+
// Scoped by directory so a new config folder is governed automatically.
|
|
152
|
+
{
|
|
153
|
+
files: [
|
|
154
|
+
'src/collections/**/*.ts',
|
|
155
|
+
'src/globals/**/*.ts',
|
|
156
|
+
'src/fields/**/*.ts',
|
|
157
|
+
'src/blocks/**/*.ts',
|
|
158
|
+
],
|
|
159
|
+
rules: {
|
|
160
|
+
'no-restricted-syntax': [
|
|
161
|
+
...NO_INHERITANCE,
|
|
162
|
+
{
|
|
163
|
+
selector: NO_INLINE_CONFIG_FUNCTIONS_SELECTOR,
|
|
164
|
+
message: NO_INLINE_CONFIG_FUNCTIONS_MESSAGE,
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
// ── Environment access is centralized in one validated module ─────────────────────────────────
|
|
170
|
+
// All process.env reads belong in src/lib/environment.ts, which validates and narrows them (and is
|
|
171
|
+
// unit-tested). Other src modules - including payload.config.ts - must consume the
|
|
172
|
+
// typed values it returns, never ambient env, so the env surface stays auditable in one place.
|
|
173
|
+
// `src/proxy.ts` is exempt for a structural reason rather than a convenience one: Next mandates the
|
|
174
|
+
// file, its name and its export shape, and runs it in the EDGE runtime - where the project's own
|
|
175
|
+
// environment module, which validates a Node-shaped environment at module scope, is not reachable.
|
|
176
|
+
// What it reads there is `NODE_ENV`, which Next sets itself; it is not project configuration that
|
|
177
|
+
// `environment.ts` could have validated.
|
|
178
|
+
{
|
|
179
|
+
files: ['src/**/*.ts'],
|
|
180
|
+
ignores: ['src/lib/environment.ts', 'src/proxy.ts'],
|
|
181
|
+
rules: {
|
|
182
|
+
// `NO_MOCK_PROPERTIES` is spread in beside the env rule because this key REPLACES the base
|
|
183
|
+
// setting rather than adding to it - naming only the env restriction here switched the
|
|
184
|
+
// build-wide mock ban off across the whole of `src/`, which is the trap `eslint-core.js`
|
|
185
|
+
// documents for `no-restricted-syntax` and which this key falls into identically.
|
|
186
|
+
'no-restricted-properties': [
|
|
187
|
+
'error',
|
|
188
|
+
...NO_MOCK_PROPERTIES,
|
|
189
|
+
{
|
|
190
|
+
object: 'process',
|
|
191
|
+
property: 'env',
|
|
192
|
+
message: 'Read environment variables only in src/lib/environment.ts (validated there) and ' +
|
|
193
|
+
'consume the typed values; other src modules must not access process.env directly.',
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
// ── Build/util scripts (TypeScript, run via tsx): kept typed and type-checked, but the
|
|
199
|
+
// app-grade lint rules below don't fit a file-scanning CLI utility. ─────────────────────────
|
|
200
|
+
{
|
|
201
|
+
files: ['scripts/**'],
|
|
202
|
+
rules: {
|
|
203
|
+
'sonarjs/no-os-command-from-path': 'off', // invoking `git` by name is intended here.
|
|
204
|
+
'unicorn/numeric-separators-style': 'off', // codepoint literals (0x2014) read better ungrouped.
|
|
205
|
+
'unicorn/consistent-boolean-name': 'off',
|
|
206
|
+
// `max-depth` and `restrict-template-expressions` were off here. Both carry rules of the
|
|
207
|
+
// governing standard - the nesting cap, and "conversions between types are spelled out" - and a
|
|
208
|
+
// cap is never raised. A scan loop that needs four levels is a scan loop that wants a named
|
|
209
|
+
// helper for its inner pass.
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
// ── Tests: real objects, casts, and long arrange-act-assert bodies are expected ──────────────
|
|
213
|
+
{
|
|
214
|
+
files: ['tests/**'],
|
|
215
|
+
// The exemptions are the shared ones, so a library consumer's specs and a Payload consumer's specs
|
|
216
|
+
// are exempt from the same rules for the same stated reason.
|
|
217
|
+
rules: { ...testIdiomRules },
|
|
218
|
+
},
|
|
219
|
+
// ── Test integrity: the suite is a gate, so the tests themselves are linted ──────────────────
|
|
220
|
+
// In AI-driven development with little human review, the cheapest way to make a suite lie is to
|
|
221
|
+
// quietly stop a test from running or asserting. These rules make that a build failure: no `.only`
|
|
222
|
+
// (which silently skips every other test), no `.skip`/`xit`, no commented-out specs, and every
|
|
223
|
+
// test must contain a real assertion. The testing-library rules keep component tests user-facing
|
|
224
|
+
// (query by role/text); assertions use the @testing-library/jest-dom matchers, which a project
|
|
225
|
+
// registers in a `vitest.setup.ts` of its own if it writes component tests.
|
|
226
|
+
// Scoped to the Vitest suite (`tests/int` + `tests/unit`); Playwright e2e specs use a different
|
|
227
|
+
// runner (and its own unconditional `forbidOnly`), so these Vitest/RTL rules do not apply there.
|
|
228
|
+
{
|
|
229
|
+
files: ['tests/int/**/*.ts', 'tests/int/**/*.tsx', 'tests/unit/**/*.ts', 'tests/unit/**/*.tsx'],
|
|
230
|
+
plugins: { vitest: vitestPlugin, 'testing-library': testingLibrary },
|
|
231
|
+
rules: {
|
|
232
|
+
// A test must actually run and actually assert. The rules live in eslint-core.js, because the
|
|
233
|
+
// ploaness repository's own suite is held to them too.
|
|
234
|
+
...testIntegrityRules,
|
|
235
|
+
...testSuiteSyntaxRules,
|
|
236
|
+
// React Testing Library: test components the way a user experiences them.
|
|
237
|
+
'testing-library/await-async-queries': 'error',
|
|
238
|
+
'testing-library/await-async-utils': 'error',
|
|
239
|
+
'testing-library/no-await-sync-queries': 'error',
|
|
240
|
+
'testing-library/no-container': 'error', // query by role/text, not container.querySelector.
|
|
241
|
+
'testing-library/no-debugging-utils': 'error', // no stray screen.debug() in committed tests.
|
|
242
|
+
'testing-library/no-dom-import': ['error', 'react'],
|
|
243
|
+
'testing-library/no-node-access': 'error', // no reaching into DOM internals (.firstChild, ...).
|
|
244
|
+
'testing-library/no-render-in-lifecycle': 'error',
|
|
245
|
+
'testing-library/prefer-screen-queries': 'error',
|
|
246
|
+
'testing-library/prefer-user-event': 'error', // real user interaction over fireEvent.
|
|
247
|
+
'testing-library/render-result-naming-convention': 'error',
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
// Playwright has its own runner, but a spec body can still create an unguarded Node transport before
|
|
251
|
+
// it asks the browser to do anything. The Vitest-specific integrity rules do not fit here; the network
|
|
252
|
+
// escape ban does, and carries the same selectors rather than a second list.
|
|
253
|
+
{
|
|
254
|
+
files: ['tests/e2e/**/*.ts', 'tests/e2e/**/*.tsx'],
|
|
255
|
+
rules: {
|
|
256
|
+
'no-restricted-syntax': [...NO_INHERITANCE, ...NO_NETWORK_GUARD_ESCAPE],
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
// ── Formatting is Biome's job - disable every conflicting stylistic rule (must stay last) ────
|
|
260
|
+
reexportConfigBlock, prettierLast);
|
|
261
|
+
//# sourceMappingURL=eslint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint.js","sourceRoot":"","sources":["../src/eslint.ts"],"names":[],"mappings":"AAAA,YAAY;AACZ,EAAE;AACF,iFAAiF;AACjF,EAAE;AACF,+FAA+F;AAC/F,gGAAgG;AAChG,mGAAmG;AACnG,0FAA0F;AAC1F,4FAA4F;AAC5F,EAAE;AACF,oGAAoG;AACpG,4DAA4D;AAE5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,EAAE;AACF,iGA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iDAAiD,EAAE,OAAO;KAC3D;CACF;AAED,qGAAqG;AACrG,uGAAuG;AACvG,6EAA6E;AAC7E;IACE,KAAK,EAAE,CAAC,mBAAmB,EAAE,oBAAoB,CAAC;IAClD,KAAK,EAAE;QACL,sBAAsB,EAAE,CAAC,GAAG,cAAc,EAAE,GAAG,uBAAuB,CAAC;KACxE;CACF;AAED,gGAAgG;AAChG,mBAAmB,EACnB,YAAY,CACb,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright.d.ts","sourceRoot":"","sources":["../src/playwright.ts"],"names":[],"mappings":"AAsHA,QAAA,MAAM,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAmB,CAAA;AAEjE,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// The Playwright configuration ploaness owns. A consuming project re-exports it verbatim, exactly as it
|
|
2
|
+
// re-exports the ESLint and Vitest configs, and the wiring gate requires that re-export.
|
|
3
|
+
//
|
|
4
|
+
// Everything here is policy rather than preference. `forbidOnly` is the end-to-end analogue of the
|
|
5
|
+
// focused-test ban ploaness already enforces for Vitest: a left-behind `test.only` would otherwise turn
|
|
6
|
+
// a local extended run into one green test. A single worker is not a performance choice either - every spec shares
|
|
7
|
+
// one dev server that compiles routes on demand, and parallel workers starve the heavier specs against
|
|
8
|
+
// it. The project-specific inputs are the origin and any server its own specs need started beside the
|
|
9
|
+
// application, both declared under the `ploaness` key of its package.json rather than by editing this
|
|
10
|
+
// file. Neither reaches a rule: they say where the application answers and what else has to be running,
|
|
11
|
+
// and every threshold, ban and pinned spec above is the same whatever they say.
|
|
12
|
+
import { existsSync } from 'node:fs';
|
|
13
|
+
import { defineConfig, devices } from '@playwright/test';
|
|
14
|
+
import { portOf, runEnvironmentFiles } from '@ploaness/governance';
|
|
15
|
+
import { projectSettings } from './project-settings.js';
|
|
16
|
+
// Read before anything else, because a spec module is what needs it. Playwright evaluates this config
|
|
17
|
+
// in the runner and again in every worker, which makes it the one place a value reaches both the pass
|
|
18
|
+
// that collects the specs and the processes that run them - and collection is already too late to be
|
|
19
|
+
// safe: a helper that seeds a user through `getPayload` evaluates the project's Payload config at
|
|
20
|
+
// import time, and that config validates `process.env` at module scope. Nothing else here reads these
|
|
21
|
+
// variables; the specs and the application do. A `globalSetup` hook would not serve, because it runs
|
|
22
|
+
// in a process of its own and its environment never reaches a worker.
|
|
23
|
+
for (const file of runEnvironmentFiles(existsSync)) {
|
|
24
|
+
process.loadEnvFile(file);
|
|
25
|
+
}
|
|
26
|
+
const isContinuousIntegration = Boolean(process.env['CI']);
|
|
27
|
+
// The web server is `next dev`, which compiles a route on its first request. The first hit to the heavy
|
|
28
|
+
// Payload admin bundle can exceed the 30s Playwright default on a cold runner, so the budget gives
|
|
29
|
+
// compilation headroom instead of leaning on a retry to mask it.
|
|
30
|
+
const TEST_TIMEOUT_MS = 90_000;
|
|
31
|
+
const SERVER_TIMEOUT_MS = 180_000;
|
|
32
|
+
const CI_RETRIES = 2;
|
|
33
|
+
// Structural rather than Playwright's own `PlaywrightTestConfig`, for the reason `vitest.ts` records:
|
|
34
|
+
// the harness owns the config and the consumer owns the runner, so an emitted declaration should not
|
|
35
|
+
// make the runner's types a condition of reading this entry point.
|
|
36
|
+
// `ReturnType` rather than the runner's own exported type: naming that type would import it, which is
|
|
37
|
+
// the dependency the annotation below exists to avoid. This binding is module-local, so it reaches no
|
|
38
|
+
// declaration file either way.
|
|
39
|
+
// Spread rather than assigned, so an origin naming no port leaves the framework's default in place
|
|
40
|
+
// rather than setting PORT to the string "undefined".
|
|
41
|
+
const withPort = (base, port) => (port === undefined ? base : { ...base, PORT: port });
|
|
42
|
+
const declaredPort = portOf(projectSettings.serverUrl);
|
|
43
|
+
const declared = defineConfig({
|
|
44
|
+
testDir: './tests/e2e',
|
|
45
|
+
timeout: TEST_TIMEOUT_MS,
|
|
46
|
+
forbidOnly: true,
|
|
47
|
+
retries: isContinuousIntegration ? CI_RETRIES : 0,
|
|
48
|
+
workers: 1,
|
|
49
|
+
// `open: 'never'` because the gate runs this non-interactively: a reporter that launches a browser
|
|
50
|
+
// on failure would hang the run rather than report it.
|
|
51
|
+
reporter: [['list'], ['html', { open: 'never' }]],
|
|
52
|
+
use: {
|
|
53
|
+
baseURL: projectSettings.serverUrl,
|
|
54
|
+
trace: 'on-first-retry',
|
|
55
|
+
screenshot: 'only-on-failure',
|
|
56
|
+
},
|
|
57
|
+
projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'], channel: 'chromium' } }],
|
|
58
|
+
// Auxiliary servers first, then the application under test. Playwright awaits each entry in this
|
|
59
|
+
// list before starting the next, so the order is the difference between a run and a deadlock: a
|
|
60
|
+
// frontend that renders from a headless CMS cannot answer its own origin until that CMS answers, and
|
|
61
|
+
// starting the application first spent the entire server budget waiting on a page whose dependency
|
|
62
|
+
// this list had not reached yet. The reverse cannot be needed - an auxiliary that required the
|
|
63
|
+
// application under test to be up already could never be started from here at all - so the
|
|
64
|
+
// application goes last.
|
|
65
|
+
//
|
|
66
|
+
// A declared server is ADDED here rather than substituted, and `baseURL` names the application
|
|
67
|
+
// wherever it sits in this list, so the pinned accessibility sweep drives the same origin whatever a
|
|
68
|
+
// project declares. Without this a project had no way to say so at all, because the wiring gate
|
|
69
|
+
// requires playwright.config.ts to be a bare re-export of this file.
|
|
70
|
+
webServer: [
|
|
71
|
+
// A sibling application is started from its own directory, which is what lets the framework read
|
|
72
|
+
// that package's environment files, config and sources rather than the tested package's. It does
|
|
73
|
+
// NOT change how the command's binary is resolved: Playwright leaves PATH alone, so a bare binary
|
|
74
|
+
// name still resolves out of the package the runner was invoked from. A project that pins
|
|
75
|
+
// different versions in the two packages should say `node_modules/.bin/<binary>`, which is
|
|
76
|
+
// relative to the directory named here.
|
|
77
|
+
...projectSettings.auxiliaryServers.map((server) => ({
|
|
78
|
+
command: server.command,
|
|
79
|
+
url: server.url,
|
|
80
|
+
reuseExistingServer: !isContinuousIntegration,
|
|
81
|
+
// The same budget and the same reuse rule as the application: an auxiliary server is started by
|
|
82
|
+
// the same runner on the same cold machine, so a shorter one would fail for the reason that one
|
|
83
|
+
// is long.
|
|
84
|
+
timeout: SERVER_TIMEOUT_MS,
|
|
85
|
+
...(server.cwd !== undefined && { cwd: server.cwd }),
|
|
86
|
+
env: withPort({ NODE_OPTIONS: '--no-deprecation' }, portOf(server.url)),
|
|
87
|
+
})),
|
|
88
|
+
{
|
|
89
|
+
// Invoked as a bare binary rather than through a package script, because a nested package manager
|
|
90
|
+
// spawned here inherits expectations from its parent that do not hold inside a test runner. The
|
|
91
|
+
// name resolves out of the ambient PATH, which the package manager that started the run points at
|
|
92
|
+
// this member's `node_modules/.bin` - which is the member under test, so it is the right one.
|
|
93
|
+
command: 'next dev',
|
|
94
|
+
url: projectSettings.serverUrl,
|
|
95
|
+
reuseExistingServer: !isContinuousIntegration,
|
|
96
|
+
timeout: SERVER_TIMEOUT_MS,
|
|
97
|
+
// The port comes from the declared origin. Without it the server started on the framework's
|
|
98
|
+
// default while the runner waited on the origin the project declared, so the one setting that
|
|
99
|
+
// exists to describe a non-default port made the run hang instead of work.
|
|
100
|
+
env: withPort({ NEXT_TELEMETRY_DISABLED: '1', NODE_OPTIONS: '--no-deprecation' }, declaredPort),
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
});
|
|
104
|
+
// A shallow copy rather than an assertion: a spread yields an anonymous object type, which carries
|
|
105
|
+
// the index signature an interface does not, so the structural annotation above holds without one.
|
|
106
|
+
const config = { ...declared };
|
|
107
|
+
export default config;
|
|
108
|
+
//# sourceMappingURL=playwright.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright.js","sourceRoot":"","sources":["../src/playwright.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,yFAAyF;AACzF,EAAE;AACF,mGAAmG;AACnG,wGAAwG;AACxG,mHAAmH;AACnH,uGAAuG;AACvG,sGAAsG;A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AC,GAAG,CAAC,CAAC;SACxE,CAAC,CAAC;QACH;YACE,kGAAkG;YAClG,gGAAgG;YAChG,kGAAkG;YAClG,8FAA8F;YAC9F,OAAO,EAAE,UAAU;YACnB,GAAG,EAAE,eAAe,CAAC,SAAS;YAC9B,mBAAmB,EAAE,CAAC,uBAAuB;YAC7C,OAAO,EAAE,iBAAiB;YAC1B,4FAA4F;YAC5F,8FAA8F;YAC9F,2EAA2E;YAC3E,GAAG,EAAE,QAAQ,CACX,EAAE,uBAAuB,EAAE,GAAG,EAAE,YAAY,EAAE,kBAAkB,EAAE,EAClE,YAAY,CACb;SACF;KACF;CACF,CAAC,CAAA;AAEF,mGAAmG;AACnG,mGAAmG;AACnG,MAAM,MAAM,GAAsC,EAAE,GAAG,QAAQ,EAAE,CAAA;AAEjE,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-settings.d.ts","sourceRoot":"","sources":["../src/project-settings.ts"],"names":[],"mappings":"AAOA,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAelE,eAAO,MAAM,eAAe,EAAE,QAA0C,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// The consuming project's declared settings, read once from the package.json in the working directory.
|
|
2
|
+
//
|
|
3
|
+
// Three shipped configurations need them - the Vitest config, the Playwright config, and the constants
|
|
4
|
+
// the managed accessibility sweep imports - and none of them may carry a second copy of this reader. A
|
|
5
|
+
// value the harness both writes and judges is declared once; the same holds for the value it reads.
|
|
6
|
+
import { readFileSync } from 'node:fs';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import { readSettings } from '@ploaness/governance';
|
|
9
|
+
// A project whose package.json cannot be read gets the defaults, which are the strict end of every
|
|
10
|
+
// setting. Failing to parse must never be the thing that loosens a threshold.
|
|
11
|
+
// `unknown` rather than the parse's own `any`: `readSettings` narrows every field it reads, so handing
|
|
12
|
+
// it an `any` would only move the narrowing somewhere nothing checks it.
|
|
13
|
+
const readPackageJson = () => {
|
|
14
|
+
const manifest = path.join(process.cwd(), 'package.json');
|
|
15
|
+
try {
|
|
16
|
+
return JSON.parse(readFileSync(manifest, 'utf8'));
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return {};
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export const projectSettings = readSettings(readPackageJson());
|
|
23
|
+
//# sourceMappingURL=project-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-settings.js","sourceRoot":"","sources":["../src/project-settings.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,EAAE;AACF,uGAAuG;AACvG,uGAAuG;AACvG,oGAAoG;AACpG,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAiB,MAAM,sBAAsB,CAAA;AAElE,mGAAmG;AACnG,8EAA8E;AAC9E,uGAAuG;AACvG,yEAAyE;AACzE,MAAM,eAAe,GAAG,GAAY,EAAE;IACpC,MAAM,QAAQ,GAAW,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAA;IACjE,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAA;IACnD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAa,YAAY,CAAC,eAAe,EAAE,CAAC,CAAA"}
|