@bifravst/code-style
Code style definitions for all Bifravst projects.
Last updated 2 days ago by bifravst-ci .
BSD-3-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @bifravst/code-style 
SYNC missed versions from official npm registry.

Bifravst Code Style npm version

GitHub Actions semantic-release Commitizen friendly code style: prettier ESLint: TypeScript

Code style definitions for all Bifravst projects.

Installation

npm i --save-dev @bifravst/code-style

Usage

Update your package.json:

{
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{ts,tsx}": ["prettier --write", "eslint --ext .js,.ts", "git add"],
    "*.{md,json,yaml,yml,js}": ["prettier --write", "git add"]
  }
}

Then:

npm i --save-dev @bifravst/code-style
cp node_modules/@bifravst/code-style/templates/* ./
cp node_modules/@bifravst/code-style/templates/.* ./

Use with React

npm install eslint-plugin-react --save-dev

Use this .eslintrc

{
  "extends": ["@bifravst/eslint-config-typescript", "plugin:react/recommended"],
  "settings": {
    "react": {
      "version": "latest"
    }
  }
}

tsconfig.json:

{
  "extends": "@bifravst/code-style/tsconfig.json",
  "include": ["src/*.tsx", "src/*.ts"],
  "exclude": ["src/*.spec.ts"],
  "compilerOptions": {
    "outDir": "dist/",
    "jsx": "react",
    "lib": ["DOM", "ES5"],
    "target": "es2018",
    "esModuleInterop": true
  }
}

Use with Creat React App

Use this .eslintrc

{
  "extends": ["@bifravst/eslint-config-typescript", "react-app"]
}
npm i --save-dev babel-eslint@10.0.2 eslint-config-react-app@5.0.1 eslint-plugin-flowtype@4.2.0 eslint-plugin-import@2.18.2 eslint-plugin-jsx-a11y@6.2.3 eslint-plugin-react@7.14.3 eslint-plugin-react-app@6.0.0 eslint-plugin-react-hooks@1.7.0

Do not use tsconfig.json from code-style.

Migrating to @bifravst/code-style

For converting projects to use code-style:

npm uninstall --save --save-dev @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier lint-staged prettier semantic-release @bifravst/code-style tslint lint-staged prettier typescript

Current Tags

  • 8.0.0                                ...           latest (2 days ago)

26 Versions

  • 8.0.0                                ...           2 days ago
  • 7.1.11                                ...           20 days ago
  • 7.1.10                                ...           23 days ago
  • 7.1.9                                ...           23 days ago
  • 7.1.8                                ...           a month ago
  • 7.1.7                                ...           a month ago
  • 7.1.6                                ...           a month ago
  • 7.1.5                                ...           a month ago
  • 7.1.4                                ...           a month ago
  • 7.1.3                                ...           a month ago
  • 7.1.2                                ...           a month ago
  • 7.1.1                                ...           a month ago
  • 7.1.0                                ...           a month ago
  • 4.0.2                                ...           8 months ago
  • 4.0.1                                ...           8 months ago
  • 4.0.0                                ...           8 months ago
  • 3.1.0                                ...           8 months ago
  • 3.0.1                                ...           9 months ago
  • 3.0.0                                ...           9 months ago
  • 2.2.1                                ...           9 months ago
  • 2.2.0                                ...           9 months ago
  • 2.1.1                                ...           10 months ago
  • 2.1.0                                ...           10 months ago
  • 2.0.2                                ...           10 months ago
  • 2.0.1                                ...           10 months ago
  • 2.0.0                                ...           10 months ago
Downloads
Today 0
This Week 10
This Month 75
Last Day 1
Last Week 25
Last Month 102
Dependencies (4)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |