diff --git a/lib/rules/property-no-unknown/__tests__/index.js b/lib/rules/property-no-unknown/__tests__/index.js index 62736625b1..3fbc2b0801 100644 --- a/lib/rules/property-no-unknown/__tests__/index.js +++ b/lib/rules/property-no-unknown/__tests__/index.js @@ -285,31 +285,21 @@ testRule({ }); testRule({ - skip: true, ruleName, config: [true], - customSyntax: 'postcss-css-in-js', + customSyntax: 'postcss-styled-syntax', accept: [ { - code: "import styled from 'styled-components';\nexport default styled.div` ${/* sc-prop */ something}: papayawhip; `;", + code: "import styled from 'styled-components';\nexport default styled.div`${something}: papayawhip; `;", }, { - code: "import styled from 'styled-components';\nexport default styled.div` margin-${/* sc-custom 'left' */ rtlSwitch}: 12.5px; `;", + only: true, + code: "import styled from 'styled-components';\nexport default styled.div`margin-${rtlSwitch}: 12px;`;", }, { code: 'const Component = styled.a`\n\t${rule}: 1;\n`', }, - { - code: ` - import glm from 'glamorous'; - const Component = glm.a({ - overflowX: 'auto', - overflowWrap: 'auto', - flexDirection: 'row', - }); - `, - }, ], reject: [ @@ -331,17 +321,6 @@ testRule({ line: 2, column: 2, }, - { - code: ` - import glm from 'glamorous'; - const Component = glm.a({ - overflwX: 'auto', - }); - `, - message: messages.rejected('overflw-x'), - line: 4, - column: 12, - }, ], }); diff --git a/lib/utils/isStandardSyntaxDeclaration.js b/lib/utils/isStandardSyntaxDeclaration.js index 2f1f8b5787..b4b0c7c7ff 100644 --- a/lib/utils/isStandardSyntaxDeclaration.js +++ b/lib/utils/isStandardSyntaxDeclaration.js @@ -7,6 +7,10 @@ const { isRoot, isRule } = require('./typeGuards'); * @param {string} [lang] */ function isStandardSyntaxLang(lang) { + if (!lang) { + return true; + } + return lang && (lang === 'css' || lang === 'custom-template' || lang === 'template-literal'); }