nuxt / create-nuxt-app

Create Nuxt.js App in seconds.
MIT License
3.48k stars 430 forks source link

Define stylelint default config like @nuxtjs/eslint-config and use it #388

Open munierujp opened 4 years ago

munierujp commented 4 years ago

Now, there are no rules defined for stylelint. ^1 I think that some rules should be enabled by default like ESLint.

My idea

@nuxtjs/stylelint-config:

module.exports = {
  extends: [
    'stylelint-config-standard'
  ],
  rules: {
    // TODO: Define other rules which are compatible with Vue/Nuxt
  }
}

template/_stylelint.config.js of create-nuxt-app

module.exports = {
  extends: [
    '@nuxtjs/stylelint-config'
  ],
  // add your custom rules here
  // https://stylelint.io/user-guide/configuration
  rules: {}
}
kiri2lov commented 4 years ago

npm install stylelint-config-standard --save-dev

then add following line to stylelint.config.js

"extends": "stylelint-config-standard"

clarkdo commented 4 years ago

cc @ricardogobbosouza

ricardogobbosouza commented 4 years ago

I agree that we should have @nuxtjs/stylelint-config however simple it may be! What do you think @clarkdo? Could we have this repository at https://github.com/nuxt/stylelint-config?

clarkdo commented 4 years ago

Can we add a package in https://github.com/nuxt/eslint-config/tree/master/packages ? If it's necessary, we can even rename the repo to lint-config

ricardogobbosouza commented 4 years ago

Much better :smile: I can create a PR with stylelint-config

ricardogobbosouza commented 4 years ago

It would be nice to know the team's opinion, wouldn't it?

clarkdo commented 4 years ago

cc @nuxt/core-team

pi0 commented 4 years ago

As style-lint depends on project and UI framework does it makes sense / is possible to create general-purpose a preset? (#446 for example).

BTW if we can propose a shared preset, I highly agree with @clarkdo to move eslint-config into a mono repo for official lint configs.

History: @nuxt/eslint-config was initially refactored out of core repo to make maintenance easier and also shared across all official and community modules. It is also usable for nuxt project as they usually have shared requirements.