Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bifravst/code-style

Package Overview
Dependencies
Maintainers
2
Versions
165
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bifravst/code-style

Code style definitions for all Bifravst projects.

  • 8.0.134
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
39
decreased by-73.83%
Maintainers
2
Weekly downloads
 
Created
Source

Bifravst Code Style npm version

GitHub Actions Known Vulnerabilities semantic-release Renovate Mergify Status Commitizen friendly code style: prettier ESLint: TypeScript

Code style definitions for all Bifravst projects.

  • ESLint configuration (with TypeScript support)
  • Prettier configuration

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

Keywords

FAQs

Package last updated on 09 Oct 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc