gucong3000 / postcss-syntax

Automatically switch PostCSS syntax based on file extensions
MIT License
45 stars 7 forks source link

TypeError: this[node.type] is not a function #23

Closed gucong3000 closed 6 years ago

gucong3000 commented 6 years ago
import styled from 'emotion'

const Container = styled('div')({
  position: 'relative',
  fontSize: 13,
  fontWeight: 'bold',
  lineHeight: '30px',
  color: 'white',
  textAlign: 'center',
  cursor: 'default',
  backgroundColor: 'gray',
  borderRadius: 15,
  size: 30,
  marginTop: 10,
  margin: '0 auto'
})

const Avatar = () => {
  return h(Container)
}

export default Avatar
{
  "extends": [
    "stylelint-config-standard"
  ]
}
stylelint components/avatar.js
TypeError: this[node.type] is not a function
    at Stringifier.stringify (/home/ai/Dev/amplifr-front/node_modules/postcss/lib/stringifier.js:33:24)
    at stringify (/home/ai/Dev/amplifr-front/node_modules/postcss/lib/stringify.js:14:9)
    at Obj.toString (/home/ai/Dev/amplifr-front/node_modules/postcss/lib/node.js:195:9)
    at module.exports (/home/ai/Dev/amplifr-front/node_modules/stylelint/lib/utils/rawNodeString.js:12:18)
    at module.exports (/home/ai/Dev/amplifr-front/node_modules/stylelint/lib/utils/blockString.js:22:10)
    at root.walkDecls.decl (/home/ai/Dev/amplifr-front/node_modules/stylelint/lib/rules/declaration-block-semicolon-newline-after/index.js:54:23)
    at /home/ai/Dev/amplifr-front/node_modules/postcss/lib/container.js:188:28
    at /home/ai/Dev/amplifr-front/node_modules/postcss/lib/container.js:144:26
    at Obj.each (/home/ai/Dev/amplifr-front/node_modules/postcss/lib/container.js:110:22)
    at Obj.walk (/home/ai/Dev/amplifr-front/node_modules/postcss/lib/container.js:143:21)

https://github.com/emotion-js/emotion/issues/686#issuecomment-394077443