Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

markdown-list-linter

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-list-linter - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

15

package.json
{
"name": "markdown-list-linter",
"version": "0.0.4",
"version": "0.0.5",
"description": "Lint markdown lists to warn when list items are not alphabetically ordered",

@@ -24,3 +24,14 @@ "main": "./lib/markdown-list-linter.min.js",

"keywords": [
"markdown"
"markdown",
"markdown npm",
"markdown library",
"markdown linter",
"markdown lists",
"markdown list linter",
"alphabetically order markdown list",
"sort markdown lists",
"order markdown lists",
"library to order markdown list",
"library to sort markdown list",
"library to alphabetically sort markdown list"
],

@@ -27,0 +38,0 @@ "author": "Clyde D'Souza",

@@ -1,1 +0,74 @@

Todo
# Markdown List Linter
Lints markdown lists and warn when list items are not alphabetically ordered.
## A complete solution
This functionality is available to be consumed in three different ways:
* ⚡ [A GitHub Action](https://github.com/marketplace/actions/markdown-list-linter) as part of your CI/CD process
* 📦 [An NPM package](https://www.npmjs.com/package/markdown-list-linter) that can be consumed in your JavaScript or TypeScript code
* 💻 [A CLI](https://www.npmjs.com/package/markdown-list-linter-cli) that you can run in your terminal
## Installation
You can install this package in your JavaScript or Typescript project.
```shell
npm install markdown-list-linter
```
## Usage
Very simple to use, all results will be container in the returned object.
```typescript
import { lintMarkdownList } from '../src/markdown-list-linter'
const results = lintMarkdownList('./path/to/markdown/file.md')
console.log(results)
```
When there are no errors, the returned object should look something like this.
```json
{ 'summary': 'No errors found' }
```
When there are errors, the returned object should look something like this.
```json
{
'summary': 'Markdown list needs to be sorted',
'errorObject': [
{
'type': 'HEADINGS',
'message': 'Please correct the alphabetical order for these heading items',
'details': [
['C'],
['D', 'A']
],
},
{
'type': 'LIST_ITEMS',
'message': 'Please correct the alphabetical order for these list items',
'details': [
[
`[African Buffalo]('https://www.AfricanBuffalo.com')`,
`[Aardwolf]('https://www.Aardwolf.com')`
],
[
`[Chameleon]('https://www.Chameleon.com')`,
`[Camel]('https://www.Camel.com')`,
`[Cheetah]('https://www.Cheetah.com')`,
`[Canary]('https://www.Canary.com')`
]
],
}
]
}
```
The array items in the `details` object is sections in the list which need to be reordered.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc