vs-code-prettier-eslint icon indicating copy to clipboard operation
vs-code-prettier-eslint copied to clipboard

Don't support ESlint v9.x

Open NekoLemon opened this issue 1 year ago • 4 comments

log as below:

Error: Could not warm up worker. Formatting a file for the first time may take longer than usual.
Message: Invalid Options:
- Unknown options: ignorePath, resolvePluginsRelativeTo, rulePaths, useEslintrc
- 'resolvePluginsRelativeTo' has been removed.
- 'ignorePath' has been removed.
- 'rulePaths' has been removed. Please define your rules using plugins.
Stacktrace: Error: Invalid Options:
- Unknown options: ignorePath, resolvePluginsRelativeTo, rulePaths, useEslintrc
- 'resolvePluginsRelativeTo' has been removed.
- 'ignorePath' has been removed.
- 'rulePaths' has been removed. Please define your rules using plugins.
    at processOptions (e:\eslint-test\node_modules\eslint\lib\eslint\eslint-helpers.js:853:15)
    at new ESLint (e:\eslint-test\node_modules\eslint\lib\eslint\eslint.js:688:34)
    at getESLint (e:\eslint-test\node_modules\prettier-eslint\dist\utils.js:337:12)
    at getESLintConfig (e:\eslint-test\node_modules\prettier-eslint\dist\index.js:268:39)
    at analyze (e:\eslint-test\node_modules\prettier-eslint\dist\index.js:80:77)
    at format (e:\eslint-test\node_modules\prettier-eslint\dist\index.js:50:13)

NekoLemon avatar Sep 02 '24 09:09 NekoLemon

Bump?

Sayrix avatar Sep 27 '24 19:09 Sayrix

+1

R1D3R175 avatar Oct 12 '24 18:10 R1D3R175

+1

prochor666 avatar Oct 20 '24 01:10 prochor666

+1

JarzaCode avatar Oct 22 '24 14:10 JarzaCode

For those still having issues it might be worth looking into https://github.com/idahogurl/vs-code-prettier-eslint/issues/222

LegitTrevorTiernan avatar Nov 20 '24 16:11 LegitTrevorTiernan

This issue is stale because it has been open for 14 days with no activity.

github-actions[bot] avatar Dec 20 '24 17:12 github-actions[bot]

😡

Sayrix avatar Dec 20 '24 19:12 Sayrix

same

space7panda avatar Dec 27 '24 14:12 space7panda

any progress?

Laffery avatar Jan 17 '25 05:01 Laffery

+1

addemod avatar Jan 23 '25 21:01 addemod

+1

mcelligottnick avatar Jan 24 '25 05:01 mcelligottnick

+1

mihajanstrehovec avatar Jan 27 '25 12:01 mihajanstrehovec

@idahogurl Is this repo still maintained? If not would you care to set it to archived so that people can move on? Thanks.

Mettbrot avatar Jan 29 '25 14:01 Mettbrot

@Mettbrot This extension uses the prettier-eslint package which has not been updated to support ESLint 9. Until the prettier-eslint package is updated, this extension will continue to use ESLint 8. As you can see, there was a PR created to support ESLint but it was closed due to inactivity. https://github.com/prettier/prettier-eslint/pull/1036

idahogurl avatar Jan 29 '25 17:01 idahogurl

@idahogurl yep, I started an attempt to convert pretter-eslint to support ESLint@9, but having issues with the tests. I'm not an OG contributor or maintainer of this, so it goes very slowly.

I think the only thing that remains is to get all the tests to run/or have other viable tests, and do a sanity check to see if it works as intended. Still waiting for the question about config presedence.

Feel free to aid me or the maintainers in this: https://github.com/prettier/prettier-eslint/pull/1036

phun-ky avatar Feb 10 '25 08:02 phun-ky

In case anyone is bumping into this, you can still use Prettier in ESLint with eslint-plugin-prettier and configure Prettier in prettier.config.js. There is some difference between prettier-eslint and eslint-plugin-prettier as the latter runs Prettier as a rule while prettier-eslint runs Prettier before running ESLint, thus allowing the Prettier output to not comply with your ESLint linting rules; still, if you are ok with running Prettier as an ESLint rule, this will work for you.

