-
Notifications
You must be signed in to change notification settings - Fork 2
/
eslint.config.js
61 lines (55 loc) · 1.34 KB
/
eslint.config.js
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
import importPlugin from 'eslint-plugin-import-x';
import nodePlugin from 'eslint-plugin-n';
import tseslint from 'typescript-eslint';
import prettierPlugin from 'eslint-plugin-prettier';
import globals from 'globals'
import { javascript } from './resources/eslint/javascript.js';
import { typescript } from './resources/eslint/typescript.js';
import { imports } from './resources/eslint/imports.js';
import { prettier } from './resources/eslint/prettier.js';
const TO_EXCLUDE = [
'**/node_modules/**',
'**/dist/**',
'docs/**',
'resources/**',
'eslint.config.js',
];
const TO_INCLUDE = [
'**/*.ts',
'**/*.test.ts',
];
/** @type {import('eslint').Linter.RulesRecord} */
const config = tseslint.config(
{
name: 'palmares/main',
files: TO_INCLUDE,
ignores: TO_EXCLUDE,
languageOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
// @ts-expect-error
parser: tseslint.parser,
parserOptions: {
project: true,
parser: tseslint.parser,
},
globals: {
...globals.browser,
...globals.node,
},
},
plugins: {
ts: tseslint.plugin,
prettier: prettierPlugin,
import: importPlugin,
node: nodePlugin,
},
rules: {
...prettier,
...javascript,
...typescript,
...imports
}
},
);
export default config;