forked from koajs/router
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
42 lines (40 loc) · 1.09 KB
/
eslint.config.js
File metadata and controls
42 lines (40 loc) · 1.09 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
const js = require('@eslint/js');
const unicorn = require('eslint-plugin-unicorn');
const tsPlugin = require('@typescript-eslint/eslint-plugin');
const tsParser = require('@typescript-eslint/parser');
const unicornPlugin = unicorn.default || unicorn;
module.exports = [
{
ignores: [
'node_modules/**',
'coverage/**',
'dist/**',
'bench/**',
'examples/**',
'recipes/*.ts'
]
},
// JavaScript files
{
files: ['**/*.{js,cjs,mjs}'],
...js.configs.recommended,
plugins: { unicorn: unicornPlugin },
rules: unicornPlugin.configs.recommended.rules
},
// TypeScript source files
{
files: ['src/**/*.ts'],
languageOptions: {
parser: tsParser,
parserOptions: { project: './tsconfig.json' }
},
plugins: { '@typescript-eslint': tsPlugin, unicorn: unicornPlugin },
rules: unicornPlugin.configs.recommended.rules
},
// TypeScript test files (relaxed)
{
files: ['test/**/*.ts', 'recipes/**/*.test.ts', '*.config.ts'],
languageOptions: { parser: tsParser },
plugins: { '@typescript-eslint': tsPlugin }
}
];