idahogurl / vs-code-prettier-eslint

A Visual Studio Code Extension to format JavaScript and TypeScript code using the prettier-eslint package.
MIT License
184 stars 46 forks source link

Settings Improvement #178

Closed DirectorRen-TV closed 10 months ago

DirectorRen-TV commented 11 months ago

It would be nice to have an ability to split .prettierignore и .eslintignore files. For formatting styles in Vue SFC files I use prettier, and for other files I use eslint. Accordingly, I fill the .prettierignore file with .ts and .js values, and then eslint-part of plugin does not fix .ts and .js files - because of "File ignored. Matches entry in .eslintignore or .prettierignore".

Thanks for the plugin, this was really a salvation for formatting only styles block in SFC

GreenTea124 commented 11 months ago

Some additional suggestions from my side:

I think this plugin could support 4 new VS Code settings like this:

// .vscode/settings.json
{
    // Existing
    "vs-code-prettier-eslint.prettierLast": false,
    // New
    "vs-code-prettier-eslint.eslintConfigPath": ".eslintrc.fix.json",
    "vs-code-prettier-eslint.eslintIgnorePath": ".gitignore",
    "vs-code-prettier-eslint.prettierConfigPath": "prettier.config.js",
    "vs-code-prettier-eslint.prettierIgnorePath": ".gitignore",
}

Why?

Some ESLint rules can be quite slow, and running them on every Ctrl+S can become laggy if you frequently save your files to format them. With my ESLint setup, sometimes I have to wait 10+ seconds, and sometimes VSCode refuses to format things entirely, it just keeps loading until I reset it.

To address this, I propose additional settings, that would allow two-config setups. One ESLint config could be used by ESLint Plugin for full linting and in-editor error messages (.eslintrc.js), and another one could be very tiny and used by Prettier ESLint Plugin for auto-formatting (.eslintrc.fix.json).

github-actions[bot] commented 10 months ago

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

github-actions[bot] commented 10 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.