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.

Prettier on the Jest repo

See original GitHub issue

Not sure if this issue is valid by itself, but I tried out prettier on the Jest repo and there are a number of issues that I found. Feel free to close this issue if it isn’t detailed enough or you aren’t planning on fixing any of these.

I ran:

node_modules/.bin/prettier --write "packages/*/src/**.js" --single-quote --trailing-comma --bracket-spacing=false --parser=flow

on the jest repo and got a bunch of lines that are longer than 80 characters. Examples:

    return chalk.bold('No tests found') +
      '\n' +
      (data.total
        ? `  ${pluralize('file', data.total || 0, 's')} checked.\n` +
            statsMessage
        : `No files found in ${config.rootDir}.\n` +
            `Make sure Jest's configuration does not exclude this directory.\n` +
            `To set up Jest, make sure a package.json file exists.\n` +
            `Jest Documentation: facebook.github.io/jest/docs/configuration.html`);

or:

const JASMINE_IGNORE = /^\s+at(?:(?:.*?vendor\/|jasmine\-)|\s+jasmine\.buildExpectationResult)/;
const STACK_TRACE_IGNORE = /^\s+at.*?jest(-.*?)?(\/|\\)(vendor|build|node_modules|packages)(\/|\\)/;

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:20 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
cpojercommented, Feb 22, 2017

For years I’ve been using this style (cc @thymikee):

array.forEach(
  item => doSomethingWith(item),
);

but prettier prefers:

array.forEach(item =>
  doSomethingWith(item),
);

which seems less readable in the common case.

2reactions
cpojercommented, Feb 22, 2017

Happy to start using it on parts of the codebase, though: https://github.com/facebook/jest/pull/2975

Read more comments on GitHub >

github_iconTop Results From Across the Web

jest-runner-prettier - npm
A prettier runner for Jest. Latest version: 1.0.0, last published: 10 months ago. Start using jest-runner-prettier in your project by ...
Read more >
keplersj/jest-runner-prettier - GitHub
Add it to your Jest config. Using Built-in Preset. This package includes a Jest preset which configures Jest to run Prettier on all...
Read more >
Configuring Jest
Sets the path to the prettier node module used to update inline ... directory to be the root of your repo, the value...
Read more >
Prettier · Opinionated Code Formatter
What is Prettier? An opinionated code formatter; Supports many languages; Integrates with most editors; Has few options ...
Read more >
jest-runner-prettier - npm Package Health Analysis - Snyk
Further analysis of the maintenance status of jest-runner-prettier based on released npm versions cadence, the repository activity, and other data points ...
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