API Extractor 使用

Alan

Alan

Maintainer of blog

安装eslint#

参考eslint-plugin-tsdoc

npm i -D @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-plugin-tsdoc
.eslintrc.js
module.exports = {
plugins: [
"@typescript-eslint/eslint-plugin",
"eslint-plugin-tsdoc"
],
extends: [
'plugin:@typescript-eslint/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
ecmaVersion: 2018,
sourceType: "module"
},
rules: {
"tsdoc/syntax": "warn"
}
};

api extractor 配置#

参考 API Extractor: Invoking API Extractor

npm i -D @microsoft/api-extractor
npx api-extractor init
npx api-extractor run --local --verbose

其他参考文档 前端开发者如何用 API Extractor 管理 API?