-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
44 lines (42 loc) · 1.32 KB
/
eslint.config.mjs
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
import { FlatCompat } from '@eslint/eslintrc';
import * as tseslint from 'typescript-eslint';
const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
});
export default [
{
ignores: ['**/node_modules/**'],
},
...compat.extends('airbnb-base', 'plugin:import/errors', 'plugin:prettier/recommended'),
...tseslint.configs.recommended,
{
files: ['**/*.{js,mjs,cjs,ts}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
settings: {
'import/resolver': {
typescript: true,
node: true,
},
},
rules: {
curly: 'error',
'arrow-parens': ['error', 'as-needed', { requireForBlockBody: false }],
'key-spacing': ['error', { mode: 'minimum' }],
'no-unneeded-ternary': 'error',
'no-trailing-spaces': 'error',
'prettier/prettier': 'error',
'no-unused-expressions': ['error', { allowShortCircuit: true }],
'no-use-before-define': ['error', 'nofunc'],
'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'],
'no-control-regex': 'off',
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'import/no-unresolved': 'off',
'import/no-named-as-default': 'off',
'no-console': 'off',
camelcase: 'off',
},
},
];