Disable all built-in IDE Code Style rules

Hi!

I'm using Webstorm for a frontend project. In this project I have eslint and prettier installed and configured. In Webstorm Settings, I can set them as formatting tools to use at Cmd+Otion+L ("Reformat Code" action). 

But all rules, not specified in eslint or prettier, are used from built-in Webstorm Settings/Editor/Code Style. For example, i'm using “Reformat Code” on my `.vue` component, and some rules are applied from eslint-vue, and some are from “Code Style”.

The problem is, I want to disable all Code Style rules and to use only eslint+prettier on “Reformat Code”. But I cannot find a way to do so. I can disable all code reformatting (Settings/Code Style/Formatter tab/Do not format (glob) field), if I do so, “Reformat Code” action does not work at all: both Code Style and eslint+prettier formatters.

 

So, the question is: is there a way to disable ALL Code Style rules, but still be able to use “Reformat Code” action with my eslint+prettier from a project?

0
7 comments

Normally the IDE code style preferences are not applied if the code is formatted with Prettier.

Do you have Optimize Imports enabled in Code > Reformat File? If yes, does disabling it make any difference?

1

Elena Pogorelova , thanks for your response!

Tried disabling Optimize Imports now, and that does not help :(

So, basically my testing+reproduction looks like this:

  • settings/…/prettierautomatic configuration ,
  • same for eslint,
  • Open my `.vue` file, run `eslint --fix` from terminal ==> no changes
  • Run Cmd+Opt+L in this file ==> reorders `<template>` html tag attributes, like so:

Also, Prettier does not affect `<template>` reformatting, because Vue template fixes are applied by eslint-vue plugin.

However, I haven't tried to test if built-in rules are applied with prettier+eslint in `.js`/`.ts` files.  Should I test it, or my example is ok enough?

0

Is Rearrange Code enabled in Code > Reformat File? Re-formatting doesn't usually affect the attributes order unless rearrangement is enabled. Also, what is a result of the Reformat with Prettier right-click menu action?

1

I've disabled Rearrange Code, it helped, thank you!

But, eslint is not included in “Reformat Code” and I can only enable it as “Action On Save”, right?

1

Right; ESLint is not a code formatter, it's not possible to run it on the Reformat Code action.

1

Ok, thank you!

You've helped a lot :)

0
You are very welcome:)
0

Please sign in to leave a comment.