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

@bigpicturemedical/eslint-config

Package Overview
Dependencies
Maintainers
4
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bigpicturemedical/eslint-config

Big Picture Medical EsLint config - Style your code just like we do

  • 0.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
40
decreased by-47.37%
Maintainers
4
Weekly downloads
 
Created
Source

eslint-config

A ESLint config for Big Picture Medical

Installation

npm i --save-dev @bigpicturemedical/eslint-config

Usage

Vue

In .eslintrc.js:

module.exports = {
  extends: [ "@bigpicturemedical/eslint-config/vue" ]
}

In package.json:

"scripts": {
  "lint": "eslint ./src/ --ext .ts,.vue"
}

Configure VSCODE

Install the eslint extension: dbaeumer.vscode-eslint

in settings.json

"eslint.options": {
  "extensions": [
    ".html",
    ".js",
    ".jsx",
    ".ts",
    ".vue"
  ]
},
"eslint.validate": [
  {
    "language": "typescript",
    "autoFix": true
  },
  {
    "language": "vue",
    "autoFix": true
  },
],

How to contribute

  1. Create a PR to submit changes

Code Style

Our style basis is a work in progress.

Whitespace

Let your code breath a little...use whitespace. Generally leave a line between function declaration and code in the function (and before closing brace):

const patch = (req: Request, res: Response, next: NextFunction) => {

  const { id, code, email } = req.params

  return update({ id, code, email }, req.body)
    .then(() => {
      return getByEmail({ id, code, email })
    })
    .then((user) => {
      res.json(user)
    })
    .catch(next)

}

Group logical chunks of code together - use whitespace like paragraphs, communicate your intent to the person who comes after you...

const abc = (param) => {

  const { aaa, bbb, ccc } = param;
  const x = 1;
  const y = 2;

  if (aaa === 123) {
    someService.doSomething(bbb, ccc);
    someService.doSomethingElse(ccc);
    someService.andThen(ccc);
  }

  someService.xxx(bbb);
  someService.yyy(ccc);
  someService.zzz(ccc);

};

Same for test specs

describe(suiteName(__filename), () => {

  afterEach(() => {
    jest.resetAllMocks();
  });

  describe('get', () => {

    it('correct values returned', async () => {

      const user: any = {};
      // more code

Keywords

FAQs

Package last updated on 19 Nov 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

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