Search code examples
stylelint

What's the difference between different configuration formats of stylelint


There are many options to config stylelint, like

  • a stylelint property in package.json
  • .stylelintrc.json, .stylelintrc.yaml, .stylelintrc.js etc.
  • a stylelint.config.js file

Is there any difference when I'm deciding which one to use? Official document says:"You may want to use an extension so that your text editor can better interpret the file, and help with syntax checking and highlighting."Any other difference except that?

Thanks!


Solution

  • stylelint uses cosmiconfig, all of the options you mention are made available through cosmiconfig.

    So it's more about flexibility and offering that personal choice to stylelint users to choose a filename and format that they find most suitable.

    Each of the formats are fully supported and have no other differences with different formats offering different functionality, they all support all of stylelints configuration options out of the box