A babel plugin for textlint-scripts.
- Generate
meta
data for the rule automatically - Convert TypeScript's
Option
type to JSON Schema
In
export type Options = {
str_key: string;
};
const report = () => {
return {};
};
export default report;
Out
const report = () => {
return {};
};
export default report;
export const meta = {
name: "@textlint/babel-plugin-textlint-scripts",
description: "A babel plugin for textlint-scripts.",
homepage: "https://github.com/textlint/babel-plugin-textlint-scripts",
schema: {
"type": "object",
"properties": {
"str_key": {
"type": "string"
}
},
"additionalProperties": false,
"required": ["str_key"],
"$schema": "http://json-schema.org/draft-07/schema#"
}
};
$ npm install @textlint/babel-plugin-textlint-scripts
.babelrc
{
"plugins": ["@textlint/textlint-scripts"]
}
$ babel --plugins textlint-scripts script.js
require("babel-core").transform("code", {
plugins: ["@textlint/textlint-scripts"]
});
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
MIT