-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecommended.mjs
More file actions
42 lines (40 loc) · 1.18 KB
/
recommended.mjs
File metadata and controls
42 lines (40 loc) · 1.18 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
import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';
import tsParser from '@typescript-eslint/parser';
import globals from 'globals';
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
export default [
...compat.extends('plugin:prettier/recommended', 'plugin:@typescript-eslint/strict-type-checked'),
{
languageOptions: {
globals: {
...globals.node,
},
parser: tsParser,
ecmaVersion: 2020,
sourceType: 'module',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: process.env.npm_package_json ? dirname(process.env.npm_package_json) : process.cwd()
},
},
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'error',
'@typescript-eslint/explicit-function-return-type': 'error',
'no-console': [
'error',
{
allow: ['warn', 'error', 'info', 'trace'],
},
],
},
},
];