Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
changes after review
  • Loading branch information
sw1tch3roo committed Aug 4, 2025
commit 4a9e6dc3d57483cbb84c507f359f419ea9c88454
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ testRule({
customSyntax: naiveCssInJs,
accept: [
{
code: 'const foo = styled.a`color: red;`',
code: 'css` color: red; `;',
description: 'CSS-in-JS template literal',
},
],
Expand Down
7 changes: 5 additions & 2 deletions lib/rules/no-invalid-position-declaration/index.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions lib/rules/no-invalid-position-declaration/index.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { isAtRule, isInDocument, isRule } from '../../utils/typeGuards.mjs';
import { isAtRule, isRule } from '../../utils/typeGuards.mjs';
import findNodeUpToRoot from '../../utils/findNodeUpToRoot.mjs';
import { isInDocument } from '../../utils/isInDocument.mjs';
import isStandardSyntaxDeclaration from '../../utils/isStandardSyntaxDeclaration.mjs';
import { nestingSupportedAtKeywords } from '../../reference/atKeywords.mjs';
import report from '../../utils/report.mjs';
Expand Down Expand Up @@ -44,7 +45,9 @@ const rule = (primary) => {
const parentRule = findNodeUpToRoot(decl, ({ type }) => type === 'rule');

if (parentRule) return;
} else return;
} else {
return;
}
}

report({
Expand Down
15 changes: 15 additions & 0 deletions lib/utils/isInDocument.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions lib/utils/isInDocument.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { isDocument } from './typeGuards.mjs';

/**
* @param {import('postcss').Node} node
* @returns {boolean}
*/
export function isInDocument({ parent }) {
return Boolean(parent && (isDocument(parent) || 'document' in parent));
}
9 changes: 0 additions & 9 deletions lib/utils/typeGuards.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions lib/utils/typeGuards.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ export function isDocument(node) {
return node.type === 'document';
}

/**
* @param {import('postcss').Node} node
* @returns {boolean}
*/
export function isInDocument({ parent }) {
return Boolean(parent && (isDocument(parent) || 'document' in parent));
}

/**
* @param {import('postcss-value-parser').Node} node
* @returns {node is import('postcss-value-parser').DivNode}
Expand Down
Loading