-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy patheslint.config.mjs
More file actions
48 lines (46 loc) · 1.34 KB
/
eslint.config.mjs
File metadata and controls
48 lines (46 loc) · 1.34 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
import globals from 'globals';
import pluginJs from '@eslint/js';
import pluginTypescript from 'typescript-eslint';
import pluginUnicorn from 'eslint-plugin-unicorn';
import eslintConfigPrettier from 'eslint-config-prettier';
/** @type {import('eslint').Linter.RulesRecord} */
const rules = {
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
'unicorn/filename-case': ['error', { case: 'kebabCase' }],
'unicorn/no-null': 'off', // Disabled for now, but worth considering - https://github.com/sindresorhus/meta/discussions/7
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/no-nested-ternary': 'off',
'unicorn/prevent-abbreviations': [
'error',
{
allowList: {
Props: true,
props: true,
Ref: true,
ref: true,
Env: true,
env: true,
Fn: true,
fn: true,
Params: true,
params: true,
utils: true,
Utils: true,
},
},
],
};
/** @type {import('eslint').Linter.Config[]} */
export default [
{ files: ['**/*.{ts}'] },
{ languageOptions: { globals: globals.browser } },
{ ignores: ['**/node_modules/', '.git/', '**/dist/'] },
pluginJs.configs.recommended,
eslintConfigPrettier,
...pluginTypescript.configs.recommended,
pluginUnicorn.configs.recommended,
{
rules,
},
];