Skip to content

Commit

Permalink
feature: goldstein: eslint-plugin-putout v23.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Sep 6, 2024
1 parent 84be18f commit 641db76
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 2 additions & 3 deletions packages/keyword-missing-initializer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 '?='`);
Expand All @@ -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;
Expand All @@ -42,4 +42,3 @@ export const MissingInitializer = {
return this.parseMaybeAssign(isFor);
},
};

1 change: 0 additions & 1 deletion packages/keyword-missing-initializer/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

5 changes: 1 addition & 4 deletions packages/operator-safe-assignment/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 641db76

Please sign in to comment.