mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-28 21:24:26 +08:00
Update the @typescript-eslint - eslint-plugin and parser to v7.18.0 cia incremental patches. This is the last version before breaking changes need to start be applied to the infrastructure. Needed to update EsLint to v8.56.0 as required by the above major v7. Only one new error was uncovered in test file and fixed. No-Presubmit: true Bug: none Change-Id: I4e4fe265b82deeb49786c5bf3e154dac8fcfecbd Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6054130 Reviewed-by: Danil Somsikov <dsv@chromium.org> Commit-Queue: Nikolay Vitkov <nvitkov@chromium.org>
53 lines
1.3 KiB
JavaScript
53 lines
1.3 KiB
JavaScript
/**
|
|
* @fileoverview Rule to flag usage of __iterator__ property
|
|
* @author Ian Christian Myers
|
|
*/
|
|
|
|
"use strict";
|
|
|
|
//------------------------------------------------------------------------------
|
|
// Requirements
|
|
//------------------------------------------------------------------------------
|
|
|
|
const { getStaticPropertyName } = require("./utils/ast-utils");
|
|
|
|
//------------------------------------------------------------------------------
|
|
// Rule Definition
|
|
//------------------------------------------------------------------------------
|
|
|
|
/** @type {import('../shared/types').Rule} */
|
|
module.exports = {
|
|
meta: {
|
|
type: "suggestion",
|
|
|
|
docs: {
|
|
description: "Disallow the use of the `__iterator__` property",
|
|
recommended: false,
|
|
url: "https://eslint.org/docs/latest/rules/no-iterator"
|
|
},
|
|
|
|
schema: [],
|
|
|
|
messages: {
|
|
noIterator: "Reserved name '__iterator__'."
|
|
}
|
|
},
|
|
|
|
create(context) {
|
|
|
|
return {
|
|
|
|
MemberExpression(node) {
|
|
|
|
if (getStaticPropertyName(node) === "__iterator__") {
|
|
context.report({
|
|
node,
|
|
messageId: "noIterator"
|
|
});
|
|
}
|
|
}
|
|
};
|
|
|
|
}
|
|
};
|