Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/eslint-plugin-mobx/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# eslint-plugin-mobx

## 0.0.14

### Patch Changes

- [`f65bc0700461846b05294f857beb211f45eead6f`](https://github.com/mobxjs/mobx/commit/f65bc0700461846b05294f857beb211f45eead6f) [#4613](https://github.com/mobxjs/mobx/pull/4613) Thanks [@roli-lpci](https://github.com/roli-lpci)! - Replace deprecated context.getSourceCode() with context.sourceCode for ESLint 10 compatibility

## 0.0.13

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin-mobx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-mobx",
"version": "0.0.13",
"version": "0.0.14",
"description": "ESLint rules for MobX",
"main": "dist/index.js",
"repository": {
Expand All @@ -25,7 +25,7 @@
],
"homepage": "https://mobx.js.org/",
"peerDependencies": {
"eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0"
"eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0"
},
"devDependencies": {
"@babel/core": "^7.16.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { findAncestor, isMobxDecorator } = require("./utils.js")
// TODO support this.foo = 5; in constructor
// TODO? report on field as well
function create(context) {
const sourceCode = context.getSourceCode()
const sourceCode = context.sourceCode ?? context.getSourceCode()
const autofixAnnotation = context.options[0]?.autofixAnnotation ?? true

function fieldToKey(field) {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-mobx/src/missing-make-observable.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const { findAncestor, isMobxDecorator } = require('./utils.js');

function create(context) {
const sourceCode = context.getSourceCode();
const sourceCode = context.sourceCode ?? context.getSourceCode();

return {
'Decorator': decorator => {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-mobx/src/missing-observer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict"

function create(context) {
const sourceCode = context.getSourceCode()
const sourceCode = context.sourceCode ?? context.getSourceCode()

return {
"FunctionDeclaration,FunctionExpression,ArrowFunctionExpression,ClassDeclaration,ClassExpression":
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-mobx/src/no-anonymous-observer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict"

function create(context) {
const sourceCode = context.getSourceCode()
const sourceCode = context.sourceCode ?? context.getSourceCode()

return {
'CallExpression[callee.name="observer"]': observer => {
Expand Down
Loading