Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: stylelint/stylelint
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 14.8.3
Choose a base ref
...
head repository: stylelint/stylelint
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 14.8.4
Choose a head ref
  • 7 commits
  • 6 files changed
  • 3 contributors

Commits on May 24, 2022

  1. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    radovanradic Radovan Radic
    Copy the full SHA
    f75295f View commit details
  2. Update CHANGELOG.md

    ybiquitous authored May 24, 2022

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    radovanradic Radovan Radic
    Copy the full SHA
    6d13ccd View commit details
  3. Bump eslint from 8.15.0 to 8.16.0 (#6104)

    Bumps [eslint](https://github.com/eslint/eslint) from 8.15.0 to 8.16.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
    - [Commits](eslint/eslint@v8.15.0...v8.16.0)
    
    ---
    updated-dependencies:
    - dependency-name: eslint
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored May 24, 2022

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    radovanradic Radovan Radic
    Copy the full SHA
    1e9e877 View commit details
  4. Bump postcss from 8.4.13 to 8.4.14 (#6105)

    Bumps [postcss](https://github.com/postcss/postcss) from 8.4.13 to 8.4.14.
    - [Release notes](https://github.com/postcss/postcss/releases)
    - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
    - [Commits](postcss/postcss@8.4.13...8.4.14)
    
    ---
    updated-dependencies:
    - dependency-name: postcss
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored May 24, 2022

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    radovanradic Radovan Radic
    Copy the full SHA
    e6d6740 View commit details
  5. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    radovanradic Radovan Radic
    Copy the full SHA
    22df83c View commit details
  6. Prepare 14.8.4

    ybiquitous committed May 24, 2022

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    radovanradic Radovan Radic
    Copy the full SHA
    613c115 View commit details
  7. 14.8.4

    ybiquitous committed May 24, 2022

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    radovanradic Radovan Radic
    Copy the full SHA
    abc0ca5 View commit details
Showing with 73 additions and 47 deletions.
  1. +4 −0 CHANGELOG.md
  2. +1 −1 docs/maintainer-guide/releases.md
  3. +13 −0 lib/rules/no-duplicate-selectors/__tests__/index.js
  4. +10 −1 lib/rules/no-duplicate-selectors/index.js
  5. +42 −42 package-lock.json
  6. +3 −3 package.json
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,10 @@

All notable changes to this project are documented in this file.

## 14.8.4

- Fixed: `no-duplicate-selectors` error with non-standard selectors ([#6106](https://github.com/stylelint/stylelint/pull/6106)).

## 14.8.3

- Fixed: `no-invalid-*` end positions ([#6072](https://github.com/stylelint/stylelint/pull/6072)).
2 changes: 1 addition & 1 deletion docs/maintainer-guide/releases.md
Original file line number Diff line number Diff line change
@@ -43,5 +43,5 @@
- [ ] stylelint.io update
- [ ] tweet

cc @stylelint/core
cc @stylelint/owners
```
13 changes: 13 additions & 0 deletions lib/rules/no-duplicate-selectors/__tests__/index.js
Original file line number Diff line number Diff line change
@@ -347,3 +347,16 @@ testRule({
},
],
});

testRule({
ruleName,
customSyntax: 'postcss-scss',
config: [true],

accept: [
{
code: 'a { background: { color: red } }',
description: 'Non standard SCSS nested property',
},
],
});
11 changes: 10 additions & 1 deletion lib/rules/no-duplicate-selectors/index.js
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ const selectorParser = require('postcss-selector-parser');

const findAtRuleContext = require('../../utils/findAtRuleContext');
const isKeyframeRule = require('../../utils/isKeyframeRule');
const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector');
const nodeContextLookup = require('../../utils/nodeContextLookup');
const parseSelector = require('../../utils/parseSelector');
const report = require('../../utils/report');
@@ -62,7 +63,11 @@ const rule = (primary, secondaryOptions) => {
);
const resolvedSelectorList = [
...new Set(
ruleNode.selectors.flatMap((selector) => resolvedNestedSelector(selector, ruleNode)),
ruleNode.selectors.flatMap((selector) => {
return isStandardSyntaxSelector(selector)
? resolvedNestedSelector(selector, ruleNode)
: [];
}),
),
];
const normalizedSelectorList = resolvedSelectorList.map((selector) => normalize(selector));
@@ -123,6 +128,10 @@ const rule = (primary, secondaryOptions) => {

// Or complain if one selector list contains the same selector more than once
for (const selector of ruleNode.selectors) {
if (!isStandardSyntaxSelector(selector)) {
continue;
}

const normalized = normalize(selector);

if (presentedSelectors.has(normalized)) {
84 changes: 42 additions & 42 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stylelint",
"version": "14.8.3",
"version": "14.8.4",
"description": "A mighty, modern CSS linter.",
"keywords": [
"css-in-js",
@@ -132,7 +132,7 @@
"micromatch": "^4.0.5",
"normalize-path": "^3.0.0",
"picocolors": "^1.0.0",
"postcss": "^8.4.13",
"postcss": "^8.4.14",
"postcss-media-query-parser": "^0.2.3",
"postcss-resolve-nested-selector": "^0.1.1",
"postcss-safe-parser": "^6.0.0",
@@ -168,7 +168,7 @@
"benchmark": "^2.1.4",
"common-tags": "^1.8.2",
"deepmerge": "^4.2.2",
"eslint": "^8.15.0",
"eslint": "^8.16.0",
"eslint-config-stylelint": "^15.1.0",
"eslint-plugin-jest": "^26.2.2",
"husky": "^8.0.1",