-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support new flat config (#468)
close #455
- Loading branch information
Showing
20 changed files
with
423 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"eslint-mdx": minor | ||
"eslint-plugin-mdx": minor | ||
--- | ||
|
||
feat: add metadata for parser, processor and plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"eslint-plugin-mdx": minor | ||
--- | ||
|
||
feat: support new flat config - close #455 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from './helpers' | ||
export * from './meta' | ||
export * from './parser' | ||
export * from './sync' | ||
export * from './types' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error -- no idea | ||
// @ts-ignore | ||
import { name, version } from '../package.json' | ||
|
||
export const meta = { name, version } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import type { Linter } from 'eslint' | ||
import * as eslintMdx from 'eslint-mdx' | ||
|
||
import * as mdx from '..' | ||
|
||
import { codeBlocks } from './code-blocks' | ||
|
||
export const flat: Linter.FlatConfig = { | ||
files: ['**/*.{md,mdx}'], | ||
languageOptions: { | ||
sourceType: 'module', | ||
ecmaVersion: 'latest', | ||
parser: eslintMdx, | ||
globals: { | ||
React: false, | ||
}, | ||
}, | ||
plugins: { | ||
mdx, | ||
}, | ||
rules: { | ||
'mdx/remark': 'warn', | ||
'no-unused-expressions': 'error', | ||
'react/react-in-jsx-scope': 0, | ||
}, | ||
} | ||
|
||
const { parserOptions, ...restConfig } = codeBlocks | ||
|
||
export const flatCodeBlocks: Linter.FlatConfig = { | ||
files: ['**/*.{md,mdx}/*'], | ||
languageOptions: { | ||
parserOptions, | ||
}, | ||
...restConfig, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from './configs' | ||
export * from './helpers' | ||
export * from './meta' | ||
export * from './processors' | ||
export * from './rules' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error -- no idea | ||
// @ts-ignore | ||
import { name, version } from '../package.json' | ||
|
||
export const meta = { name, version } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
/** | ||
* workaround for @link https://github.com/benmosher/eslint-plugin-import/issues/2002 | ||
*/ | ||
|
||
import { remark } from './remark' | ||
|
||
export * from './helpers' | ||
export * from './options' | ||
export { createRemarkProcessor } from './remark' | ||
export * from './types' | ||
|
||
export const processors = { remark } |
Oops, something went wrong.