Skip to content

Commit

Permalink
Replace deprecated context#getSourceCode() for new `context#sourceC…
Browse files Browse the repository at this point in the history
  • Loading branch information
piranna committed May 8, 2023
1 parent 8d0bda7 commit 30c1fcb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -42,7 +42,7 @@ module.exports = ruleComposer.joinReports([
semiRule,
context => ({
ClassProperty(node) {
if (context.getSourceCode().getLastToken(node).value !== ';') {
if (context.sourceCode.getLastToken(node).value !== ';') {
context.report({ node, message: 'Missing semicolon.' })
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/rule-composer.js
Expand Up @@ -126,7 +126,7 @@ module.exports = Object.freeze({
return Object.freeze({
create(context) {
const filename = context.getFilename();
const sourceCode = context.getSourceCode();
const sourceCode = context.sourceCode;
const settings = context.settings;
const options = context.options;
return getRuleCreateFunc(rule)(
Expand Down Expand Up @@ -158,7 +158,7 @@ module.exports = Object.freeze({
return Object.freeze({
create(context) {
const filename = context.getFilename();
const sourceCode = context.getSourceCode();
const sourceCode = context.sourceCode;
const settings = context.settings;
const options = context.options;
return getRuleCreateFunc(rule)(
Expand Down
3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -38,6 +38,9 @@
"mocha": "^10.2.0",
"typescript": "^5.0.4"
},
"peerDependencies": {
"eslint": "^8.40.0"
},
"engines": {
"node": ">=8.3.0"
}
Expand Down

0 comments on commit 30c1fcb

Please sign in to comment.