skip to Main Content

I’m running stylelint on my files and this is the last error I’m left with:

1:1  ✖  Unknown rule function-calc-no-invalid  function-calc-no-invalid

The first line:

@import url('https://fonts.googleapis.com/css?family=Poppins:400,700,900');

I need troubleshooting here, but I’m clueless. It’s my first time asking question here so please excuse if my forum manners are little out of sync.

I’m running stylelint --fix styles.css and don’t expect any errors now.

2

Answers


  1. Add "function-calc-no-invalid": null to the "rules" section of your .stylelintrc/.stylintrc.json config file, e.g.:

    {
      "rules": {
        "function-calc-no-invalid": null,
      }
    }
    

    to explicitly turn off that rule, however, more likely to solve your issue (given that clearly you must be using a version of stylelint since that rule has been removed), check to see if "function-calc-no-invalid" is already mentioned in any .stylelintrc config file, and if it is, remove it altogether.

    If you are using the latest version of stylelint, then that rule won’t be recognized and should not be in your configuration object. You may want to make sure you have the correct up-to-date configuration.

    You might try running:

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

    too/instead, and see if that creates a new configuration object for you and eliminates the rule error you are seeing. Somewhere in your config, it seems, the removed rule is being listed when it should not be (anymore).

    (See: https://stylelint.io/user-guide/errors#unknown-rule-error)

    Login or Signup to reply.
  2. As of 14.0.0, support for this rule has been removed due to a security vulnerability.

    https://stylelint.io/migration-guide/to-14/#function-calc-no-invalid-rule

    The function-calc-no-invalid has been removed. You should remove it from your configuration object.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search