diff --git a/package.json b/package.json index d6c6f7b..fd32350 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "esbuild": "^0.23.0", "esbuild-node-builtins": "^0.1.0", "eslint": "^9.2.0", - "eslint-plugin-putout": "^22.0.0", + "eslint-plugin-putout": "^23.1.0", "madrun": "^10.0.0", "mock-require": "^3.0.3", "montag": "^1.2.1", diff --git a/packages/keyword-missing-initializer/index.js b/packages/keyword-missing-initializer/index.js index 4fa4d80..1b58b6d 100644 --- a/packages/keyword-missing-initializer/index.js +++ b/packages/keyword-missing-initializer/index.js @@ -9,6 +9,7 @@ export default function keywordMissingInitializer(Parser) { const decl = this.startNode(); this.parseVarId(decl, kind); + /* c8 ignore start */ if (this.eat(tt.question) && this.eat(tt.eq)) { if (!this.parseSafeAssignment) this.raise(this.lastTokEnd, `Enable 'operator-safe-assignment' to have ability to use '?='`); @@ -18,8 +19,7 @@ export default function keywordMissingInitializer(Parser) { decl.init = this.parseMaybeAssign(isFor); } else if (!allowMissingInitializer && kind === 'const' && !(this.type === tt._in || this.options.ecmaVersion >= 6 && this.isContextual('of'))) { decl.init = MissingInitializer.missInitializer.call(this, isFor); - } /* c8 ignore start */ - else if (!allowMissingInitializer && decl.id.type !== 'Identifier' && !(isFor && (this.type === tt._in || this.isContextual('of')))) { + } else if (!allowMissingInitializer && decl.id.type !== 'Identifier' && !(isFor && (this.type === tt._in || this.isContextual('of')))) { this.raise(this.lastTokEnd, 'Complex binding patterns require an initialization value'); } else { decl.init = null; @@ -42,4 +42,3 @@ export const MissingInitializer = { return this.parseMaybeAssign(isFor); }, }; - diff --git a/packages/keyword-missing-initializer/index.spec.js b/packages/keyword-missing-initializer/index.spec.js index 25b82c2..715826d 100644 --- a/packages/keyword-missing-initializer/index.spec.js +++ b/packages/keyword-missing-initializer/index.spec.js @@ -19,4 +19,3 @@ test('goldstein: missing-initializer: no safeAssignment', (t) => { t.raise('no-safe-assignment', `Enable 'operator-safe-assignment' to have ability to use '?=' (1:26)`); t.end(); }); - diff --git a/packages/operator-safe-assignment/index.spec.js b/packages/operator-safe-assignment/index.spec.js index ef528cc..d8532b8 100644 --- a/packages/operator-safe-assignment/index.spec.js +++ b/packages/operator-safe-assignment/index.spec.js @@ -2,10 +2,7 @@ import {createTest} from '../test/index.js'; import operatorSafeAssignment from './index.js'; import keywordMissingInitializer from '../keyword-missing-initializer/index.js'; -const test = createTest(import.meta.url, ...[ - operatorSafeAssignment, - keywordMissingInitializer, -]); +const test = createTest(import.meta.url, ...[operatorSafeAssignment, keywordMissingInitializer]); test('goldstein: operator: safe-assignment', (t) => { t.compile('safe-assignment');