@lough/lint-cli v0.3.0
@lough/lint-cli
This is a Lint tool docked in lough.
Feature
JavaScript
开发中的代码规范自动化搭建脚手架。
支持以下功能
eslint
: 校验Javascript
代码安装
VSCode
插件ESLint
typescript
: 支持typescript
开发校验react
: 支持react
技术栈开发校验node
: 支持node
开发校验base
:javascript
基础校验
stylelint
: 校验CSS
代码安装
VSCode
插件Stylelint
commitlint
: 利用Git
hooks
提交前校验代码prettier
: 格式化代码安装
VSCode
插件Prettier - Code formatter
editor
: 统一编辑器配置安装
VSCode
插件EditorConfig for VS Code
Install
npm i @lough/lint-cli -g
or
yarn add @lough/lint-cli -g
Usage
lough-lint init
CMD
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 months ago
2 months ago
2 months ago
2 months ago
9 months ago
9 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago