@d-zero/stylelint-rules 5.0.0-alpha.19 → 5.0.0-alpha.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,20 @@ const config = (settings = true) => ({
9
9
  [rule.ruleName]: settings,
10
10
  },
11
11
  });
12
+ describe('Parse Error', () => {
13
+ test('SCSS Syntax', async () => {
14
+ const {
15
+ // @ts-ignore
16
+ results: [{ warnings, parseErrors }], } = await lint({
17
+ code: '* { background: url("a" + $b + "c") }',
18
+ config: config({
19
+ length: ['px'],
20
+ }),
21
+ });
22
+ expect(parseErrors).toHaveLength(0);
23
+ expect(warnings).toHaveLength(0);
24
+ });
25
+ });
12
26
  describe('length-pattern', () => {
13
27
  test('length in flex', async () => {
14
28
  const {
@@ -4,7 +4,18 @@ export function getValueType(decl) {
4
4
  if (decl.prop.startsWith('$')) {
5
5
  return null;
6
6
  }
7
- return _getValueType(decl.prop, decl.value);
7
+ try {
8
+ return _getValueType(decl.prop, decl.value);
9
+ }
10
+ catch (error) {
11
+ if (error instanceof SyntaxError &&
12
+ 'source' in error &&
13
+ error.source === decl.value) {
14
+ // Unsupported SCSS syntax by CSSTree
15
+ return null;
16
+ }
17
+ throw error;
18
+ }
8
19
  }
9
20
  function _getValueType(prop, value) {
10
21
  const valueAst = postcssValueParser(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d-zero/stylelint-rules",
3
- "version": "5.0.0-alpha.19",
3
+ "version": "5.0.0-alpha.21",
4
4
  "description": "Rules of Stylelint for D-ZERO",
5
5
  "repository": "https://github.com/d-zero-dev/linters.git",
6
6
  "author": "D-ZERO Co., Ltd.",
@@ -20,10 +20,13 @@
20
20
  "build": "tsc"
21
21
  },
22
22
  "dependencies": {
23
- "@d-zero/csstree-scss-syntax": "5.0.0-alpha.19",
23
+ "@d-zero/csstree-scss-syntax": "5.0.0-alpha.21",
24
24
  "css-tree": "2.3.1",
25
25
  "postcss-value-parser": "4.2.0",
26
- "stylelint": "16.2.1"
26
+ "stylelint": "16.3.1"
27
27
  },
28
- "gitHead": "6412911b34fa89cf326259dd356563838532adea"
28
+ "devDependencies": {
29
+ "postcss": "8.4.38"
30
+ },
31
+ "gitHead": "144e19343efd0bbd97600bb624751fa6cad20b15"
29
32
  }