question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Help us prepare for the next major release of stylelint

See original GitHub issue

We’ve been working on a new major release of stylelint. There are quite a few changes (and a lot of refactoring). One of the biggest changes we’ve made is removing the syntax option and no longer bundling syntaxes in stylelint itself. Users will need to extend stylelint (via shared-configs, plugins and custom syntaxes) to lint something other than vanilla CSS.

To make this easier for users to do, we’ve added two properties to the configuration object:

  • customSyntax - which accepts an PostCSS syntax like postcss-scss
  • overrides - which allows users to configure stylelint to lint two or more languages, e.g. CSS and SCSS

We intend to improve the migration experience by updating our docs and by adding helpful error messages to stylelint when a user, for example, tries to lint an *.scss file but hasn’t specified a custom syntax in their configuration object.

This last part is why we’re reaching out to you. We want to encourage users to extend a shared-config for the language they are linting, rather than add custom syntaxes and plugins themselves. We think that’ll be easier for them.

We also think emphasising the standard configs over the recommended ones will help users, especially new ones. Including those who use stylelint and a pretty-printer like Prettier together, as there are a number of stylistic rules in stylelint and this plugin that are complementary to Prettier, e.g. the *-empty-line-before ones.

To help us do this, will you (or any of the other contributors to this package) be willing to?:

  1. Update stylelint-config-recommended-scss to bundle postcss-scss
  2. Create and publish stylelint-config-standard-scss that would:
// stylelint-config-recommended-scss
module.exports = {
  extends: ["stylelint-config-recommended"],
  plugins: ["stylelint-scss"],
  customSyntax: "postcss-scss",
  rules: {
    "at-rule-no-unknown": null,
    "scss/at-rule-no-unknown": true,
    "no-invalid-position-at-import-rule": null
  }
};
// stylelint-config-standard-scss
module.exports = {
  extends: [
    "stylelint-config-standard",
    "stylelint-config-recommended-scss"
  ],
  rules: {
    "block-closing-brace-newline-after": ["always", { "ignoreAtRules": ["else"] } ],
    "scss/at-else-closing-brace-newline-after": "always-last-in-chain"
    ..
  }
};

We’ll then update our Getting started guide and add errors messages to stylelint to encourage users to install stylelint-config-standard-scss when linting SCSS.

We’ve seen users linting SCSS with stylelint who are unaware of this plugin and all the amazing rules within it. We hope these changes will allow more users to benefit from this plugin.

Lastly, many thanks to you (and the other contributors) for maintaining this package! It’s been fantastic to see the number of rules grow over the years.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jeddy3commented, Oct 12, 2021

I can share things.

@Moeriki Fantastic, thank you!

Never done this so not sure. I see I can invite a maintainer on the npm package. Is that what you would need?

Yes, please. If you can add me (“jeddy3” on npm) as a maintainer on NPM, then I can grant access to @niksy and @kristerkari.

The repo itself I think I’ll archive with a link at the top of the README to a repo of yours.

That works.

Many thanks again! There are quite a few moving pieces involved in the next release of stylelint and this will help us out a lot.

1reaction
moerikicommented, Oct 12, 2021

I have little memory of this 😀 I can share things.

Never done this so not sure. I see I can invite a maintainer on the npm package. Is that what you would need?

The repo itself I think I’ll archive with a link at the top of the README to a repo of yours.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Performing releases - Stylelint
Release Stylelint : If necessary, reorder the changelog entries in the "Prepare release" pull request so that the widest-reaching changes come first; Merge...
Read more >
Stylelint: The Style Sheet Linter We've Always Wanted
Your configuration can grow to be very big, so the most convenient way to store stylelint's configuration is in a separate JSON file,...
Read more >
[Linter] Stylelint - Let's see how to install and configure ...
Prepare project; Install Stylelint for CSS-in-JS ... Please leave a comment at the bottom. it will be a great help to me!
Read more >
How To Use Stylelint with CSS in JS | The Startup - Medium
Jest is a great way to run your tests, so why not use it for linting as well? Start by installing some dependencies....
Read more >
How to integrate Prettier with ESLint and stylelint
ESLint and stylelint are really amazing tools that allow you to enforce coding patterns among your teams. This has many benefits, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found