Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
53 lines (51 loc) · 1.56 KB
/
Copy patheslint.config.js
File metadata and controls
53 lines (51 loc) · 1.56 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
43
44
45
46
47
48
49
50
51
52
53
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,
'unicorn/consistent-class-member-order': 'off',
'unicorn/no-this-outside-of-class': 'off',
'unicorn/consistent-class-member-order': 'off',
'unicorn/prefer-array-last-methods': 'off',
'unicorn/prefer-await': 'off',
'unicorn/no-computed-property-existence': 'off',
'unicorn/no-computed-property-existence-check': 'off',
'unicorn/prefer-private-class-fields': 'off',
'unicorn/prefer-simple-condition-first': 'off'
}
},
// TypeScript test files (relaxed)
{
files: ['test/**/*.ts', 'recipes/**/*.test.ts', '*.config.ts'],
languageOptions: { parser: tsParser },
plugins: { '@typescript-eslint': tsPlugin }
}
];