Skip to content
This repository was archived by the owner on May 14, 2021. It is now read-only.
This repository was archived by the owner on May 14, 2021. It is now read-only.

Stylelint throws on ts/tsx files not using styled-components #259

Closed
@moimael

Description

@moimael

Environment

## System:
 - OS: Linux 5.0 Fedora 29 (Workstation Edition) 29 (Workstation Edition)
 - CPU: (4) x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
 - Memory: 3.78 GB / 15.43 GB
 - Container: Yes
 - Shell: 4.4.23 - /bin/bash
## Binaries:
 - Node: 10.15.3 - /usr/bin/node
 - Yarn: 1.10.1 - /usr/bin/yarn
 - npm: 6.9.0 - /usr/bin/npm
## npmPackages:
 - styled-components: 3.4.2 => 3.4.2 
 - stylelint: 9.10.1 => 9.10.1 
 - stylelint-config-recommended: 2.1.0 => 2.1.0 
 - stylelint-config-styled-components: 0.1.1 => 0.1.1 
 - stylelint-processor-styled-components: 1.5.2 => 1.5.2 

.stylelintrc

{
  "processors":[
    "stylelint-processor-styled-components"
  ],
  "extends":[
    "stylelint-config-recommended",
    "stylelint-config-styled-components"
  ]
}

Reproduction

Stylelint throws errors on Ts/Tsx files that don't use or import styled-components.

stylelint-errors

An example of one of the file that throws (the use-experiment.ts):

import { pathOr } from "ramda"
import { useReduxStore } from "./use-redux"

export const useExperiment = (experimentFlag: string): boolean => {
  const experimentList = <string[]>pathOr([], ["experiment", "list"], useReduxStore().getState())
  return experimentList.includes(experimentFlag)
}

Steps to reproduce

Not sure, just ran stylelint in my project

Expected Behavior

Shouldn't throw for files without styled-components

Actual Behavior

Throws styles errors on Ts/Tsx files only not related to styled-components.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions