-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
65 lines (64 loc) · 2.15 KB
/
Copy patheslint.config.js
File metadata and controls
65 lines (64 loc) · 2.15 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
54
55
56
57
58
59
60
61
62
63
64
65
/* eslint-disable */
const js = require('@eslint/js');
const globals = require('globals');
const tsParser = require('@typescript-eslint/parser');
const tsPlugin = require('@typescript-eslint/eslint-plugin');
module.exports = [
// config for all ts files
{
files: ['src/**/*.ts'],
languageOptions: {
parser: tsParser,
parserOptions: {
project: './tsconfig.json',
},
},
plugins: {
'@typescript-eslint': tsPlugin,
},
rules: {
...tsPlugin.configs.recommended.rules,
...tsPlugin.configs['eslint-recommended'].rules,
},
},
// global config for all files
{
rules: {
'arrow-spacing': ['error', { before: true, after: true }],
'arrow-parens': ['error', 'as-needed'],
'block-spacing': ['error', 'always'],
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'comma-dangle': ['error', 'always-multiline'],
'comma-spacing': ['error', { before: false, after: true }],
'comma-style': ['error', 'last'],
'eol-last': ['error', 'always'],
'func-call-spacing': ['error', 'never'],
'indent': ['error', 2],
'key-spacing': ['error', { beforeColon: false, afterColon: true }],
'keyword-spacing': ['error', { before: true, after: true }],
'multiline-comment-style': ['error', 'separate-lines'],
'no-mixed-spaces-and-tabs': 'error',
'no-multi-spaces': 'error',
'no-trailing-spaces': 'error',
'no-whitespace-before-property': 'error',
'nonblock-statement-body-position': ['error', 'beside'],
'quotes': ['error', 'single', { avoidEscape: true }],
'semi': ['error', 'always'],
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': ['error', 'never'],
'space-in-parens': ['error', 'never'],
'space-infix-ops': 'error',
'space-unary-ops': ['error', { words: true, nonwords: false }],
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
},
languageOptions: {
ecmaVersion: 6,
globals: {
define: 'readonly',
log: 'readonly',
...globals.browser,
},
},
},
];