Code Monkey home page Code Monkey logo

Comments (2)

bjankord avatar bjankord commented on August 15, 2024

There are two options that come to mind to mitigate this, set up a peerDependecy on postcss in this npm package similar to the same version that postcss-scss uses.

Alternatively, I can set up postcss as a dependency in this config and set at the same version that postcss-scss lists as a peerDependency.

Typically I lean towards setting it up as a peerDependency similar to how stylelint is set up in this package currently:
https://github.com/bjankord/stylelint-config-sass-guidelines/blob/main/package.json#L37-L38

On the flip side, I know people often ignore peerDependency warnings, if a package has a peerDependency and its not in your dependency tree, (node_modules), yarn and npm (v4-v6) will warn about it I believe and I think in npm 7 will auto install peer dependencies. Setting postcss as a dependency in this project should help people running into this error.

For now, I'm planning to set postcss as a peerDependency in this config to the same version postcss-scss sets the peerDependency on postcss and pass the responsibility to projects consuming this config to install the needed version of postcss.

If more people run into this issue, I'll likely move to switch postcss from a peerDependency in this package to a dependency as I know people often overlook the peerDependency warnings and will likely be confused by this error message:

TypeError: Class extends value undefined is not a constructor or null at Object.<anonymous>

from stylelint-config-sass-guidelines.

bjankord avatar bjankord commented on August 15, 2024

Found some related issues:

It seems if you can not upgrade the root version of postcss to v8 in your projects, you will not be able to use stylelint scss based configs.

from stylelint-config-sass-guidelines.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.