eslint-plugin-mobx 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # eslint-plugin-mobx
2
2
 
3
+ ## 0.0.14
4
+
5
+ ### Patch Changes
6
+
7
+ - [`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
8
+
3
9
  ## 0.0.13
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -136,8 +136,8 @@ var findAncestor$2 = utils.findAncestor,
136
136
  // TODO support this.foo = 5; in constructor
137
137
  // TODO? report on field as well
138
138
  function create$4(context) {
139
- var _context$options$0$au, _context$options$;
140
- var sourceCode = context.getSourceCode();
139
+ var _context$sourceCode, _context$options$0$au, _context$options$;
140
+ var sourceCode = (_context$sourceCode = context.sourceCode) !== null && _context$sourceCode !== void 0 ? _context$sourceCode : context.getSourceCode();
141
141
  var autofixAnnotation = (_context$options$0$au = (_context$options$ = context.options[0]) === null || _context$options$ === void 0 ? void 0 : _context$options$.autofixAnnotation) !== null && _context$options$0$au !== void 0 ? _context$options$0$au : true;
142
142
  function fieldToKey(field) {
143
143
  // TODO cache on field?
@@ -308,7 +308,8 @@ var unconditionalMakeObservable$1 = {
308
308
  var findAncestor = utils.findAncestor,
309
309
  isMobxDecorator = utils.isMobxDecorator;
310
310
  function create$2(context) {
311
- var sourceCode = context.getSourceCode();
311
+ var _context$sourceCode;
312
+ var sourceCode = (_context$sourceCode = context.sourceCode) !== null && _context$sourceCode !== void 0 ? _context$sourceCode : context.getSourceCode();
312
313
  return {
313
314
  'Decorator': function Decorator(decorator) {
314
315
  var _clazz$body$body$find, _constructor$value$bo;
@@ -381,7 +382,8 @@ var missingMakeObservable$1 = {
381
382
  };
382
383
 
383
384
  function create$1(context) {
384
- var sourceCode = context.getSourceCode();
385
+ var _context$sourceCode;
386
+ var sourceCode = (_context$sourceCode = context.sourceCode) !== null && _context$sourceCode !== void 0 ? _context$sourceCode : context.getSourceCode();
385
387
  return {
386
388
  "FunctionDeclaration,FunctionExpression,ArrowFunctionExpression,ClassDeclaration,ClassExpression": function FunctionDeclarationFunctionExpressionArrowFunctionExpressionClassDeclarationClassExpression(cmp) {
387
389
  var _cmp$id, _cmpOrForwardRef$pare;
@@ -450,7 +452,8 @@ var missingObserver$1 = {
450
452
  };
451
453
 
452
454
  function create(context) {
453
- var sourceCode = context.getSourceCode();
455
+ var _context$sourceCode;
456
+ var sourceCode = (_context$sourceCode = context.sourceCode) !== null && _context$sourceCode !== void 0 ? _context$sourceCode : context.getSourceCode();
454
457
  return {
455
458
  'CallExpression[callee.name="observer"]': function CallExpressionCalleeNameObserver(observer) {
456
459
  var _cmp$id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-mobx",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "ESLint rules for MobX",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -25,7 +25,7 @@
25
25
  ],
26
26
  "homepage": "https://mobx.js.org/",
27
27
  "peerDependencies": {
28
- "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0"
28
+ "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"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@babel/core": "^7.16.0",
@@ -5,7 +5,7 @@ const { findAncestor, isMobxDecorator } = require("./utils.js")
5
5
  // TODO support this.foo = 5; in constructor
6
6
  // TODO? report on field as well
7
7
  function create(context) {
8
- const sourceCode = context.getSourceCode()
8
+ const sourceCode = context.sourceCode ?? context.getSourceCode()
9
9
  const autofixAnnotation = context.options[0]?.autofixAnnotation ?? true
10
10
 
11
11
  function fieldToKey(field) {
@@ -3,7 +3,7 @@
3
3
  const { findAncestor, isMobxDecorator } = require('./utils.js');
4
4
 
5
5
  function create(context) {
6
- const sourceCode = context.getSourceCode();
6
+ const sourceCode = context.sourceCode ?? context.getSourceCode();
7
7
 
8
8
  return {
9
9
  'Decorator': decorator => {
@@ -1,7 +1,7 @@
1
1
  "use strict"
2
2
 
3
3
  function create(context) {
4
- const sourceCode = context.getSourceCode()
4
+ const sourceCode = context.sourceCode ?? context.getSourceCode()
5
5
 
6
6
  return {
7
7
  "FunctionDeclaration,FunctionExpression,ArrowFunctionExpression,ClassDeclaration,ClassExpression":
@@ -1,7 +1,7 @@
1
1
  "use strict"
2
2
 
3
3
  function create(context) {
4
- const sourceCode = context.getSourceCode()
4
+ const sourceCode = context.sourceCode ?? context.getSourceCode()
5
5
 
6
6
  return {
7
7
  'CallExpression[callee.name="observer"]': observer => {