@lough/lint-cli v0.3.0
@lough/lint-cli
This is a Lint tool docked in lough.
Feature
JavaScript开发中的代码规范自动化搭建脚手架。
支持以下功能
eslint: 校验Javascript代码安装
VSCode插件ESLinttypescript: 支持typescript开发校验react: 支持react技术栈开发校验node: 支持node开发校验base:javascript基础校验
stylelint: 校验CSS代码安装
VSCode插件Stylelintcommitlint: 利用Githooks提交前校验代码prettier: 格式化代码安装
VSCode插件Prettier - Code formattereditor: 统一编辑器配置安装
VSCode插件EditorConfig for VS Code
Install
npm i @lough/lint-cli -gor
yarn add @lough/lint-cli -gUsage
lough-lint initCMD
Command
lough-lint [options] [command]init project lint function.
options:
"-tt, --techType [string]", "init tech type: typescript | react | node""-n, --norms [string...]", "init lint norms: tsconfig | eslint | stylelint | commitlint | prettier | editor""-q, --quite [boolean]", "execute the program silently.", false
action: (options: IOptions) => Promise<void>
API
Class
InitFlow 初始化流
parameters
| 属性 | 说明 | 必传 | 类型 | 默认值 |
|---|---|---|---|---|
| parameters | - | 是 | InitFlowParameters | - |
returns: InitFlow
members
| 属性 | 说明 | 类型 | 标记 |
|---|---|---|---|
| eslint | 代码 | () => void | |
| tsconfig | 类型 | () => void | |
| stylelint | 样式 | () => void | |
| commitlint | 提交 | () => void | |
| editor | 编辑器 | () => void | |
| prettier | 格式化 | () => void | |
| pipeline | 流水线 | (params: { normList: NORM_TYPE[]; }) => void |
Enum
NORM_TYPE 规范类型
members
| 属性 | 说明 | 值 |
|---|---|---|
| tsconfig | 类型 | 'tsconfig' |
| eslint | 代码 | 'eslint' |
| stylelint | 样式 | 'stylelint' |
| commitlint | 提交 | 'commitlint' |
| prettier | 格式化 | 'prettier' |
| editor | 编辑器 | 'editor' |
TECH_TYPE 技术类型
members
| 属性 | 说明 | 值 |
|---|---|---|
| typescript | TypeScript | 'typescript' |
| react | React | 'react' |
| node | Node | 'node' |
Interface
InitFlowLifeCycle 初始化流生命周期
members
| 属性 | 说明 | 类型 |
|---|---|---|
| eslintStart | eslint 开始 | () => any |
| eslintEnd | eslint 结束 | () => any |
| tsconfigStart | tsconfig 开始 | () => any |
| tsconfigEnd | tsconfig 结束 | () => any |
| stylelintStart | stylelint 开始 | () => any |
| stylelintEnd | stylelint 结束 | () => any |
| commitlintStart | commitlint 开始 | () => any |
| commitlintEnd | commitlint 结束 | () => any |
| editorStart | editor 开始 | () => any |
| editorEnd | editor 结束 | () => any |
| prettierStart | prettier 开始 | () => any |
| prettierEnd | prettier 结束 | () => any |
InitFlowParameters 初始化流参数
members
| 属性 | 说明 | 类型 |
|---|---|---|
| techType | 技术类型 | TECH_TYPE |
| cycle | 生命周期 | InitFlowLifeCycle |
| npm | 包 | Package |
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago