Description
The new processor API, as described in RFC #3, implemented in eslint/eslint#11552, and documented at https://eslint.org/docs/user-guide/configuring#specifying-processor, will allow users to chain processors to, for example, lint Vue and TypeScript code extracted from Markdown code blocks in addition to plain JS code that this plugin extracts today.
Currently, the processor has a hard-coded list of supported code block syntaxes:
If a code block has one of those info strings, the processor will extract the code and pass it to ESLint for linting. All other code blocks are ignored, making this plugin the gatekeeper for any additional languages.
With the new processor API, the processor will extract code from all code blocks that have a syntax set, and users will be able to configure ESLint to lint blocks of their choosing. For example, the following Markdown document would pass three code blocks to ESLint:
This code block will be extracted as `example.md/0.js`:
```js
const greeting = "Hello";
console.log(`${greeting}, world!`);
```
This code block will be extracted as `example.md/1.ts`:
```ts
const greeting: string = "Hello";
console.log(`${greeting}, world!`);
```
This code block will be extracted as `example.md/2.vue`:
```vue
<template>
<p>{{ greeting }}, world!</p>
</template>
<script>
module.exports = {
data() {
return {
greeting: "Hello"
};
}
};
</script>
```
Users will be able to configure linting of *.js
, *.ts
, and *.vue
files individually as described in the processor configuration documentation.
ESLint v6 is the first version to contain the new processor API, so this will be a breaking change that increases the minimum supported ESLint version to v6.
This tracking issue incorporates the following feature requests:
Activity
Breaking: Drop support for Node.js v6 (refs #138)
Breaking: Drop support for Node.js v6 (refs #138)
Breaking: Drop support for Node.js v6 (refs #138) (#137)
Breaking: Implement new processor API (fixes #138)
Breaking: Implement new processor API (fixes #138) (#144)