Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

class-format/component: false triggers "TypeError: Cannot read property 'test' of undefined" #10

Open
gmatheus opened this issue May 22, 2017 · 2 comments

Comments

@gmatheus
Copy link

gmatheus commented May 22, 2017

My stylelint config is:

{
  "extends": [
    "stylelint-config-standard",
    "stylelint-rscss/config"
  ],
  "plugins": [
    "stylelint-rscss"
  ],
  "rules": {
    "string-quotes": "single",
    "selector-no-type": true,
    "selector-no-id": true,
    "block-opening-brace-space-before": "never-multi-line",
    "rscss/no-descendant-combinator": true,
    "rscss/class-format": [
      true,
      {
        "component": false
      }
    ]
  }
}

When running using gulp-stylelint, I get this error:

TypeError: Cannot read property 'test' of undefined
    at classes.filter.c (...node_modules/stylelint-rscss/lib/class_format.js:158:30)
    at Array.filter (native)
    at validateComponent (...node_modules/stylelint-rscss/lib/class_format.js:157:30)
    at walkSelectors (...node_modules/stylelint-rscss/lib/class_format.js:81:7)
    at selectors.nodes.forEach.selector (...node_modules/stylelint-rscss/lib/helpers/walk_selectors.js:41:43)
    at Array.forEach (native)
    at selectors (...node_modules/stylelint-rscss/lib/helpers/walk_selectors.js:41:23)
    at Processor.selectors [as func] (...node_modules/stylelint-rscss/lib/helpers/flatten_rule.js:15:14)
    at Processor.process (...node_modules/stylelint-rscss/node_modules/postcss-selector-parser/dist/processor.js:34:14)
    at flattenRule (...node_modules/stylelint-rscss/lib/helpers/flatten_rule.js:16:6)
    at visitRule (...node_modules/stylelint-rscss/lib/helpers/walk_selectors.js:40:5)
    at visit (...node_modules/stylelint-rscss/lib/helpers/walk_selectors.js:23:20)
    at node.nodes.forEach.subnode (...node_modules/stylelint-rscss/lib/helpers/walk_selectors.js:29:7)
    at Array.forEach (native)
    at visit (...node_modules/stylelint-rscss/lib/helpers/walk_selectors.js:28:16)
    at walkSelectors (...node_modules/stylelint-rscss/lib/helpers/walk_selectors.js:14:3)
    at ...node_modules/stylelint-rscss/lib/class_format.js:73:5
    at Promise.resolve.then (...node_modules/stylelint/lib/lintSource.js:122:59)

It seems it happens when rscss/class-format -> component rule is set to false.
Is my config file wrong or something?

@rstacruz
Copy link
Owner

oops! yeah it seems false is not supported here, contrary to what the docs say.

@peschee
Copy link

peschee commented Sep 23, 2019

@rstacruz Is there any way to disable the rscss/class-format for components then?

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

No branches or pull requests

3 participants