-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
36 lines (34 loc) · 1.32 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
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
/** @type {import('eslint').Linter.Config[]} */
export default [
{ files: ['**/*.{js,mjs,cjs,ts}'] },
{ files: ['**/*.js'], languageOptions: { sourceType: 'script' } },
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{
ignorePatterns: ['dist/'],
rules: {
'linebreak-style': ['error', 'unix'],
'no-trailing-spaces': 'error',
'indent': ['error', 2],
'camelcase': 'error',
'arrow-parens': ['error', 'always'],
'comma-spacing': ['error', { 'before': false, 'after': true }],
'object-curly-spacing': ['error', 'always'],
'array-bracket-spacing': ['error', 'never'],
'space-in-parens': ['error', 'never'],
'space-before-function-paren': ['error', { 'anonymous': 'always', 'named': 'never', 'asyncArrow': 'always' }],
'func-call-spacing': ['error', 'never'],
'keyword-spacing': ['error', { 'before': true, 'after': true }],
'prefer-const': 'error',
'no-var': 'error',
'semi': ['error', 'always'],
'quotes': ['error', 'single', { 'avoidEscape': true }],
'prefer-template': 'error',
'prefer-arrow-callback': 'error',
},
},
];