barraponto / neutrino-middleware-stylelint

Stylelint support in Neutrino
https://www.npmjs.com/package/neutrino-middleware-stylelint
0 stars 0 forks source link

.stylelintrc.js awareness #3

Open timkelty opened 6 years ago

timkelty commented 6 years ago

You provide a method for setting your stylelint config as a neutrino option, and then referencing that via .stylelintrc.js: https://github.com/barraponto/neutrino-middleware-stylelint#stylelintconfigjs

I actually want to go the other way - set my config in .stylelintrc.js.

Currently I'm achieving this like so:

  neutrino.use('neutrino-middleware-stylelint', {
    config: require(path.join(neutrino.options.root, '.stylelintrc.js')),
  });

But it would be nice if the default options.config were undefined, so by default it would use its config finding rules: https://stylelint.io/user-guide/configuration/#loading-the-configuration-object

With neutrino-middleware-eslint, I can do this:

  neutrino.use('neutrino-middleware-eslint', {
    eslint: {
      useEslintrc: true,
    },
  });
timkelty commented 6 years ago

Although…there seem to be some compelling reasons not to do this: https://github.com/mozilla-neutrino/neutrino-dev/issues/382#issuecomment-345078382