seo-lint-next 0.1.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/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0
4
+
5
+ - Initial v1 package with the ESLint plugin, standalone CLI, and 10 App Router SEO rules.
@@ -0,0 +1,21 @@
1
+ # Contributing
2
+
3
+ ## Local Setup
4
+
5
+ ```bash
6
+ npm install
7
+ npm run check
8
+ ```
9
+
10
+ ## Quality Bar
11
+
12
+ Every change should keep these passing:
13
+
14
+ - `npm run format:check`
15
+ - `npm run lint`
16
+ - `npm run typecheck`
17
+ - `npm run build`
18
+ - `npm test`
19
+ - `npm run audit`
20
+
21
+ Rule changes should include focused tests that show both the failing and accepted Next.js pattern.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,85 @@
1
+ <p align="center">
2
+ <img src="./assets/seo-lint-next-icon-512.png" width="132" height="132" alt="seo-lint-next icon">
3
+ </p>
4
+
5
+ <h1 align="center">seo-lint-next</h1>
6
+
7
+ <p align="center">
8
+ Build-time, App Router-aware SEO linting for Next.js metadata.
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/seo-lint-next"><img alt="npm" src="https://img.shields.io/npm/v/seo-lint-next?color=0f766e"></a>
13
+ <img alt="node" src="https://img.shields.io/badge/node-%3E%3D18.18-0f766e">
14
+ <img alt="eslint" src="https://img.shields.io/badge/eslint-8.57%2B%20%7C%209-4b32c3">
15
+ <img alt="license" src="https://img.shields.io/badge/license-MIT-111827">
16
+ </p>
17
+
18
+ `seo-lint-next` catches the metadata bugs that usually escape to production: missing titles, broken canonicals, unsafe `metadataBase`, bad OG tags, accidental `noindex`, sitemap gaps, invalid JSON-LD, heading skips, and weak image alt text.
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ npm install --save-dev seo-lint-next
24
+ ```
25
+
26
+ ## ESLint
27
+
28
+ ```js
29
+ // eslint.config.mjs
30
+ import seoLint from 'seo-lint-next/eslint'
31
+
32
+ export default [...seoLint.configs.recommended]
33
+ ```
34
+
35
+ ## CLI
36
+
37
+ ```bash
38
+ npx seo-lint-next
39
+ npx seo-lint-next --dir src/app
40
+ npx seo-lint-next --format json
41
+ npx seo-lint-next --strict
42
+ ```
43
+
44
+ ## Rule Set
45
+
46
+ | Rule | Default | Catches |
47
+ | ----------------------------- | ------: | ------------------------------------------------------------------- |
48
+ | `no-missing-title` | error | Missing, empty, duplicate, or weak dynamic titles |
49
+ | `no-missing-metadata-base` | error | Missing, localhost, or non-HTTPS root `metadataBase` |
50
+ | `no-missing-description` | warn | Missing, duplicate, too short, or too long descriptions |
51
+ | `no-missing-canonical` | error | Missing canonicals and hardcoded dynamic-route canonicals |
52
+ | `no-missing-og-tags` | warn | Missing Open Graph/Twitter tags and weak image dimensions |
53
+ | `no-broken-heading-hierarchy` | warn | Missing/multiple H1s and skipped heading levels |
54
+ | `no-img-missing-alt` | warn | Raw `<img>`, missing/generic alt text, layout-shifting images |
55
+ | `no-accidental-noindex` | error | Public `noindex`, blanket robots blocks, risky X-Robots headers |
56
+ | `no-missing-sitemap` | warn | Missing sitemap, relative URLs, missing robots sitemap reference |
57
+ | `no-invalid-json-ld` | error | Invalid JSON-LD syntax, bad context, missing required schema fields |
58
+
59
+ ## Configuration
60
+
61
+ ```js
62
+ import seoLint from 'seo-lint-next/eslint'
63
+
64
+ export default [
65
+ ...seoLint.configs.recommended,
66
+ {
67
+ rules: {
68
+ 'seo-lint-next/no-missing-description': ['warn', { descriptionLength: { min: 120, max: 160 } }],
69
+ 'seo-lint-next/no-accidental-noindex': [
70
+ 'error',
71
+ { privateRoutes: ['/admin', '/api', '/auth', '/private'] },
72
+ ],
73
+ },
74
+ },
75
+ ]
76
+ ```
77
+
78
+ ## CI
79
+
80
+ ```yaml
81
+ - run: npm ci
82
+ - run: npm run check
83
+ ```
84
+
85
+ The package has no production bundle impact. It statically inspects App Router source files, JSX, `metadata` exports, `generateMetadata()` returns, `app/robots.ts`, `public/robots.txt`, and `app/sitemap.ts`.
package/SECURITY.md ADDED
@@ -0,0 +1,5 @@
1
+ # Security
2
+
3
+ Report security issues privately to the package maintainer. Do not open a public issue for exploitable behavior.
4
+
5
+ `seo-lint-next` runs at development and CI time only. It should not execute user application code while linting.
Binary file