eslint-mdx
Advanced tools
Comparing version 1.16.0 to 1.17.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [1.17.0](https://github.com/mdx-js/eslint-mdx/compare/v1.16.0...v1.17.0) (2022-03-21) | ||
### Features | ||
* allow to ignore remark config ([#374](https://github.com/mdx-js/eslint-mdx/issues/374)) ([1c9e3fd](https://github.com/mdx-js/eslint-mdx/commit/1c9e3fdccbd7571cec4ea2758412ace1dfe19222)) | ||
# [1.16.0](https://github.com/mdx-js/eslint-mdx/compare/v1.15.1...v1.16.0) (2021-10-20) | ||
@@ -8,0 +19,0 @@ |
@@ -101,3 +101,3 @@ "use strict"; | ||
} | ||
const root = (0, processor_1.getRemarkProcessor)((0, processor_1.getPhysicalFilename)(options.filePath), isMdx).parse(code); | ||
const root = (0, processor_1.getRemarkProcessor)((0, processor_1.getPhysicalFilename)(options.filePath), isMdx, Boolean(options.ignoreRemarkConfig)).parse(code); | ||
this._ast = Object.assign(Object.assign({}, (0, helpers_1.normalizePosition)(root.position)), { type: 'Program', sourceType: options.sourceType || 'module', body: [], comments: [], tokens: [] }); | ||
@@ -104,0 +104,0 @@ this._services = { |
@@ -11,2 +11,2 @@ import type { FrozenProcessor } from 'unified'; | ||
export declare const remarkProcessor: FrozenProcessor<unified.Settings>; | ||
export declare const getRemarkProcessor: (searchFrom: string, isMdx: boolean) => FrozenProcessor<unified.Settings>; | ||
export declare const getRemarkProcessor: (searchFrom: string, isMdx: boolean, ignoreRemarkConfig: boolean) => FrozenProcessor<unified.Settings>; |
@@ -65,4 +65,3 @@ "use strict"; | ||
exports.processorCache = new Map(); | ||
// eslint-disable-next-line sonarjs/cognitive-complexity | ||
const getRemarkProcessor = (searchFrom, isMdx) => { | ||
const getRemarkProcessor = (searchFrom, isMdx, ignoreRemarkConfig) => { | ||
const initCacheKey = `${String(isMdx)}-${searchFrom}`; | ||
@@ -73,3 +72,5 @@ let cachedProcessor = exports.processorCache.get(initCacheKey); | ||
} | ||
const result = explorer.search(searchFrom); | ||
const result = ignoreRemarkConfig | ||
? null | ||
: explorer.search(searchFrom); | ||
const cacheKey = result ? `${String(isMdx)}-${result.filepath}` : ''; | ||
@@ -76,0 +77,0 @@ cachedProcessor = exports.processorCache.get(cacheKey); |
@@ -37,2 +37,3 @@ import type { JSXElement, JSXFragment } from '@babel/types'; | ||
parser?: ParserConfig | ParserFn | string; | ||
ignoreRemarkConfig?: boolean; | ||
} | ||
@@ -39,0 +40,0 @@ export declare type Traverser = (node: Node, parent?: Parent) => void; |
{ | ||
"name": "eslint-mdx", | ||
"version": "1.16.0", | ||
"version": "1.17.0", | ||
"description": "ESLint Parser for MDX", | ||
@@ -41,3 +41,3 @@ "repository": "git+https://github.com/mdx-js/eslint-mdx.git", | ||
}, | ||
"gitHead": "062aad5440be6546d8f2fcf78bfd540b2b2b26e4" | ||
"gitHead": "16c5934530b2f55059dcb7695707f721a693a0d6" | ||
} |
@@ -193,2 +193,4 @@ <p align="center"> | ||
4. `ignoreRemarkConfig` (`boolean`): Ignore the `remark` configuration defined in the project. | ||
## Rules | ||
@@ -227,2 +229,4 @@ | ||
Some plugins are ESM and eslint don't supports them. So, a workaround is to set `ignoreRemarkConfig` to `true` and execute `remark-lint` through the terminal before running eslint. For example: `remark **/*.mdx --no-stdout && eslint . --fix --ext .mdx`. | ||
## Prettier Integration | ||
@@ -229,0 +233,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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
113048
1447
265
0