パッケージの詳細

f2elint

alibaba892MIT6.1.1

Linter for Alibaba F2E Guidelines

f2elint, Alibaba F2E Guidelines

readme

f2elint

f2elint 是《阿里巴巴前端规约》的配套初始化工具,可以为各种前端和 Node.js 项目一键接入规约,保障项目的编码规范和代码质量。

CLI

npx f2elint

screenshot

Monorepo

多包项目和前后端分离项目经常采用 monorepo 的项目代码管理模式,即一个 git 仓库中包含多个不同类型的应用,无法使用同一套规约。这种情况下,我们建议:

  1. 在仓库根目录运行 npx f2elint 并选择 Base 模板
  2. 切换到子应用/子包目录并运行 npx f2elint 并选择适合的模板,f2elint 会自动检测子应用/子包,并跳过 lint-staged 和 commitlint

示例 1:前后端分离应用

npx f2elint # 选择 Base 模板

cd client
npx f2elint # 选择 React 模板

cd ../server
npx f2elint # 选择 Base 模板

示例 2:多包项目

npx f2elint # 选择 Base 模板

cd packages/cli
npx f2elint # 选择 Base 模板

cd ../react
npx f2elint # 选择 React 模板

API

npm install --save f2elint
import { f2elint, TemplateType } from 'f2elint';

await f2elint('path/to/project', {
  template: TemplateType.ReactTS,
  stylelint: true,
  prettier: true,
  lintStaged: true,
  commitlint: false,
});

更新履歴

Changelog

6.1.1 - 2025-06-08

  • fix(stylelint): add --allow-empty-input argument

6.1.0 - 2025-05-13

  • feat(lint-staged): update lint-staged from 15.x to 16.x

6.0.0 - 2025-04-27

  • feat(export)!: changed to default export

5.1.2 - 2025-04-26

  • fix(install): change npm update to npm install for smoother integration

5.1.1 - 2025-04-26

  • fix(editorconfig): sort config options
  • fix(ignore): remove .ci folder
  • fix(vscode): remove other rulers

5.1.0 - 2025-04-26

  • feat(template/commitlint): switch to @commitlint/config-conventional

5.0.6 - 2025-04-26

  • fix(template/base): add delete rule of @ali/eslint-config-att dependency

5.0.1 - 2025-04-12

  • fix(types): changed TemplateType from enum to union

5.0.0 - 2025-02-22

  • BREAKING CHANGE feat(eslint): update to ESLint 9 and change config file to eslint.config.mjs

4.9.1 - 2024-12-09

  • fix(husky): remove deprecated . "$(dirname -- "$0")/_/husky.sh" from husky git hooks