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

@ktxtr/eslint-plugin-prettier

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ktxtr/eslint-plugin-prettier

Prettier2eslint bridge designed by (& for) kontextR

  • 1.0.0
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

kontextR prettier2eslint plugin

How to use it

You will need to install prettier-eslint and preconfigure both using the @ktxtr/eslint-config package.

Include this rule in your eslint configuration with:

plugins: [
  "@ktxtr/prettier"
],
rules: {
  "@ktxtr/prettier/{rule}": ...
}

Available rules

no-long-implicit-arrow

You might want to write an arrow function which looks like this:

const sayHello = () => console.log("hello!")

This is fine as long as the function is short enough. If it is too long though it becomes difficult to read:

const sayLongHello = (name = 'Mr. Incognito') => console.log(`This is just a test method. \n Hi${name}! That's all buddy!`);

This rule will break the method arguments into their own line, if it figures it will reduce the line length under the specified limit.

const sayLongHello = (name = 'Mr. Incognito') => console.log(
  `This is just a test method. \n Hi${name}! That's all buddy!`
);

You can use it with:

  "rules": {
    "@ktxtr/prettier/no-long-implicit-arrow": [{severity}, {max-arrow-line-length}]
  } 

It also accepts general settings:

settings: {
  maxLength: {max-arrow-line-length}
}

This rules ensures consistency between prettier's arrow function formatting and eslint's implicit-arrow-line-break.

Keywords

FAQs

Package last updated on 25 Sep 2018

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