1

I've begun working in a large repo where no types are being exported or imported anywhere. This seemed odd until I attempted to do so and realized why: we're using stylelint (13.4.0) and it simply won't recognize import type { WhateverType }. It produces an "Unexpected token" response.

Not even disabling the next line works:

/* stylelint-disable-next-line */
import type { ThingProps } from '@/components/Thing/'; 

This is in a file that doesn't even have any style declarations (we use styled components, btw), but I would not want to preclude them by having stylelint ignore the whole file.

We have a commit hook running stylelint, so no commits can go in with imported styles, and that sucks. I'd like to figure out how to work around this issue.

Faust
  • 15,130
  • 9
  • 54
  • 111

1 Answers1

1

Update to the >= 1.10.0 of https://www.npmjs.com/package/stylelint-processor-styled-components or whatever your equivalent processor is for updated TS syntax support. See this PR as an example.

Brandon
  • 1,029
  • 3
  • 11
  • 21