-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patheslint.config.mjs
55 lines (48 loc) · 1.43 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
45
46
47
48
49
50
51
52
53
54
55
import common from 'eslint-config-neon/common';
import edge from 'eslint-config-neon/edge';
import node from 'eslint-config-neon/node';
import prettier from 'eslint-config-neon/prettier';
import typescript from 'eslint-config-neon/typescript';
import merge from 'lodash.merge';
import tseslint from 'typescript-eslint';
const commonFiles = '{js,mjs,cjs,ts,mts,cts,jsx,tsx}';
const commonRuleset = merge(...common, { files: [`**/*${commonFiles}`] });
const nodeRuleset = merge(...node, { files: [`**/*${commonFiles}`] });
const typeScriptRuleset = merge(...typescript, {
files: [`**/*${commonFiles}`],
languageOptions: {
parserOptions: {
project: ['tsconfig.eslint.json', 'tsconfig.middleware.json'],
},
},
rules: {
'@typescript-eslint/consistent-type-definitions': [2, 'interface'],
},
settings: {
'import/resolver': {
typescript: {
project: ['tsconfig.eslint.json', 'tsconfig.middleware.json'],
},
},
},
});
const edgeRuleset = merge(...edge, { files: [`**/*${commonFiles}`] });
const prettierRuleset = merge(...prettier, { files: [`**/*${commonFiles}`] });
export default tseslint.config(
{
ignores: ['**/node_modules/', '.git/', '**/dist/', '**/template/', '**/coverage/'],
},
commonRuleset,
nodeRuleset,
typeScriptRuleset,
{
files: ['**/*{ts,mts,cts,tsx}'],
rules: { 'jsdoc/no-undefined-types': 0 },
},
edgeRuleset,
{
files: ['**/*{js,mjs,cjs,jsx}'],
rules: { 'tsdoc/syntax': 0 },
},
prettierRuleset,
);