remark-lint-code-block-syntax
Advanced tools
Comparing version
13
index.js
@@ -1,10 +0,9 @@ | ||
"use strict"; | ||
import { lintRule } from "unified-lint-rule"; | ||
import { visit } from "unist-util-visit"; | ||
import { default as esprima } from "esprima"; | ||
import { default as yaml } from "js-yaml"; | ||
const rule = require("unified-lint-rule"); | ||
const visit = require("unist-util-visit"); | ||
const esprima = require("esprima"); | ||
const yaml = require("js-yaml"); | ||
const remarkLintCodeBlockSyntax = lintRule("remark-lint:code-block-syntax", codeSyntax); | ||
export default remarkLintCodeBlockSyntax; | ||
module.exports = rule("remark-lint:code-block-syntax", codeSyntax); | ||
function codeSyntax(tree, file) { | ||
@@ -11,0 +10,0 @@ const supportedLangs = ["js", "json", "yaml"]; |
{ | ||
"name": "remark-lint-code-block-syntax", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "A remark-lint rule to check language syntax in a code block.", | ||
@@ -16,8 +16,20 @@ "author": "Masafumi Koba", | ||
"repository": "ybiquitous/remark-lint-code-block-syntax", | ||
"main": "index.js", | ||
"files": [], | ||
"engines": { | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
}, | ||
"type": "module", | ||
"exports": "./index.js", | ||
"files": [ | ||
"index.js" | ||
], | ||
"scripts": { | ||
"test": "jest", | ||
"lint": "npx eslint . && npx prettier --check .", | ||
"format": "npx prettier --write ." | ||
"test": "NODE_OPTIONS=--experimental-vm-modules jest", | ||
"lint": "npm run eslint && npm run prettier:check", | ||
"lint:fix": "npm run eslint:fix && npm run prettier:write", | ||
"eslint": "npx eslint --ignore-path=.gitignore .", | ||
"eslint:fix": "npm run eslint -- --fix", | ||
"prettier": "npx prettier --ignore-path=.gitignore .", | ||
"prettier:check": "npm run prettier -- --check", | ||
"prettier:write": "npm run prettier -- --write", | ||
"prepublishOnly": "npm test" | ||
}, | ||
@@ -27,9 +39,21 @@ "dependencies": { | ||
"js-yaml": "^4.0.0", | ||
"unified-lint-rule": "^1.0.5", | ||
"unist-util-visit": "^2.0.2" | ||
"unified-lint-rule": "^2.0.0", | ||
"unist-util-visit": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"jest": "^26.0.1", | ||
"remark": "^13.0.0" | ||
"jest": "^27.0.3", | ||
"remark": "^14.0.1" | ||
}, | ||
"eslintConfig": { | ||
"root": true, | ||
"extends": "eslint:recommended", | ||
"parserOptions": { | ||
"sourceType": "module" | ||
}, | ||
"env": { | ||
"es2017": true, | ||
"node": true, | ||
"jest": true | ||
} | ||
} | ||
} |
@@ -21,6 +21,16 @@ [](https://www.npmjs.com/package/remark-lint-code-block-syntax) | ||
Via a command-line argument: | ||
```console | ||
$ npx remark -u remark-lint-code-block-syntax | ||
$ remark --use remark-lint-code-block-syntax | ||
docs/config.md | ||
32:1-32:4 warning Invalid JSON: Unexpected token a in JSON at position 128 code-block-syntax remark-lint | ||
``` | ||
Via a configuration file: | ||
```json | ||
{ | ||
"plugins": ["remark-lint-code-block-syntax"] | ||
} | ||
``` |
4783
22.64%36
38.46%Yes
NaN+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated