Skip to content

Commit

Permalink
fix: format generated file
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Jan 3, 2025
1 parent 7bcbceb commit 3169a30
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 7 additions & 1 deletion eslint.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@ module.exports = [
'require-unicode-regexp': 0,
},
},
{
files: ['**/src/grammar.ts'],
rules: {
'@typescript-eslint/ban-ts-comment': 0,
'no-useless-escape': 0,
},
},
{
ignores: [
'package-lock.json',
'dist',
'node_modules',
'src/pg-formatter',
'*.log',
'.*',
'!.github',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
},
"scripts": {
"benchmark": "ts-node --transpile-only test/benchmark.ts",
"build": "del-cli ./dist && tsc",
"compile-parser": "nearleyc src/grammar.ne --out ./src/grammar.ts && sed -i '' 's/loc?: number/loc: number/g' src/grammar.ts",
"build": "pnpm run compile-parser && del-cli ./dist && tsc",
"compile-parser": "nearleyc src/grammar.ne --out ./src/grammar.ts && sed -i '' 's/loc?: number/loc: number/g' src/grammar.ts && eslint --fix src/grammar.ts",
"dev": "tsc --watch",
"lint": "eslint ./src ./test && tsc --noEmit",
"test": "NODE_ENV=test ava --serial --verbose",
Expand Down
4 changes: 3 additions & 1 deletion src/grammar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ type NearleyToken = {

// Generated automatically by nearley, version 2.20.1
// http://github.com/Hardmath123/nearley
// Bypasses TS6133. Allow declared but unused functions.
// @ts-expect-error
function id(d: any[]): any {
return d[0];
}
Expand Down Expand Up @@ -769,7 +771,7 @@ const grammar: Grammar = {
{
name: 'unquoted_value$ebnf$1',
postprocess: (d) => d[0].concat([d[1]]),
symbols: ['unquoted_value$ebnf$1', /[\w#$*.?@-]/],
symbols: ['unquoted_value$ebnf$1', /[\w#$*.?@\-]/],
},
{
name: 'unquoted_value',
Expand Down

0 comments on commit 3169a30

Please sign in to comment.