prettier-stylelint icon indicating copy to clipboard operation
prettier-stylelint copied to clipboard

Cannot set property 'singleQuote' of null

Open stormwarning opened this issue 7 years ago • 3 comments

After running prettier-stylelint '**/*.scss' — leaving --write off for now just to dry-run — I'm getting the following error:

prettier-stylelint [ERROR]: There was an error formatting "lib/showbie-previewer/addon/components/sbe-preview/text-on-page/styles.scss"

TypeError: Cannot set property 'singleQuote' of null
    at resolveConfig.resolve (~/web/node_modules/prettier-stylelint/src/index.js:48:41)
    at linterAPI.getConfigForFile.then (~/web/node_modules/prettier-stylelint/src/index.js:32:31)

It appears to be thrown for every .scss file in the codebase, regardless of whether there's quotes in the file or not. Formatting a file manually via Atom (with prettier-atom extension & stylelint integration enabled) formats the code as expected.

Using

  • node 6.12.0
  • prettier-stylelint ~0.4.2

Let me know if I can provide more info!

stormwarning avatar Jan 04 '18 18:01 stormwarning

I added this to my package.json to fix it however needs a deeper look at:

"prettier": {}

GodOfGrandeur avatar Feb 16 '18 10:02 GodOfGrandeur

same here with ```TypeError: Cannot set property 'useTabs' of null``

ausminternet avatar Mar 03 '18 20:03 ausminternet

That function _resolveConfig in prettier return null and prettierOptions = {} in resolveConfig.resolve cause this issue.

tarol avatar Sep 27 '18 02:09 tarol