chore: improve linting, docs, and export structure
Motivation
This PR introduces several tooling and structural improvements to enhance code quality, enforce documentation standards, and simplify the package's export configuration. These changes serve as preparatory work for the upcoming refactoring related to the synchronous evaluator, aiming for a cleaner and more maintainable codebase.
Key Changes:
-
Enhanced Linting:
- Added
eslint-plugin-import-xand configured rules to enforce consistent import ordering, style, and prevent duplicates (import-x/order,import-x/consistent-type-specifier-style,import-x/no-duplicates, etc.). - Added
eslint-plugin-tsdocand enabled thetsdoc/syntaxrule to validate TSDoc comment syntax, promoting better inline documentation. - Added general quality rules like
no-consoleandno-warning-comments.
- Added
-
Simplified Export Structure:
- Removed the previous entry point
src/1.ts. - Introduced a new centralized export file
src/_exports/index.ts. - Updated
package.jsonexportsfield:- The main
"."entry point now correctly points tosrc/_exports/index.ts(source) and its correspondingdistfiles. - Removed the specific
"./1"export entry.
- The main
- Removed the
typesVersionsfield frompackage.jsonas it's no longer needed after removing the specific./1export.
- Removed the previous entry point
-
API Extractor Configuration:
- Disabled the
ae-missing-release-tagrule inpackage.config.ts. TSDoc validation (@public,@internalwithin comments) will be the primary mechanism for controlling API surface visibility going forward.
- Disabled the
-
Dependency Updates:
- Added
eslint-plugin-import-xandeslint-plugin-tsdoctodevDependencies. - Updated
pnpm-lock.yamlaccordingly.
- Added
Impact
- Improved code consistency through stricter linting, especially regarding imports.
- Encourages better documentation practices via TSDoc validation.
- Provides a clearer and more standard package export structure by using a single entry point file.
- Removes the potentially confusing
./1subpath export.
This PR primarily affects the developer experience and internal structure and should not introduce breaking changes for consumers using the main package entry point (import {...} from 'groq-js').
[!WARNING] This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite. Learn more
-
#281
-
#280
👈 (View in Graphite)
-
#279
-
v2
This stack of pull requests is managed by Graphite. Learn more about stacking.
New dependencies detected. Learn more about Socket for GitHub ↗︎
| Package | New capabilities | Transitives | Size | Publisher |
|---|---|---|---|---|
| npm/[email protected] | Transitive: environment, filesystem | +48 |
3.65 MB | jounqin |
| npm/[email protected] | Transitive: environment, eval, filesystem, unsafe | +15 |
4.8 MB | odspnpm |