Skip to content

Commit

Permalink
feature: @putout/plugin-goldstein: c8 v9.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed May 6, 2024
1 parent a728422 commit 1399854
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/keyword-no-async/fixture/no-async.gs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
function hello() => {}
function world() {}
3 changes: 3 additions & 0 deletions packages/keyword-no-async/fixture/no-async.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function hello() {}

function world() {}
36 changes: 36 additions & 0 deletions packages/keyword-no-async/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import {tokTypes as tt} from 'acorn';

export default function fn(Parser) {
return class extends Parser {
parseBlock(createNewLexicalScope, node, exitStrict) {
if (createNewLexicalScope === void 0)
createNewLexicalScope = true;

if (node === void 0)
node = this.startNode();

node.body = [];
// optionally parse arrow
this.eat(tt.arrow);
this.expect(tt.braceL);

if (createNewLexicalScope)
this.enterScope(0);

while (this.type !== tt.braceR) {
const stmt = this.parseStatement(null);
node.body.push(stmt);
}

if (exitStrict)
this.strict = false;

this.next();

if (createNewLexicalScope)
this.exitScope();

return this.finishNode(node, 'BlockStatement');
}
};
}
9 changes: 9 additions & 0 deletions packages/keyword-no-async/index.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {createTest} from '../test/index.js';
import keywordFn from './index.js';

const test = createTest(import.meta.url, keywordFn);

test('goldstein: keyword: arrow', (t) => {
t.compile('arrow');
t.end();
});
2 changes: 1 addition & 1 deletion rules/goldstein/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
],
"devDependencies": {
"@putout/test": "^7.0.0",
"c8": "^8.0.0",
"c8": "^9.1.0",
"eslint": "^8.0.1",
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-putout": "^19.0.0",
Expand Down

0 comments on commit 1399854

Please sign in to comment.