eslint-mdx
Advanced tools
Comparing version 2.1.0 to 2.2.0
export * from './helpers'; | ||
export * from './meta'; | ||
export * from './parser'; | ||
export * from './sync'; | ||
export * from './types'; |
@@ -5,2 +5,3 @@ "use strict"; | ||
tslib_1.__exportStar(require("./helpers"), exports); | ||
tslib_1.__exportStar(require("./meta"), exports); | ||
tslib_1.__exportStar(require("./parser"), exports); | ||
@@ -7,0 +8,0 @@ tslib_1.__exportStar(require("./sync"), exports); |
{ | ||
"name": "eslint-mdx", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "ESLint Parser for MDX", | ||
@@ -33,11 +33,11 @@ "repository": "git+https://github.com/mdx-js/eslint-mdx.git", | ||
"dependencies": { | ||
"acorn": "^8.8.2", | ||
"acorn": "^8.10.0", | ||
"acorn-jsx": "^5.3.2", | ||
"espree": "^9.5.1", | ||
"espree": "^9.6.1", | ||
"estree-util-visit": "^1.2.1", | ||
"remark-mdx": "^2.3.0", | ||
"remark-parse": "^10.0.1", | ||
"remark-stringify": "^10.0.2", | ||
"remark-parse": "^10.0.2", | ||
"remark-stringify": "^10.0.3", | ||
"synckit": "^0.8.5", | ||
"tslib": "^2.5.0", | ||
"tslib": "^2.6.1", | ||
"unified": "^10.1.2", | ||
@@ -44,0 +44,0 @@ "unified-engine": "^10.1.0", |
@@ -35,2 +35,4 @@ <p align="center"> | ||
- [Usage](#usage) | ||
- [Classic](#classic) | ||
- [Flat Config](#flat-config) | ||
- [Parser Options](#parser-options) | ||
@@ -78,23 +80,55 @@ - [Rules](#rules) | ||
1. In your ESLint 8+ config file, just add: | ||
### Classic | ||
```jsonc | ||
{ | ||
"extends": ["plugin:mdx/recommended"], | ||
// optional, if you want to lint code blocks at the same time | ||
"settings": { | ||
"mdx/code-blocks": true, | ||
// optional, if you want to disable language mapper, set it to `false` | ||
// if you want to override the default language mapper inside, you can provide your own | ||
"mdx/language-mapper": {} | ||
} | ||
} | ||
``` | ||
`.eslintrc` file: | ||
2. Make sure ESLint knows to run on `.md` or `.mdx` files: | ||
```jsonc | ||
{ | ||
"extends": ["plugin:mdx/recommended"], | ||
// optional, if you want to lint code blocks at the same time | ||
"settings": { | ||
"mdx/code-blocks": true, | ||
// optional, if you want to disable language mapper, set it to `false` | ||
// if you want to override the default language mapper inside, you can provide your own | ||
"mdx/language-mapper": {} | ||
} | ||
} | ||
``` | ||
```sh | ||
eslint . --ext js,md,mdx | ||
``` | ||
### Flat Config | ||
`eslint.config.js` file: | ||
```js | ||
import * as mdx from 'eslint-plugin-mdx' | ||
export default [ | ||
{ | ||
...mdx.flat, | ||
// optional, if you want to lint code blocks at the same | ||
processor: mdx.createRemarkProcessor({ | ||
lintCodeBlocks: true, | ||
// optional, if you want to disable language mapper, set it to `false` | ||
// if you want to override the default language mapper inside, you can provide your own | ||
languageMapper: {}, | ||
}), | ||
}, | ||
{ | ||
...mdx.flatCodeBlocks, | ||
rules: { | ||
...mdx.flatCodeBlocks.rules, | ||
// if you want to override some rules for code blocks | ||
'no-var': 'error', | ||
'prefer-const': 'error', | ||
}, | ||
}, | ||
] | ||
``` | ||
Then, make sure ESLint knows to run on `.md` or `.mdx` files: | ||
```sh | ||
eslint . --ext js,md,mdx | ||
``` | ||
## Parser Options | ||
@@ -101,0 +135,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78900
27
941
216
Updatedacorn@^8.10.0
Updatedespree@^9.6.1
Updatedremark-parse@^10.0.2
Updatedremark-stringify@^10.0.3
Updatedtslib@^2.6.1