Skip to content

Conversation

Tofandel
Copy link

New Pull Request Information

When declaring a css variable an error is thrown while linting with sort properties because the declaration doesn't contain a property node but instead a customProperty node

Reproduction

.columns.is-variable
  --columnGap: 0.75rem

Log

Node {
  type: 'declaration',
  content: [
    Node {
      type: 'customProperty',
      content: [Array],
      syntax: 'sass',
      start: [Object],
      end: [Object]
    },
    Node {
      type: 'propertyDelimiter',
      content: ':',
      syntax: 'sass',
      start: [Object],
      end: [Object]
    },
    Node {
      type: 'space',
      content: ' ',
      syntax: 'sass',
      start: [Object],
      end: [Object]
    },
    Node {
      type: 'value',
      content: [Array],
      syntax: 'sass',
      start: [Object],
      end: [Object]
    }
  ],
  syntax: 'sass',
  start: { line: 467, column: 5 },
  end: { line: 467, column: 24 }
}
@error     TypeError: Cannot read property 'first' of null
    at /home/tofandel/Desktop/bulma/node_modules/sass-lint/lib/rules/property-sort-order.js:110:27
    at Node.forEach (/home/tofandel/Desktop/bulma/node_modules/gonzales-pe-sl/lib/gonzales.js:183:83)
    at Node.<anonymous> (/home/tofandel/Desktop/bulma/node_modules/sass-lint/lib/rules/property-sort-order.js:106:15)
    at /home/tofandel/Desktop/bulma/node_modules/gonzales-pe-sl/lib/gonzales.js:312:41
    at Node.traverse (/home/tofandel/Desktop/bulma/node_modules/gonzales-pe-sl/lib/gonzales.js:292:6)
    at Node.traverse (/home/tofandel/Desktop/bulma/node_modules/gonzales-pe-sl/lib/gonzales.js:297:36)
    at Node.traverse (/home/tofandel/Desktop/bulma/node_modules/gonzales-pe-sl/lib/gonzales.js:297:36)
    at Node.traverse (/home/tofandel/Desktop/bulma/node_modules/gonzales-pe-sl/lib/gonzales.js:297:36)
    at Node.traverse (/home/tofandel/Desktop/bulma/node_modules/gonzales-pe-sl/lib/gonzales.js:297:36)
    at Node.traverseByType (/home/tofandel/Desktop/bulma/node_modules/gonzales-pe-sl/lib/gonzales.js:311:11)

This fixes that error

<DCO 1.1 Signed-off-by: Adrien Foulon>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant