forked from orval-labs/orval
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
87 lines (85 loc) · 2.67 KB
/
eslint.config.mjs
File metadata and controls
87 lines (85 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// @ts-check
import eslint from '@eslint/js';
import { defineConfig, globalIgnores } from 'eslint/config';
import turboConfig from 'eslint-config-turbo/flat';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
import globals from 'globals';
import tseslint from 'typescript-eslint';
export default defineConfig(
globalIgnores([
'docs',
'tests/generated',
'samples',
'.husky',
'packages/hono/src/zValidator.ts',
'**/.yarn',
'**/.turbo',
'**/dist',
]),
turboConfig,
eslint.configs.recommended,
tseslint.configs.strictTypeChecked,
tseslint.configs.stylisticTypeChecked,
eslintPluginUnicorn.configs.recommended,
{
languageOptions: {
globals: globals.builtin,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
'no-useless-escape': 'warn',
'no-case-declarations': 'warn',
'no-prototype-builtins': 'warn',
'unicorn/prevent-abbreviations': 'off',
'unicorn/consistent-function-scoping': [
'error',
{ checkArrowFunctions: false },
],
'@typescript-eslint/restrict-template-expressions': [
'error',
// default (not strict) settings
// consider tightening these in the future
{
allow: [{ name: ['Error', 'URL', 'URLSearchParams'], from: 'lib' }],
allowAny: true,
allowBoolean: true,
allowNullish: true,
allowNumber: true,
allowRegExp: true,
},
],
// enable these in the future
'unicorn/no-null': 'warn',
'unicorn/prefer-at': 'off',
'unicorn/no-array-reduce': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-require-imports': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-function-type': 'warn',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'warn',
},
},
{
plugins: {
'simple-import-sort': simpleImportSort,
},
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
},
{
files: ['**/*.{js,mjs,cjs}'],
extends: [tseslint.configs.disableTypeChecked],
},
eslintPluginPrettierRecommended, // also sets up eslint-config-prettier
);