This is how my Angular environment is setup

// eslint.config.js
// @ts-check
const eslint = require("@eslint/js");
const tseslint = require("typescript-eslint");
const angular = require("angular-eslint");
const prettierRecommended = require("eslint-plugin-prettier/recommended");

module.exports = tseslint.config(
  {
    files: ["src/**/*.ts"],
    extends: [
      eslint.configs.recommended,
      ...tseslint.configs.recommended,
      ...tseslint.configs.stylistic,
      ...angular.configs.tsRecommended,
      prettierRecommended,
    ],
    processor: angular.processInlineTemplates,
    rules: {
      "@angular-eslint/directive-selector": [
        "error",
        {
          type: "attribute",
          prefix: "app",
          style: "camelCase",
        },
      ],
      "@angular-eslint/component-selector": [
        "error",
        {
          type: "element",
          prefix: "app",
          style: "kebab-case",
        },
      ],
    },
  },
  {
    files: ["**/*.html"],
    extends: [
      ...angular.configs.templateRecommended,
      ...angular.configs.templateAccessibility,
    ],
    rules: {},
  }
);

// prettier.config.js
module.exports = require('prettier-config-xo/space');

R1D3R175 avatar Mar 12 '25 07:03 R1D3R175

This issue is stale because it has been open for 14 days with no activity.

github-actions[bot] avatar Apr 11 '25 17:04 github-actions[bot]

This issue is stale because it has been open for 14 days with no activity.

no

Sayrix avatar Apr 12 '25 10:04 Sayrix

+1

naedx avatar Apr 24 '25 10:04 naedx

Please help to test out the first prototype https://github.com/prettier/prettier-eslint/releases/tag/v17.0.0-alpha.1 which only supports Flat Config yet, legacy eslintrc support will be added back soon later.

JounQin avatar May 11 '25 08:05 JounQin

Thank you!! @idahogurl could you maybe also release an alpha version of the Plugin for us to test?

Mettbrot avatar May 11 '25 09:05 Mettbrot

ping @idahogurl

Mettbrot avatar May 28 '25 07:05 Mettbrot

+1

ifsmile avatar May 29 '25 02:05 ifsmile

This issue is stale because it has been open for 14 days with no activity.

github-actions[bot] avatar Jun 28 '25 17:06 github-actions[bot]

Rebecca, this Addon has 3,5 Million installs. If you could send a life sign that this plugin is still being worked on, that would be great!

Mettbrot avatar Jun 28 '25 18:06 Mettbrot

Rebecca, this Addon has 3,5 Million installs. If you could send a life sign that this plugin is still being worked on, that would be great!

@Mettbrot this extension relies on the project "prettier-eslint". JounQin contributed ESLint v9 Flat config support and it was released with https://github.com/prettier/prettier-eslint/releases/tag/v17.0.0-alpha.0.

Idahogurl is probably waiting for a full release. However, you could contribute toward a prerelease of this extension by updating and refactoring for the prettier-eslint v17 prerelease.

BinToss avatar Jul 02 '25 03:07 BinToss

Please help to test out the first prototype https://github.com/prettier/prettier-eslint/releases/tag/v17.0.0-alpha.1 which only supports Flat Config yet, legacy eslintrc support will be added back soon later.

@JounQin have you considered using @eslint/eslintrc for legacy config compatibility?

BinToss avatar Jul 02 '25 03:07 BinToss

As you quoted:

which only supports Flat Config yet, legacy eslintrc support will be added back soon later.

JounQin avatar Jul 02 '25 03:07 JounQin

This issue is stale because it has been open for 14 days with no activity.

github-actions[bot] avatar Aug 01 '25 17:08 github-actions[bot]

This issue is stale because it has been open for 14 days with no activity.

no

Shotplay avatar Aug 01 '25 19:08 Shotplay