Skip to content

Commit a84724c

Browse files
committed
chore: remove completed ESM migration docs and clean up unused variables
Remove ESM_MIGRATION_PLAN.md as migration is complete and documented in commit history. Clean up unused variables and imports in rule files: - content.js: Remove unused 'visit' import and 'afterText' variable - structural.js: Remove unused 'text' destructuring in checkHeadingHierarchy - technical.js: Improve URL validation security with proper hostname checks These changes improve code quality without affecting functionality.
1 parent 17ac4bb commit a84724c

4 files changed

Lines changed: 21 additions & 332 deletions

File tree

docs-linter/ESM_MIGRATION_PLAN.md

Lines changed: 0 additions & 324 deletions
This file was deleted.

docs-linter/src/rules/content.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* based on improvements identified in KM feedback patterns.
66
*/
77

8-
import { visit } from 'unist-util-visit';
9-
108
class ContentRules {
119
constructor() {
1210
this.ruleSet = [
@@ -48,7 +46,6 @@ class ContentRules {
4846
patterns.content.forEach(pattern => {
4947
if (pattern.before && pattern.after) {
5048
const beforeText = pattern.before.toLowerCase();
51-
const afterText = pattern.after.toLowerCase();
5249

5350
lines.forEach((line, index) => {
5451
const lowerLine = line.toLowerCase();

docs-linter/src/rules/structural.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class StructuralRules {
134134
let previousDepth = 0;
135135

136136
headings.forEach((heading, index) => {
137-
const { depth, line, text } = heading;
137+
const { depth, line } = heading;
138138

139139
// Check for skipped heading levels
140140
if (depth > previousDepth + 1) {
@@ -329,9 +329,10 @@ class StructuralRules {
329329

330330
visit(ast, 'heading', (node) => {
331331
if (node.children && node.children[0] && node.children[0].type === 'text') {
332+
const text = node.children[0].value;
332333
headings.push({
333334
depth: node.depth,
334-
text: node.children[0].value,
335+
text,
335336
line: node.position ? node.position.start.line : null
336337
});
337338
}

0 commit comments

Comments
 (0)