Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: updated the eslint rule to disable no-restricted-syntax #1491

Closed
wants to merge 1 commit into from
Closed
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
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ module.exports = {
'no-plusplus': 'off',
'no-promise-executor-return': 'off',
'no-restricted-globals': 'off',
'no-restricted-syntax': 'off',
'no-underscore-dangle': 'off',
'no-use-before-define': ['error', 'nofunc'],
'no-var': 'error',
Expand Down
1 change: 0 additions & 1 deletion bin/currency/generate-currency-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ function jsonToMarkdown(data) {
// eslint-disable-next-line max-len
'|--------------|---------|---------|-----------------------------|----------------|-------------|------------|------|--------------|--------------|\n';

// eslint-disable-next-line no-restricted-syntax
for (const entry of data) {
// eslint-disable-next-line max-len
markdown += `| ${entry.name} | ${entry.lastSupportedVersion} | ${entry.latestVersion} | ${entry.publishedAt} | ${entry.policy} | ${entry.daysBehind} day/s | ${entry.upToDate} | ${entry.note} | ${entry.cloudNative} | ${entry.isBeta} |\n`;
Expand Down
2 changes: 0 additions & 2 deletions packages/autoprofile/lib/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* (c) Copyright Instana Inc. and contributors 2020
*/

/* eslint-disable no-restricted-syntax */

'use strict';

const process = require('process');
Expand Down
1 change: 0 additions & 1 deletion packages/autoprofile/lib/samplers/allocation_sampler.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ class AllocationSampler {

buildProfile(duration, timespan) {
const roots = new Set();
// eslint-disable-next-line no-restricted-syntax
for (const child of this.top.children.values()) {
roots.add(child);
}
Expand Down
2 changes: 0 additions & 2 deletions packages/autoprofile/lib/samplers/async_sampler.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* (c) Copyright Instana Inc. and contributors 2020
*/

/* eslint-disable no-restricted-syntax */

'use strict';

const { uninstrumentedFs: fs } = require('@instana/core');
Expand Down
1 change: 0 additions & 1 deletion packages/autoprofile/lib/samplers/cpu_sampler.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class CpuSampler {

buildProfile(duration, timespan) {
const roots = new Set();
// eslint-disable-next-line no-restricted-syntax
for (const child of this.top.children.values()) {
roots.add(child);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ exports._parseFile = async function _parseFile(filename) {
}

logger.debug(`Successfully opened ${filename} for reading to determine the default gateway IP.`);
// eslint-disable-next-line no-restricted-syntax
for (const line of fileContent.split('\n')) {
const fields = line.split('\t');
if (exports._isDefaultGatewayLine(fields)) {
Expand Down
1 change: 0 additions & 1 deletion packages/collector/test/tracing/database/redis/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ app.get('/blocking', async (req, res) => {
});

app.get('/scan-iterator', async (req, res) => {
// eslint-disable-next-line no-restricted-syntax
for await (const key of connection.scanIterator()) {
try {
await connection.get(key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ if (process.env.NATS_VERSION === 'latest') {
const sub = nats.subscribe('publish-test-subject');

(async () => {
// eslint-disable-next-line no-restricted-syntax
for await (const m of sub) {
const msg = sc.decode(m.data);
log(`publish-test-subject: received: "${msg}"`);
Expand All @@ -57,7 +56,6 @@ if (process.env.NATS_VERSION === 'latest') {
let currentSpan;

(async () => {
// eslint-disable-next-line no-restricted-syntax
for await (const m of sub2) {
const msg = sc.decode(m.data);
log(`subscribe-test-subject: received: "${msg}"`);
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/tracing/instrumentation/messaging/nats.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ function instrumentedSubscribe(ctx, originalSubscribe, originalSubscribeArgs, is
const createIterator = async function* instanaIterator() {
cls.ns.enter(currentCtx);

// eslint-disable-next-line no-restricted-syntax
for await (const msg of sub) {
await new Promise(resolve => {
instrumentedSubscribeCallback(ctx._natsUrl, subject, resolve, currentCtx, isLatest)(null, msg);
Expand Down Expand Up @@ -332,7 +331,6 @@ function instrumentedSubscribeCallback(natsUrl, subject, originalSubscribeCallba
}

if (isLatest && msg && msg.headers) {
// eslint-disable-next-line no-restricted-syntax
for (const [key, value] of msg.headers) {
if (key === constants.traceLevelHeaderName && value[0] === '0') {
suppressed = true;
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/util/clone.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ module.exports = function clone(x) {
if (typeof x === 'object') {
r = {};

// eslint-disable-next-line no-restricted-syntax
for (const key in x) {
// eslint-disable-next-line no-prototype-builtins
if (x.hasOwnProperty(key)) {
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/util/compression.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ function applyCompressionToObject(path, prev, next, excludeList) {
const result = {};
let addedProps = 0;

// eslint-disable-next-line no-restricted-syntax
for (const nKey in next) {
// eslint-disable-next-line no-prototype-builtins
if (next.hasOwnProperty(nKey)) {
Expand Down Expand Up @@ -121,7 +120,7 @@ function isExcluded(path, excludeList) {
}

// Compare the given path to all excludeList entries.
// eslint-disable-next-line no-restricted-syntax

outer: for (let i = 0; i < excludeList.length; i++) {
if (excludeList[i].length !== path.length) {
// The excludeList entry and then given path have different lengths, this cannot be a match. Continue with next
Expand Down
1 change: 0 additions & 1 deletion packages/shared-metrics/src/healthchecks.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function gatherHealthcheckResults() {
/** @type {Object.<string, *>} */
const previousResults = exports.currentPayload;

// eslint-disable-next-line no-restricted-syntax
for (const key in adminHealthcheckResults) {
// eslint-disable-next-line no-prototype-builtins
if (adminHealthcheckResults.hasOwnProperty(key)) {
Expand Down