Skip to content

Conversation

@stuartbrockwell
Copy link

@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

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
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 + ')',
      });
    });

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.

2 participants