2.1.9 • Published 1 year ago

ssc-eslint v2.1.9

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Ssc Eslint · npm version Downloads

English | 简体中文

SSC code style is unified and the project is uniformly configured

Features

  1. 代码风格统一,项目统一配置 ESLint/Prettier/Husky/EditorConfig
  2. 配置 Commit message, 使用标准 commit 生成 changelog 标准化

Installation

# or pnpm or yarn
npm install ssc-eslint --save-dev

# exegesis:npx stands for Find command from current path, ./node_modules/.bin/ssc-eslint init
npx ssc-eslint init

Code Specification

ESLint:ESLint

Prettier makes writing code in one consistent style automatic, painless and so much easier. No need to spend so much time, effort and mental energy discussing styles or formatting your code. Simply press save and your code is formatted.

.eslintrc.js rules Configuration Instructions Reference:eslint docs rules

Prettier:Prettier

Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary

.prettierrc.js Configuration Instructions Reference:prettier docs

Stylelint:Stylelint

A mighty CSS linter that helps you avoid errors and enforce conventions.

.stylelintrc.js rules Configuration Instructions Reference:stylelintrc docs rules

Husky:Husky

Husky is an NPM package that lets you run a set of commands or script before any git action. For eg pre-push, pre-commit, pre-rebase.

Commitlint: Commitlint

helps your team adhere to a commit convention. By supporting npm-installed configurations it makes sharing of commit conventions easy.

EditorConfig:EditorConfig

EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs. The EditorConfig project consists of a file format for defining coding styles and a collection of text editor plugins that enable editors to read the file format and adhere to defined styles. EditorConfig files are easily readable and they work nicely with version control systems.

CSS Modules

A CSS Module is a CSS file in which all class names and animation names are scoped locally by default.

Conventional Commits

Commit message changelog

  1. The commit message should be structured as follows:
  <type>[optional scope]: <description>
  <BLANK LINE>
  [optional body]
  <BLANK LINE>
  [optional footer(s)]
  1. "type-enum": "build", "chore", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "test"

  2. type-enum documentation:

typedescription
feat(feature)Add features Introduce new features
fixBug fix Fix
perfPerformance Optimization Change code to improve performance
styleFormatting changes that do not affect the meaning of the code (spaces, missing semicolons in formatting, etc.)
docsDocument Changes Add or update documents
refactorCode refactoring is not about fixing 'bugs' or adding code changes to features
testUpdate Tests Add or update tests
ci脚本变更 对 CI 配置文件和脚本的更改(示例作用域: Travis, Circle, BrowserStack, SauceLabs)
build依赖调整 影响构建系统或外部依赖的更改 (示例作用域:gulp, broccoli, npm, vite, webpack
revertRecovery version; Revert to the previous version
choreMiscellaneous processing Other changes that do not modify the source file or the test file

Exception handling

run:npm install ssc-eslint --save-dev after warning Peer dependencies that should be installed:

install 警告

Scheme A

To resolve the above error, you can run the following command

  • run:
 pnpm config set auto-install-peers true

会在在当前项目目录下会生成一个.npmrc 文件,并生成以下配置(如若未生成对应文件,可手动生成,并设置以下内容

 auto-install-peers = true;
  • delete node_modules folder;
  • Restart the compiler;
  • npm install;

Scheme B

  • 根据提示(Peer dependencies that should be installed:)进行 install PeerDependencies 中的依赖项;

Directory

  # pnpm or yarn
  npm install directory-doc -g
  directory-doc init
# ssc-eslint directory

    |-- .git ---------------------------------- #
    |-- .husky ---------------------------------- #
    |    |-- _ ---------------------------------- #
    |    |    |-- .gitignore ---------------------------------- #
    |    |    |-- husky.sh ---------------------------------- #
    |    |-- pre-commit ---------------------------------- #
    |-- .vscode ---------------------------------- #
    |    |-- settings.json ---------------------------------- #
    |-- bin ---------------------------------- #
    |    |-- ssc-eslint.js ---------------------------------- #
    |-- node_modules ---------------------------------- #
    |-- src ---------------------------------- #
    |    |-- conf ---------------------------------- #
    |    |    |-- .eslintignore ---------------------------------- #
    |    |    |-- .eslintrc.js ---------------------------------- #
    |    |    |-- .prettierignore ---------------------------------- #
    |    |    |-- .prettierrc.js ---------------------------------- #
    |    |    |-- .stylelintignore ---------------------------------- #
    |    |    |-- .stylelintrc.js ---------------------------------- #
    |    |-- utils ---------------------------------- #
    |    |    |-- common.js ---------------------------------- #
    |    |    |-- error.js ---------------------------------- #
    |    |    |-- write.js ---------------------------------- #
    |    |-- index.js ---------------------------------- #
    |-- .eslintignore ---------------------------------- #
    |-- .eslintrc.js ---------------------------------- #
    |-- .gitignore ---------------------------------- #
    |-- .npmignore ---------------------------------- #
    |-- .prettierignore ---------------------------------- #
    |-- .prettierrc.js ---------------------------------- #
    |-- .stylelintignore ---------------------------------- #
    |-- .stylelintrc.js ---------------------------------- #
    |-- jest.config.js ---------------------------------- #
    |-- package.json ---------------------------------- #
    |-- pnpm-lock.yaml ---------------------------------- #
    |-- README.md ---------------------------------- #
2.1.9

1 year ago

2.1.8

1 year ago

2.1.7

1 year ago

2.1.6

1 year ago

2.1.5

1 year ago

2.1.4

1 year ago

2.1.3

1 year ago

2.1.2

1 year ago

2.1.1

1 year ago

2.1.0

1 year ago

2.0.9

1 year ago

2.0.8

1 year ago

2.0.7

1 year ago

2.0.6

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago