0.3.0 • Published 2 months ago

@lough/lint-cli v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

@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

属性说明
typescriptTypeScript'typescript'
reactReact'react'
nodeNode'node'

Interface

InitFlowLifeCycle 初始化流生命周期

members

属性说明类型
eslintStarteslint 开始() => any
eslintEndeslint 结束() => any
tsconfigStarttsconfig 开始() => any
tsconfigEndtsconfig 结束() => any
stylelintStartstylelint 开始() => any
stylelintEndstylelint 结束() => any
commitlintStartcommitlint 开始() => any
commitlintEndcommitlint 结束() => any
editorStarteditor 开始() => any
editorEndeditor 结束() => any
prettierStartprettier 开始() => any
prettierEndprettier 结束() => any

InitFlowParameters 初始化流参数

members

属性说明类型
techType技术类型TECH_TYPE
cycle生命周期InitFlowLifeCycle
npmPackage
0.3.0

2 months ago

0.3.0-alpha.2

2 months ago

0.3.0-alpha.0

2 months ago

0.3.0-alpha.1

2 months ago

0.2.5

9 months ago

0.2.4

9 months ago

0.2.0-alpha.0

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.2.0-alpha.1

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.1.3

1 year ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago