New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

fe-standard

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fe-standard

影刀前端规范

latest
npmnpm
Version
0.0.3
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

影刀规范配置项目

整合各个业务项目间的统一的规范配置文件,

项目结构

业务项目配置方式

大前提,先安装fe-standard

npm i fe-standard -D

eslint

  • 安装eslint

    npm i eslint -D
    
  • 在项目根目录下新建 .eslintrc.js

  • 配置如下

    const eslint = require('fe-standard/lint/eslint');
    
    module.exports = {
        ...eslint,
    };
    

stylelint

  • 安装stylelint

    npm i stylelint -D
    
  • 在项目根目录下新建 .stylelintrc.js

  • 配置如下

    const stylelint = require('fe-standard/lint/stylelint');
    
    module.exports = {
        ...stylelint,
    };
    

commitlint 与 pushlint

  • 安装husky
    npm i husky@4.3.8 -D
    
  • pakage.json 中配置
      "husky":{
        "hooks":{
            "pre-commit": "lint-staged",
            "commit-msg": "node ./node_modules/fe-standard/lint/commitlint",
            "pre-push": "node ./node_modules/fe-standard/lint/pushlint"
        }
    },
    
  • pacage.json script中补充
    "lint": "npm run lint:js && npm run lint:style && npm run lint:prettier",
    "lint-staged": "lint-staged",
    "lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx ",
    "lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src && npm run lint:style",
    "lint:js": "cross-env TIMING=1 eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
    "lint:prettier": "prettier --check \"**/*\" --end-of-line auto",
    "lint:style": "stylelint --fix \"src/**/*.less\" --syntax less"
    

注意

Keywords

eslint

FAQs

Package last updated on 08 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts