Files
react-native-devtools-frontend/node_modules/stylelint/lib/rules/function-calc-no-invalid
Mathias Bynens 79e2cf0633 Add stylelint dependency
This also adds CC-BY-4.0 to the list of accepted licenses.

DISABLE_THIRD_PARTY_CHECK=update dependencies

Bug: chromium:1083142
Change-Id: I8612de2fba52dae32eeb71af79d5aacfde52142b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2220097
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-06-11 06:20:04 +00:00
..
2020-06-11 06:20:04 +00:00
2020-06-11 06:20:04 +00:00

function-calc-no-invalid

Disallow an invalid expression within calc functions.

.foo {width: calc();}
/**               ↑
 * empty expression */
.foo {width: calc(100% 80px);}
/**                   ↑
/* missing operator */
.foo {width: calc(100% -80px);}
/**                   ↑
/* missing operator */
.foo {width: calc(100% - - 80px);}
/**                      ↑
/* unexpected operator */
.foo {width: calc(100% -);}
/**                    ↑
/* unexpected operator */
.foo {width: calc(- 100%);}
/**               ↑
/* unexpected operator */
.foo {width: calc(100% / 0);}
/**                    ↑ ↑
/* division by zero */
.foo {width: calc(100px + 80);}
/**                  ↑  ↑  ↑
/* the `resolved type` is invalid */
.foo {width: calc(100% + 80);}
/**                  ↑ ↑  ↑
/* the `resolved type` is invalid */
.foo {width: calc(100px - 80);}
/**                  ↑  ↑  ↑
/* the `resolved type` is invalid */
.foo {width: calc(100px * 80px);}
/**                  ↑  ↑   ↑
/* the `resolved type` is invalid */
.foo {width: calc(100 / 80%);}
/**                 ↑ ↑   ↑
/* the `resolved type` is invalid */
  • calc() must have an expression.
  • calc() must have an operator between the arguments.
  • calc() must not be division by zero.
  • The resolved type must be valid for where the expression is placed.

Options

true

The following patterns are considered violations:

.foo {width: calc();}
.foo {width: calc(100% 80px);}
.foo {width: calc(100% - - 80px);}
.foo {width: calc(100% / 0);}
.foo {width: calc(100px + 80);}

The following patterns are not considered violations:

.foo {width: calc(100% - 80px);}
.foo {width: calc(100% - var(--bar));}
.foo {width: calc(var(--bar) - var(--baz));}