Skip to content
Prev Previous commit
Next Next commit
refactor: use sourceCode parser services instead of context
  • Loading branch information
Mussin Benarbia committed Dec 3, 2023
commit 62b053f9e8aa3a8489cd64e6fde1f60928b3b6dc
5 changes: 3 additions & 2 deletions lib/rules/enforce-style-attribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ module.exports = {

/** @param {RuleContext} context */
create(context) {
if (!context.parserServices.getDocumentFragment) {
const sourceCode = context.getSourceCode()
if (!sourceCode.parserServices.getDocumentFragment) {
return {}
}
const documentFragment = context.parserServices.getDocumentFragment()
const documentFragment = sourceCode.parserServices.getDocumentFragment()
if (!documentFragment) {
return {}
}
Expand Down