|
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' |
10 | 10 |
|
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) |
13 | 13 | 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 | +}) |
18 | 18 |
|
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'), |
27 | 29 |
|
28 | 30 | plugins: { |
29 | | - "@typescript-eslint": typescriptEslint, |
30 | | - prettier, |
| 31 | + '@typescript-eslint': typescriptEslint, |
| 32 | + prettier, |
31 | 33 | }, |
32 | 34 |
|
33 | 35 | languageOptions: { |
34 | | - globals: { |
35 | | - ...globals.node, |
36 | | - ...globals.mocha, |
37 | | - }, |
| 36 | + globals: { |
| 37 | + ...globals.node, |
| 38 | + ...globals.mocha, |
| 39 | + }, |
38 | 40 |
|
39 | | - parser: tsParser, |
40 | | - ecmaVersion: 2017, |
41 | | - sourceType: "module", |
| 41 | + parser: tsParser, |
| 42 | + ecmaVersion: 2017, |
| 43 | + sourceType: 'module', |
42 | 44 | }, |
43 | 45 |
|
44 | 46 | 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 | + ], |
50 | 55 |
|
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', |
53 | 58 |
|
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 | + ], |
59 | 67 | }, |
60 | | -}, { |
61 | | - files: ["**/*.ts", "**/*.mts", "**/*.cts", "**/*.tsx"], |
| 68 | + }, |
| 69 | + { |
| 70 | + files: ['**/*.ts', '**/*.mts', '**/*.cts', '**/*.tsx'], |
62 | 71 |
|
63 | 72 | rules: { |
64 | | - "no-undef": "off", |
| 73 | + 'no-undef': 'off', |
65 | 74 | }, |
66 | | -}]); |
| 75 | + }, |
| 76 | +]) |
0 commit comments