ci(#1401): add no-adhoc-markdown-parsing rule (fence-strip + section-collect) + grandfather burn-down (#1402)
Tightens the over-broad heading-walk detection: removes heading-walk entirely and narrows fence-regex to require a multiline body ([\s\S]), so single-line tests like /^```/ and /^###\s+/ are no longer flagged. Grandfathers the 10 genuine section-collect sites across state.cts, milestone.cts, audit.cts, and phase-lifecycle.cts with concrete reasons. Adds 12 RuleTester tests (3 positive, 9 negative) to eslint-rules.test.cjs. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,7 @@ import noMagicSleepInTests from './eslint-rules/no-magic-sleep-in-tests.cjs';
|
||||
import noElapsedAssertion from './eslint-rules/no-elapsed-assertion.cjs';
|
||||
import noRawRmsyncInTests from './eslint-rules/no-raw-rmsync-in-tests.cjs';
|
||||
import noTautologicalAssert from './eslint-rules/no-tautological-assert.cjs';
|
||||
import noAdhocMarkdownParsing from './eslint-rules/no-adhoc-markdown-parsing.cjs';
|
||||
|
||||
const localPlugin = {
|
||||
rules: {
|
||||
@@ -22,6 +23,7 @@ const localPlugin = {
|
||||
'no-elapsed-assertion': noElapsedAssertion,
|
||||
'no-raw-rmsync-in-tests': noRawRmsyncInTests,
|
||||
'no-tautological-assert': noTautologicalAssert,
|
||||
'no-adhoc-markdown-parsing': noAdhocMarkdownParsing,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -171,6 +173,9 @@ export default tseslint.config(
|
||||
// these rules add lint-level coverage. warn-first per the harness convention.
|
||||
{
|
||||
files: ['src/**/*.cts'],
|
||||
plugins: {
|
||||
local: localPlugin,
|
||||
},
|
||||
extends: [tseslint.configs.recommendedTypeChecked],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
@@ -180,6 +185,9 @@ export default tseslint.config(
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
|
||||
// ADR-1372 T7: enforce use of the markdown-sectionizer seam; grandfather
|
||||
// pre-migration sites with // allow-adhoc-markdown: <reason>
|
||||
'local/no-adhoc-markdown-parsing': 'error',
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user