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.

yarn lint disrespecting prettier config

See original GitHub issue

Description

I’m trying to change prettier config for my projects:

{
  "useTabs": false,
  "printWidth": 100,
  "tabWidth": 2,
  "singleQuote": true,
  "semi": false,
  "trailingComma": "none"
}

Running yarn lint produces errors like: 6:24 error Missing semicolon semi I have also tried adding eslint-config-prettier and eslint-plugin-prettier to disable any rules that may be conflicting, but I still get this error. I have checked, and I have no semi rule declared explicitly in my configs, rules have not been changed after generating the config initially.

Expected Behavior

No eslint errors on rules prettier takes care of.

Current Behavior

Eslint “semi” conflicts with prettiers “semi” rules.

Context

Please provide any relevant information about your setup:

  • nx/report:
  @nrwl/angular : Not Found
  @nrwl/cli : 8.7.1
  @nrwl/cypress : 8.7.1
  @nrwl/eslint-plugin-nx : 8.7.1
  @nrwl/express : Not Found
  @nrwl/jest : 8.7.1
  @nrwl/linter : 8.7.1
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : 8.7.1
  @nrwl/react : 8.7.1
  @nrwl/schematics : Not Found
  @nrwl/tao : 8.7.1
  @nrwl/web : 8.7.1
  @nrwl/workspace : 8.7.1
  typescript : 3.6.4
  • relevant package versions:
    "eslint": "^6.1.0",
    "eslint-config-prettier": "^6.5.0",
    "eslint-plugin-import": "2.18.2",
    "eslint-plugin-jsx-a11y": "6.2.3",
    "eslint-plugin-prettier": "^3.1.1",
    "eslint-plugin-react": "7.16.0",
    "eslint-plugin-react-hooks": "2.1.2",
    "prettier": "1.18.2",

A minimal reproduction scenario allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
brandonrobertscommented, Nov 27, 2019

@stramel I think the repro by @vincaslt is enough unless you have more information about the issue. Thanks

0reactions
stramelcommented, Jan 8, 2020

@vsavkin After updating my @nrwl deps to 8.11.0 I still had to manually force "@angular-eslint/builder" to v0.0.1-alpha.18

Read more comments on GitHub >

github_iconTop Results From Across the Web

Integrating with Linters - Prettier
Linters usually contain not only code quality rules, but also stylistic rules. Most stylistic rules are unnecessary when using Prettier, but worse –...
Read more >
Why does Prettier not format code in VS Code? - Stack Overflow
Select File -> Preferences -> Settings ( Ctrl + comma ) and search form formatter; Set Prettiers as Default formatter. enter image ...
Read more >
eslint-config-prettier-react | Yarn - Package Manager
⚠️⚠️⚠️ Delete eslintConfig in the package.json · You can add two scripts to your package.json to lint and/or fix: · First install everything...
Read more >
Don't just lint your code, fix it with Prettier - Colby Fayock
Added a plugin that includes React configurations. Next, let's get started by installing a few packages: yarn add prettier prettier-eslint ...
Read more >
Using Prettier and ESLint to automate formatting and fixing ...
{js,yml,json} , into the project directory and you'll be ready to lint. You can create the configuration on the command line with 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