question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve the UX of using an npm installed formatter

See original GitHub issue

This is currently what you have to write to use a custom npm installed formatter with ESLint:

$ eslint --format=node_modules/eslint-formatter-unicorn file.js

That’s not very user-friendly.

I propose the following:

  1. Make getFormatter() try to require the formatter from cwd first. That way you could just do:
$ eslint --format=eslint-formatter-unicorn file.js
  1. Make it possible to omit the eslint-formatter prefix. This matches the convention for shareable configs. This combined with 1. would mean you could just do:
$ eslint --format=unicorn file.js

Much nicer! ✨

I would also document the recommendation of using the eslintformatter keyword in package.json, like you do with shareable configs. This would make it easier for users to find third-party formatters.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
ilyavolodincommented, Apr 19, 2016

I was wondering if we should instead add formatters to be distributed through plugins? Formatters are the only thing we currently have that we don’t have a recommended way of shearing.

0reactions
not-an-aardvarkcommented, Nov 3, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

precise-ui - npm
The following sections guide you through the process of developing Precise UI. Installation. For development you will need NPM and Node.js 8+.
Read more >
Let's Build a Web App with NPM and Express - This Dot Labs
We'll be building a simple express application, so we want to install the express package from npm. This can be done by running...
Read more >
Linting in TypeScript using ESLint and Prettier - LogRocket Blog
Integrate Prettier with ESLint to automate type-checking in your TypeScript code and ensure that the code has no bugs.
Read more >
How to use Prettier with ESLint and TypeScript in VSCode
Decide on the formatting configuration that best suits your style; Configure Prettier to work with ESLint. Prerequisites. A code editor ...
Read more >
What is NPM? The Complete 2023 Beginner's Guide
The package.json file is in JSON format and is used for managing the ... These are installed using npm install to add the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found