create-nuxt-app icon indicating copy to clipboard operation
create-nuxt-app copied to clipboard

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

Open munierujp opened this issue 4 years ago • 8 comments

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: {}
}

munierujp avatar Nov 30 '19 00:11 munierujp

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

then add following line to stylelint.config.js

"extends": "stylelint-config-standard"

kiri2lov avatar Feb 05 '20 20:02 kiri2lov

cc @ricardogobbosouza

clarkdo avatar Feb 10 '20 12:02 clarkdo

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?

ricardogobbosouza avatar Feb 10 '20 13:02 ricardogobbosouza

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

clarkdo avatar Feb 10 '20 13:02 clarkdo

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

ricardogobbosouza avatar Feb 10 '20 14:02 ricardogobbosouza

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

ricardogobbosouza avatar Feb 10 '20 14:02 ricardogobbosouza

cc @nuxt/core-team

clarkdo avatar Feb 10 '20 17:02 clarkdo

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.

pi0 avatar Mar 17 '20 13:03 pi0