Initial import with skill sheet working
This commit is contained in:
20
node_modules/are-docs-informative/LICENSE.md
generated
vendored
Normal file
20
node_modules/are-docs-informative/LICENSE.md
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
# MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
109
node_modules/are-docs-informative/README.md
generated
vendored
Normal file
109
node_modules/are-docs-informative/README.md
generated
vendored
Normal file
@ -0,0 +1,109 @@
|
||||
<h1 align="center">Are Docs Informative</h1>
|
||||
|
||||
<p align="center">Checks whether a documentation description introduces any new information.</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="#contributors" target="_blank">
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
||||
<img alt="All Contributors: 1" src="https://img.shields.io/badge/all_contributors-1-21bb42.svg" />
|
||||
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
||||
<!-- prettier-ignore-end -->
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/JoshuaKGoldberg/are-docs-informative" target="_blank">
|
||||
<img alt="Codecov Test Coverage" src="https://codecov.io/gh/JoshuaKGoldberg/are-docs-informative/branch/main/graph/badge.svg?token=eVIFY4MhfQ"/>
|
||||
</a>
|
||||
<a href="https://github.com/JoshuaKGoldberg/are-docs-informative/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank">
|
||||
<img alt="Contributor Covenant" src="https://img.shields.io/badge/code_of_conduct-enforced-21bb42" />
|
||||
</a>
|
||||
<a href="https://github.com/JoshuaKGoldberg/are-docs-informative/blob/main/LICENSE.md" target="_blank">
|
||||
<img alt="License: MIT" src="https://img.shields.io/github/license/JoshuaKGoldberg/are-docs-informative?color=21bb42">
|
||||
</a>
|
||||
<a href="https://github.com/sponsors/JoshuaKGoldberg" target="_blank">
|
||||
<img alt="Sponsor: On GitHub" src="https://img.shields.io/badge/sponsor-on_github-21bb42.svg" />
|
||||
</a>
|
||||
<img alt="Style: Prettier" src="https://img.shields.io/badge/style-prettier-21bb42.svg" />
|
||||
<img alt="TypeScript: Strict" src="https://img.shields.io/badge/typescript-strict-21bb42.svg" />
|
||||
</p>
|
||||
|
||||
## Usage
|
||||
|
||||
```shell
|
||||
npm i are-docs-informative
|
||||
```
|
||||
|
||||
```ts
|
||||
import { areDocsInformative } from "are-docs-informative";
|
||||
|
||||
areDocsInformative("The user id.", "userId"); // false
|
||||
areDocsInformative("Retrieved user id.", "userId"); // true
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
The `areDocsInformative` function can receive a third, optional parameter
|
||||
|
||||
#### `aliases`
|
||||
|
||||
The `aliases` option allows indicating words as synonyms (aliases) of each other.
|
||||
|
||||
For example, with `{ aliases: { emoji: ["smiley", "winkey"] } }`, the following comment would be considered uninformative:
|
||||
|
||||
```js
|
||||
/** Default smiley/winkey. */
|
||||
export const defaultSmiley = "🙂";
|
||||
```
|
||||
|
||||
The default `aliases` option is:
|
||||
|
||||
```json
|
||||
{
|
||||
"a": ["an", "our"]
|
||||
}
|
||||
```
|
||||
|
||||
#### `uselessWords`
|
||||
|
||||
Words that are ignored when searching for one that adds meaning.
|
||||
|
||||
For example, with `{ uselessWords: ["our"] }`, the following comment would be considered uninformative:
|
||||
|
||||
```js
|
||||
/** Our text. */
|
||||
export const text = ":)";
|
||||
```
|
||||
|
||||
The default `uselessWords` option is:
|
||||
|
||||
```json
|
||||
["a", "an", "i", "in", "of", "s", "the"]
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
See [`.github/CONTRIBUTING.md`](./.github/CONTRIBUTING.md), then [`.github/DEVELOPMENT.md`](./.github/DEVELOPMENT.md).
|
||||
Thanks! 💖
|
||||
|
||||
## Contributors
|
||||
|
||||
<!-- spellchecker: disable -->
|
||||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- markdownlint-disable -->
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="http://www.joshuakgoldberg.com"><img src="https://avatars.githubusercontent.com/u/3335181?v=4?s=100" width="100px;" alt="Josh Goldberg"/><br /><sub><b>Josh Goldberg</b></sub></a><br /><a href="#tool-JoshuaKGoldberg" title="Tools">🔧</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- markdownlint-restore -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
<!-- spellchecker: enable -->
|
||||
|
||||
<!-- You can remove this notice if you don't want it 🙂 no worries! -->
|
||||
|
||||
> 💙 This package is based on [@JoshuaKGoldberg](https://github.com/JoshuaKGoldberg)'s [template-typescript-node-package](https://github.com/JoshuaKGoldberg/template-typescript-node-package).
|
56
node_modules/are-docs-informative/lib/index.cjs
generated
vendored
Normal file
56
node_modules/are-docs-informative/lib/index.cjs
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/index.ts
|
||||
var src_exports = {};
|
||||
__export(src_exports, {
|
||||
areDocsInformative: () => areDocsInformative
|
||||
});
|
||||
module.exports = __toCommonJS(src_exports);
|
||||
var defaultAliases = {
|
||||
a: ["an", "our"]
|
||||
};
|
||||
var defaultUselessWords = ["a", "an", "i", "in", "of", "s", "the"];
|
||||
function areDocsInformative(docs, name, {
|
||||
aliases = defaultAliases,
|
||||
uselessWords = defaultUselessWords
|
||||
} = {}) {
|
||||
const docsWords = new Set(splitTextIntoWords(docs));
|
||||
const nameWords = splitTextIntoWords(name);
|
||||
for (const nameWord of nameWords) {
|
||||
docsWords.delete(nameWord);
|
||||
}
|
||||
for (const uselessWord of uselessWords) {
|
||||
docsWords.delete(uselessWord);
|
||||
}
|
||||
return !!docsWords.size;
|
||||
function normalizeWord(word) {
|
||||
const wordLower = word.toLowerCase();
|
||||
return aliases[wordLower] ?? wordLower;
|
||||
}
|
||||
function splitTextIntoWords(text) {
|
||||
return (typeof text === "string" ? [text] : text).flatMap((name2) => {
|
||||
return name2.replace(/\W+/gu, " ").replace(/([a-z])([A-Z])/gu, "$1 $2").trim().split(" ");
|
||||
}).flatMap(normalizeWord).filter(Boolean);
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
areDocsInformative
|
||||
});
|
57
node_modules/are-docs-informative/lib/index.d.cts
generated
vendored
Normal file
57
node_modules/are-docs-informative/lib/index.d.cts
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
interface InformativeDocsOptions {
|
||||
/**
|
||||
* Words that can be considered synonyms (aliases) of each other.
|
||||
*
|
||||
* @default
|
||||
* ```json
|
||||
* {
|
||||
* "a": ["an", "our"]
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @example
|
||||
* With `{ aliases: { emoji: ["smiley", "winkey"] } }`,
|
||||
* the following comment would be considered uninformative:
|
||||
* ```js
|
||||
* /** Default smiley/winkey. *\/
|
||||
* export const defaultSmiley = "🙂";
|
||||
* ```
|
||||
*/
|
||||
aliases?: Record<string, string[]>;
|
||||
/**
|
||||
* Words that are ignored when searching for one that adds meaning.
|
||||
*
|
||||
* @default
|
||||
* ```json
|
||||
* ["a", "an", "i", "in", "of", "s", "the"]
|
||||
* ```
|
||||
*
|
||||
* @example
|
||||
* With `{ uselessWords: ["our"] }`, the following comment would
|
||||
* be considered uninformative:
|
||||
* ```js
|
||||
* /** Our text. *\/
|
||||
* export const text = ":)";
|
||||
* ```
|
||||
*/
|
||||
uselessWords?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param docs - Any amount of docs text, such as from a JSDoc description.
|
||||
* @param name - Name of the entity the docs text is describing.
|
||||
* @param options - Additional options to customize informativity checking.
|
||||
* @returns Whether the docs include at least one word with new information.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* areDocsInformative("The user id.", "userId"); // false
|
||||
* ```
|
||||
* @example
|
||||
* ```js
|
||||
* areDocsInformative("Retrieved user id.", "userId"); // true
|
||||
* ```
|
||||
*/
|
||||
declare function areDocsInformative(docs: string | string[], name: string | string[], { aliases, uselessWords, }?: InformativeDocsOptions): boolean;
|
||||
|
||||
export { InformativeDocsOptions, areDocsInformative };
|
57
node_modules/are-docs-informative/lib/index.d.ts
generated
vendored
Normal file
57
node_modules/are-docs-informative/lib/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
interface InformativeDocsOptions {
|
||||
/**
|
||||
* Words that can be considered synonyms (aliases) of each other.
|
||||
*
|
||||
* @default
|
||||
* ```json
|
||||
* {
|
||||
* "a": ["an", "our"]
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @example
|
||||
* With `{ aliases: { emoji: ["smiley", "winkey"] } }`,
|
||||
* the following comment would be considered uninformative:
|
||||
* ```js
|
||||
* /** Default smiley/winkey. *\/
|
||||
* export const defaultSmiley = "🙂";
|
||||
* ```
|
||||
*/
|
||||
aliases?: Record<string, string[]>;
|
||||
/**
|
||||
* Words that are ignored when searching for one that adds meaning.
|
||||
*
|
||||
* @default
|
||||
* ```json
|
||||
* ["a", "an", "i", "in", "of", "s", "the"]
|
||||
* ```
|
||||
*
|
||||
* @example
|
||||
* With `{ uselessWords: ["our"] }`, the following comment would
|
||||
* be considered uninformative:
|
||||
* ```js
|
||||
* /** Our text. *\/
|
||||
* export const text = ":)";
|
||||
* ```
|
||||
*/
|
||||
uselessWords?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param docs - Any amount of docs text, such as from a JSDoc description.
|
||||
* @param name - Name of the entity the docs text is describing.
|
||||
* @param options - Additional options to customize informativity checking.
|
||||
* @returns Whether the docs include at least one word with new information.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* areDocsInformative("The user id.", "userId"); // false
|
||||
* ```
|
||||
* @example
|
||||
* ```js
|
||||
* areDocsInformative("Retrieved user id.", "userId"); // true
|
||||
* ```
|
||||
*/
|
||||
declare function areDocsInformative(docs: string | string[], name: string | string[], { aliases, uselessWords, }?: InformativeDocsOptions): boolean;
|
||||
|
||||
export { InformativeDocsOptions, areDocsInformative };
|
31
node_modules/are-docs-informative/lib/index.js
generated
vendored
Normal file
31
node_modules/are-docs-informative/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
// src/index.ts
|
||||
var defaultAliases = {
|
||||
a: ["an", "our"]
|
||||
};
|
||||
var defaultUselessWords = ["a", "an", "i", "in", "of", "s", "the"];
|
||||
function areDocsInformative(docs, name, {
|
||||
aliases = defaultAliases,
|
||||
uselessWords = defaultUselessWords
|
||||
} = {}) {
|
||||
const docsWords = new Set(splitTextIntoWords(docs));
|
||||
const nameWords = splitTextIntoWords(name);
|
||||
for (const nameWord of nameWords) {
|
||||
docsWords.delete(nameWord);
|
||||
}
|
||||
for (const uselessWord of uselessWords) {
|
||||
docsWords.delete(uselessWord);
|
||||
}
|
||||
return !!docsWords.size;
|
||||
function normalizeWord(word) {
|
||||
const wordLower = word.toLowerCase();
|
||||
return aliases[wordLower] ?? wordLower;
|
||||
}
|
||||
function splitTextIntoWords(text) {
|
||||
return (typeof text === "string" ? [text] : text).flatMap((name2) => {
|
||||
return name2.replace(/\W+/gu, " ").replace(/([a-z])([A-Z])/gu, "$1 $2").trim().split(" ");
|
||||
}).flatMap(normalizeWord).filter(Boolean);
|
||||
}
|
||||
}
|
||||
export {
|
||||
areDocsInformative
|
||||
};
|
89
node_modules/are-docs-informative/package.json
generated
vendored
Normal file
89
node_modules/are-docs-informative/package.json
generated
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
{
|
||||
"name": "are-docs-informative",
|
||||
"version": "0.0.2",
|
||||
"description": "Checks whether a documentation description introduces any new information.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/JoshuaKGoldberg/are-docs-informative"
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": "Josh Goldberg <npm@joshuakgoldberg.com>",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": {
|
||||
"import": "./lib/index.d.ts",
|
||||
"require": "./lib/index.d.cts"
|
||||
},
|
||||
"import": "./lib/index.js",
|
||||
"require": "./lib/index.cjs"
|
||||
}
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"files": [
|
||||
"lib/",
|
||||
"package.json",
|
||||
"LICENSE.md",
|
||||
"README.md"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"build:full": "tsup src/index.ts --clean --format cjs,esm --outDir lib --dts && cp lib/index.d.ts lib/index.d.cts",
|
||||
"format": "prettier \"**/*\" --ignore-unknown",
|
||||
"format:write": "pnpm format --write",
|
||||
"lint": "eslint . --max-warnings 0 --report-unused-disable-directives",
|
||||
"lint:knip": "knip",
|
||||
"lint:md": "markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line",
|
||||
"lint:package": "npmPkgJsonLint .",
|
||||
"lint:packages": "pnpm-deduplicate --list",
|
||||
"lint:spelling": "cspell \"**\" \".github/**/*\"",
|
||||
"prepare": "husky install",
|
||||
"should-semantic-release": "should-semantic-release --verbose",
|
||||
"test": "vitest"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*": "prettier --ignore-unknown --write"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/eslint": "^8.21.1",
|
||||
"@typescript-eslint/eslint-plugin": "^5.48.2",
|
||||
"@typescript-eslint/parser": "^5.48.2",
|
||||
"@vitest/coverage-istanbul": "^0.29.0",
|
||||
"cspell": "^6.19.2",
|
||||
"eslint": "^8.32.0",
|
||||
"eslint-config-prettier": "^8.6.0",
|
||||
"eslint-plugin-deprecation": "^1.3.3",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-jsonc": "^2.6.0",
|
||||
"eslint-plugin-markdown": "^3.0.0",
|
||||
"eslint-plugin-no-only-tests": "^3.1.0",
|
||||
"eslint-plugin-regexp": "^1.12.0",
|
||||
"eslint-plugin-simple-import-sort": "^10.0.0",
|
||||
"eslint-plugin-typescript-sort-keys": "^2.1.0",
|
||||
"eslint-plugin-vitest": "^0.1.0",
|
||||
"eslint-plugin-yml": "^1.5.0",
|
||||
"husky": "^8.0.3",
|
||||
"jsonc-eslint-parser": "^2.1.0",
|
||||
"knip": "2.8.2",
|
||||
"lint-staged": "^13.1.0",
|
||||
"markdownlint": "^0.27.0",
|
||||
"markdownlint-cli": "^0.33.0",
|
||||
"npm-package-json-lint": "^6.4.0",
|
||||
"npm-package-json-lint-config-default": "^5.0.0",
|
||||
"pnpm-deduplicate": "^0.4.1",
|
||||
"prettier": "^2.8.3",
|
||||
"prettier-plugin-packagejson": "^2.4.2",
|
||||
"release-it": "^15.6.0",
|
||||
"sentences-per-line": "^0.2.1",
|
||||
"should-semantic-release": "^0.1.0",
|
||||
"tsup": "^6.7.0",
|
||||
"typescript": "^5.0.0",
|
||||
"vitest": "^0.29.0",
|
||||
"yaml-eslint-parser": "^1.2.0"
|
||||
},
|
||||
"packageManager": "pnpm@7.31.0",
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user