Skip to content

Commit 4357afb

Browse files
authored
Reduce ESLint warnings (#2671)
1 parent 2310b50 commit 4357afb

13 files changed

+18
-2
lines changed

eslint.dogfooding.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const config = [
1111
'n/no-unsupported-features/es-syntax',
1212
'eslint-plugin/require-meta-default-options',
1313
'internal/no-restricted-property-access',
14+
'@stylistic/max-len',
1415
]),
1516
{
1617
linterOptions: {

rules/ast/call-or-new-expression.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
} | string | string[]
1212
} CallOrNewExpressionCheckOptions
1313
*/
14+
// eslint-disable-next-line complexity
1415
function create(node, options, types) {
1516
if (!types.includes(node?.type)) {
1617
return false;

rules/ast/is-member-expression.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable complexity */
12
/**
23
@param {
34
{

rules/expiring-todo-comments.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ const create = context => {
317317
});
318318
const rules = baseRule.create(fakeContext);
319319

320+
// eslint-disable-next-line complexity
320321
function processComment(comment) {
321322
if (ignoreRegexes.some(ignore => ignore.test(comment.value))) {
322323
return;

rules/fix/replace-node-or-token-and-spaces-before.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {getParentheses} from '../utils/parentheses.js';
22

3+
// eslint-disable-next-line max-params
34
export default function * replaceNodeOrTokenAndSpacesBefore(nodeOrToken, replacement, fixer, sourceCode, tokenStore = sourceCode) {
45
const tokens = getParentheses(nodeOrToken, tokenStore);
56

rules/import-style.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ const create = context => {
155155

156156
const {sourceCode} = context;
157157

158+
// eslint-disable-next-line max-params
158159
const report = (node, moduleName, actualImportStyles, allowedImportStyles, isRequire = false) => {
159160
if (!allowedImportStyles || allowedImportStyles.size === 0) {
160161
return;

rules/prefer-math-min-max.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable complexity */
12
import {isBigIntLiteral, isCallExpression} from './ast/index.js';
23
import {fixSpaceAroundKeyword} from './fix/index.js';
34

rules/prefer-modern-dom-apis.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ const config = {
132132
meta: {
133133
type: 'suggestion',
134134
docs: {
135-
description: 'Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.',
135+
description:
136+
// eslint-disable-next-line @stylistic/max-len
137+
'Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.',
136138
recommended: true,
137139
},
138140
fixable: 'code',

rules/prefer-string-raw.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ function unescapeBackslash(raw) {
3333

3434
/** @param {import('eslint').Rule.RuleContext} context */
3535
const create = context => {
36+
// eslint-disable-next-line complexity
3637
context.on('Literal', node => {
3738
if (
3839
!isStringLiteral(node)

rules/prefer-ternary.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const create = context => {
5959
return text;
6060
};
6161

62+
// eslint-disable-next-line complexity
6263
function merge(options, mergeOptions) {
6364
const {
6465
before = '',

0 commit comments

Comments
 (0)