styled-components / stylelint-processor-styled-components

Lint your styled components with stylelint!
https://styled-components.com
MIT License
656 stars 61 forks source link

Upgrade outdated "@babel/parser" dependency #274

Closed fabb closed 5 years ago

fabb commented 5 years ago

This lib still depends on old versions of the @babel/parser and @babel/traverse. This makes this plugin incompatible with newer typescript syntax.

  "dependencies": {
    "@babel/parser": "^7.0.0",
    "@babel/traverse": "^7.0.0",

https://github.com/styled-components/stylelint-processor-styled-components/blob/master/package.json#L64,L65

For example when using as const TypeScript syntax this causes a problem:

const positionFixedOrAbsoulteDecoder = JsonDecoder.oneOf(
    (['fixed', 'absolute'] as const).map(s => JsonDecoder.isExactly(s)),
    'position fixed/absolute'
)
 99:30  ✖  Unexpected token (99:30)

The fix is to update these dependencies to >= 7.4

chinesedfan commented 5 years ago

Those dependencies are specified with caret ranges. So the latest 7.x versions can be installed. If you have yarn.lock or package-lock.json in your project, please remove related babel entries and reinstall.

fabb commented 5 years ago

Ah ok thanks. I always get confused by the caret versioning...

fabb commented 5 years ago

since it took me quite some time to track down the reason for the syntax error while linting, maybe add some info to the readme? => #276