-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.ts
48 lines (43 loc) · 1.77 KB
/
eslint.config.ts
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
import type { Linter } from 'eslint'
import { defineConfig, globalIgnores } from 'eslint/config'
import globals from 'globals'
import eslintPluginJs from '@eslint/js'
import eslintPluginYml from 'eslint-plugin-yml'
import eslintPluginJsonc from 'eslint-plugin-jsonc'
import eslintPluginPackageJson from 'eslint-plugin-package-json'
import neostandard, { plugins as eslintPlugins, resolveIgnoresFromGitignore } from 'neostandard'
export default defineConfig([
globalIgnores(resolveIgnoresFromGitignore()),
{ languageOptions: { globals: { ...globals.node } } },
eslintPluginJs.configs.recommended,
neostandard({
noJsx: true,
ts: true
}),
eslintPlugins.promise.configs['flat/recommended'],
eslintPlugins['@stylistic'].configs['recommended-flat'],
eslintPlugins.n.configs['flat/recommended'],
eslintPluginJsonc.configs['flat/recommended-with-json'],
eslintPluginPackageJson.configs.recommended,
eslintPluginYml.configs['flat/recommended'],
{
rules: {
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
'@stylistic/no-multi-spaces': ['error', { ignoreEOLComments: false }],
'@stylistic/arrow-parens': ['error', 'always'],
'@stylistic/quote-props': ['error', 'as-needed'],
'@stylistic/comma-dangle': ['error', 'never'],
'@stylistic/operator-linebreak': [
'error',
'after',
{ overrides: { '?': 'before', ':': 'before' } }
],
// Disabled due this rule not support workspaces
// reference: https://github.com/eslint-community/eslint-plugin-n/issues/209
'n/no-extraneous-import': ['off'],
'n/no-missing-import': ['off'],
'yml/indent': ['error', 3, { indicatorValueIndent: 2 }],
'yml/quotes': ['error', { prefer: 'double' }]
}
}
]) as Linter.Config[]