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.

Not working properly width eslint 6

See original GitHub issue

Versions:

  • prettier-eslint 9.0.0:
  • node 10.15.3:
  • npm (or yarn) version: 6.10.0

Have you followed the debugging tips?

Yes

Relevant code or config https://github.com/prettier/prettier-eslint/blob/c87b69b769c59bcea0d96c87dddb6a4925085d8a/src/index.js#L225-L243

  const eslintOptions = {};
  if (filePath) {
    eslintOptions.cwd = path.dirname(filePath);
  }
  logger.trace(
    oneLine`
      creating ESLint CLI Engine to get the config for
      "${filePath || process.cwd()}"
    `
  );
  const cliEngine = getESLintCLIEngine(eslintPath, eslintOptions);
  try {
    logger.debug(`getting eslint config for file at "${filePath}"`);
    const config = cliEngine.getConfigForFile(filePath);
+   config.cwd = eslintOptions.cwd
    logger.trace(
      `eslint config for "${filePath}" received`,
      prettyFormat(config)
    );
    return config;

What I did:

Support eslint 6

What happened: when I set “prettier.eslintIntegration”: true then the error happend in VSCode

Failed to load plugin 'standard' declared in 'CLIOptions'/Users/nashaofu/edc/web/src/c.js:: Cannot find module 'eslint-plugin-standard'
Require stack:
- __placeholder__.js

My eslint configuration is as follows:

module.exports = {
  root: true,
  parser: 'babel-eslint',
  env: {
    es6: true,
    node: true,
    commonjs: true
  },
  extends: ['standard']
}

Problem description:

The CWD of the process pointed incorrectly

Suggested solution: details https://github.com/prettier/prettier-vscode/issues/869

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:40
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

22reactions
ShinobiWPScommented, Sep 23, 2019

Any news on this?

18reactions
agusterodincommented, Jan 5, 2020

When open source fails

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prettier and eslint indents not working together - Stack Overflow
Probably 'eslint' says: indent: Expected indentation of 2 spaces but found 4. after prettier reformat. My .eslintrc.js : module.exports = { ...
Read more >
indent - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
How to configure Prettier and VSCode - Gleb Bahmutov
You can configure JavaScript code auto-formatting with Prettier to work per-project. This allows you to get a consistent formatting without ...
Read more >
ESLint and Prettier with Vite and Vue.js 3 - Vue School Blog
As far as I can tell, there are no special configs to get it working properly with ESLint and Prettier. Just install it...
Read more >
Google JavaScript Style Guide
Like other programming style guides, the issues covered span not only aesthetic issues of formatting, but other types of conventions or coding standards...
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