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

/* stylelint-disable */ doesn't work #56

Closed
emilgoldsmith opened this issue Jul 6, 2017 · 3 comments
Closed

/* stylelint-disable */ doesn't work #56

emilgoldsmith opened this issue Jul 6, 2017 · 3 comments

Comments

@emilgoldsmith
Copy link
Member

I am running the pure setup from the readme and due to #55 I want to temporarily disable the rule, but this doesn't seem to work either?

I admit this is also my first time using stylelint, but I have checked quite thoroughly and it seems that I'm doing everything right, and the most likely thing is that it's this parser causing trouble?

Here is my code that acts up with

 11:3  ✖  Unexpected duplicate "undefined"   declaration-block-no-duplicate-properties
 12:3  ✖  Unexpected duplicate "undefined"   declaration-block-no-duplicate-properties

:

/* stylelint-disable declaration-block-no-duplicate-properties */
import React from 'react';
import styled from 'styled-components';

import { media } from '/styles/functions';

const Wrapper = styled.div`
  color: ${props => props.theme.gnarlesGreen};
  background-color: blue;
  ${media.desktop`background-color: red;`}
  ${media.tablet`background-color: yellow;`}
  ${media.phone`background-color: purple;`}
`;

export default () => <Wrapper>Hello World!</Wrapper>;
@emilgoldsmith emilgoldsmith changed the title stylelint-disable doesn't work /* stylelint-disable */ doesn't work Jul 6, 2017
@ghost
Copy link

ghost commented Jul 6, 2017

Hi @emilgoldsmith. The stylelint comments can only be picked up by stylelint if you put them with your css rules like so:

import React from 'react';
import styled from 'styled-components';

import { media } from '/styles/functions';

const Wrapper = styled.div`
  /* stylelint-disable declaration-block-no-duplicate-properties */
  color: ${props => props.theme.gnarlesGreen};
  background-color: blue;
  ${media.desktop`background-color: red;`}
  ${media.tablet`background-color: yellow;`}
  ${media.phone`background-color: purple;`}
`;

export default () => <Wrapper>Hello World!</Wrapper>;

That should solve it.

@ghost ghost closed this as completed Jul 6, 2017
@emilgoldsmith
Copy link
Member Author

Okay thanks, should I just submit a quick PR that adds that to the readme?

@ghost
Copy link

ghost commented Jul 6, 2017

@emilgoldsmith Ah yes that would be nice. Thanks!

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant