0.1.0-alpha.1 • Published 3 years ago

@copyist/eslint-plugin v0.1.0-alpha.1

Weekly downloads
18
License
MIT
Repository
github
Last release
3 years ago

@copyist/eslint-plugin

eslint插件

yarn add @copyist/eslint-plugin -D

需要配合相关依赖

yarn add eslint prettier eslint-config-prettier eslint-plugin-prettier eslint-config-airbnb-base -D # js # prettier@2.0.0?
yarn add eslint-config-airbnb eslint-plugin-react -D  # react
yarn add @typescript-eslint/eslint-plugin @typescript-eslint/parser -D  # ts

.vscode/settings.json

{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
}

.eslintrc.json

{
  "extends": ["plugin:@copyist/react-ts"],
  "parserOptions": {
    "project": "./tsconfig.json"
  },
  "plugins": ["@copyist"]
}

配合husky

yarn add husky lint-staged
{
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "src/**/*.{ts,tsx,js,jsx}": [
      "eslint --fix"
    ]
  }
}

参考linxiaowu66/eslint-config-templateseslint-config-ali