Skip to content

Commit a4ff1bf

Browse files
committed
Run eslint on its own config
1 parent e953ead commit a4ff1bf

1 file changed

Lines changed: 58 additions & 48 deletions

File tree

eslint.config.mjs

Lines changed: 58 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,76 @@
1-
import { defineConfig, globalIgnores } from "eslint/config";
2-
import typescriptEslint from "@typescript-eslint/eslint-plugin";
3-
import prettier from "eslint-plugin-prettier";
4-
import globals from "globals";
5-
import tsParser from "@typescript-eslint/parser";
6-
import path from "node:path";
7-
import { fileURLToPath } from "node:url";
8-
import js from "@eslint/js";
9-
import { FlatCompat } from "@eslint/eslintrc";
1+
import { defineConfig, globalIgnores } from 'eslint/config'
2+
import typescriptEslint from '@typescript-eslint/eslint-plugin'
3+
import prettier from 'eslint-plugin-prettier'
4+
import globals from 'globals'
5+
import tsParser from '@typescript-eslint/parser'
6+
import path from 'node:path'
7+
import { fileURLToPath } from 'node:url'
8+
import js from '@eslint/js'
9+
import { FlatCompat } from '@eslint/eslintrc'
1010

11-
const __filename = fileURLToPath(import.meta.url);
12-
const __dirname = path.dirname(__filename);
11+
const __filename = fileURLToPath(import.meta.url)
12+
const __dirname = path.dirname(__filename)
1313
const compat = new FlatCompat({
14-
baseDirectory: __dirname,
15-
recommendedConfig: js.configs.recommended,
16-
allConfig: js.configs.all
17-
});
14+
baseDirectory: __dirname,
15+
recommendedConfig: js.configs.recommended,
16+
allConfig: js.configs.all,
17+
})
1818

19-
export default defineConfig([globalIgnores([
20-
"**/node_modules",
21-
"**/coverage",
22-
"packages/*/dist",
23-
"packages/pg-protocol/dist/**/*",
24-
"packages/pg-query-stream/dist/**/*",
25-
]), {
26-
extends: compat.extends("eslint:recommended", "plugin:prettier/recommended", "prettier"),
19+
export default defineConfig([
20+
globalIgnores([
21+
'**/node_modules',
22+
'**/coverage',
23+
'packages/*/dist',
24+
'packages/pg-protocol/dist/**/*',
25+
'packages/pg-query-stream/dist/**/*',
26+
]),
27+
{
28+
extends: compat.extends('eslint:recommended', 'plugin:prettier/recommended', 'prettier'),
2729

2830
plugins: {
29-
"@typescript-eslint": typescriptEslint,
30-
prettier,
31+
'@typescript-eslint': typescriptEslint,
32+
prettier,
3133
},
3234

3335
languageOptions: {
34-
globals: {
35-
...globals.node,
36-
...globals.mocha,
37-
},
36+
globals: {
37+
...globals.node,
38+
...globals.mocha,
39+
},
3840

39-
parser: tsParser,
40-
ecmaVersion: 2017,
41-
sourceType: "module",
41+
parser: tsParser,
42+
ecmaVersion: 2017,
43+
sourceType: 'module',
4244
},
4345

4446
rules: {
45-
"@typescript-eslint/no-unused-vars": ["error", {
46-
args: "none",
47-
caughtErrors: "none",
48-
varsIgnorePattern: "^_$",
49-
}],
47+
'@typescript-eslint/no-unused-vars': [
48+
'error',
49+
{
50+
args: 'none',
51+
caughtErrors: 'none',
52+
varsIgnorePattern: '^_$',
53+
},
54+
],
5055

51-
// handled by @typescript-eslint/no-unused-vars
52-
"no-unused-vars": "off",
56+
// handled by @typescript-eslint/no-unused-vars
57+
'no-unused-vars': 'off',
5358

54-
"no-var": "error",
55-
"prefer-const": "error",
56-
"no-constant-condition": ["error", {
57-
checkLoops: "all"
58-
}]
59+
'no-var': 'error',
60+
'prefer-const': 'error',
61+
'no-constant-condition': [
62+
'error',
63+
{
64+
checkLoops: 'all',
65+
},
66+
],
5967
},
60-
}, {
61-
files: ["**/*.ts", "**/*.mts", "**/*.cts", "**/*.tsx"],
68+
},
69+
{
70+
files: ['**/*.ts', '**/*.mts', '**/*.cts', '**/*.tsx'],
6271

6372
rules: {
64-
"no-undef": "off",
73+
'no-undef': 'off',
6574
},
66-
}]);
75+
},
76+
])

0 commit comments

Comments
 (0)