Skip to content

Update index.js – Removed deprecated 'line' from utils.report#77

Open
stuartbrockwell wants to merge 2 commits intosimonsmith:masterfrom
stuartbrockwell:remove-deprecated-line-utils-report
Open

Update index.js – Removed deprecated 'line' from utils.report#77
stuartbrockwell wants to merge 2 commits intosimonsmith:masterfrom
stuartbrockwell:remove-deprecated-line-utils-report

Conversation

@stuartbrockwell
Copy link
Copy Markdown

@stuartbrockwell stuartbrockwell commented Jun 24, 2025

Removing deprecated 'line' from utils.report.

"Stylelint: (notice:6847)[stylelint:D07]DeprecationWarning: Providing the line argument in the util.report() function is deprecated ("plugin/selector-bem-pattern")."

@akiomik
Copy link
Copy Markdown

akiomik commented Jul 28, 2025

This resolves #76. But you need to specify index and endIndex instead of line as per the following message.

Please pass both index and endIndex as arguments in the utils.report() function of “plugin/selector-bem-pattern” instead.

@stuartbrockwell
Copy link
Copy Markdown
Author

@akiomik – thanks for the heads up.

Would passing the start and end offsets be the correct arguments to pass though?

    bemLinterWarnings.forEach(function(warning) {
      stylelint.utils.report({
        ruleName: ruleName,
        result: result,
        node: warning.node || root,
        index: warning.node.source.start.offset,
        endIndex: warning.node.source.end.offset,
        column: warning.column,
        message: warning.text + ' (' + ruleName + ')',
      });
    });

@fabsk
Copy link
Copy Markdown

fabsk commented Mar 9, 2026

Any chance this change will make it into the code base?

@graham73may
Copy link
Copy Markdown

I ran in to the same error and was testing this PR but it seemed to introduce other issues. Linting errors were showing up in the wrong place afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants