Skip to content

Commit 3169a30

Browse files
committed
fix: format generated file
1 parent 7bcbceb commit 3169a30

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

eslint.config.cjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,18 @@ module.exports = [
2020
'require-unicode-regexp': 0,
2121
},
2222
},
23+
{
24+
files: ['**/src/grammar.ts'],
25+
rules: {
26+
'@typescript-eslint/ban-ts-comment': 0,
27+
'no-useless-escape': 0,
28+
},
29+
},
2330
{
2431
ignores: [
2532
'package-lock.json',
2633
'dist',
2734
'node_modules',
28-
'src/pg-formatter',
2935
'*.log',
3036
'.*',
3137
'!.github',

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
},
5858
"scripts": {
5959
"benchmark": "ts-node --transpile-only test/benchmark.ts",
60-
"build": "del-cli ./dist && tsc",
61-
"compile-parser": "nearleyc src/grammar.ne --out ./src/grammar.ts && sed -i '' 's/loc?: number/loc: number/g' src/grammar.ts",
60+
"build": "pnpm run compile-parser && del-cli ./dist && tsc",
61+
"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",
6262
"dev": "tsc --watch",
6363
"lint": "eslint ./src ./test && tsc --noEmit",
6464
"test": "NODE_ENV=test ava --serial --verbose",

src/grammar.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ type NearleyToken = {
3030

3131
// Generated automatically by nearley, version 2.20.1
3232
// http://github.com/Hardmath123/nearley
33+
// Bypasses TS6133. Allow declared but unused functions.
34+
// @ts-expect-error
3335
function id(d: any[]): any {
3436
return d[0];
3537
}
@@ -769,7 +771,7 @@ const grammar: Grammar = {
769771
{
770772
name: 'unquoted_value$ebnf$1',
771773
postprocess: (d) => d[0].concat([d[1]]),
772-
symbols: ['unquoted_value$ebnf$1', /[\w#$*.?@-]/],
774+
symbols: ['unquoted_value$ebnf$1', /[\w#$*.?@\-]/],
773775
},
774776
{
775777
name: 'unquoted_value',

0 commit comments

Comments
 (0)