generated from NickKelly1/nkp-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
68 lines (63 loc) · 1.78 KB
/
.eslintrc.js
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
66
67
68
'use-strict';
/* eslint-env node */
/** @typedef {import('eslint').Linter.Config} Config */
/** @type {Config} */
const config = {
ignorePatterns: ['dist/*', 'node_modules/*',],
overrides: [
{
files: ['*.js', '*.jsx',],
'rules': {
// doesn't work on .js files
'@typescript-eslint/explicit-module-boundary-types': ['off',],
},
},
],
'env': {
// chose which are appropriate
'browser': false,
'node': false,
'es2021': true,
'jest': true,
},
'extends': [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'eslint:recommended',
],
'parser': '@typescript-eslint/parser',
'parserOptions': {
'ecmaVersion': 2021,
'sourceType': ['module', 'commonjs',],
'ecmaFeatures': {
jsx: true, // Allows for the parsing of JSX
},
},
'plugins': [
'@typescript-eslint',
],
rules: {
'indent': ['error', 2, ],
'linebreak-style': ['error', 'unix',],
'quotes': ['error', 'single',],
'semi': ['error', 'always',],
'comma-dangle': ['error', {
'functions': 'only-multiline',
'objects': 'always',
'arrays': 'always',
},],
'no-dupe-class-members': ['off',], // allow ts function overloading
'prefer-arrow-callback': ['off',],
'import/no-commonjs': ['off',],
'max-len': ['error', { code: 120, },],
'no-unused-vars': ['off',], // favour typescript's no-unused-vars
'no-undef': ['off',], // favour typescript
'no-redeclare': ['off',], // favour typescript
'no-trailing-spaces': ['error',],
'eqeqeq': ['error', 'smart',],
'@typescript-eslint/ban-ts-comment': ['off',],
'@typescript-eslint/no-non-null-assertion': ['off',],
'@typescript-eslint/no-this-alias': ['off',],
},
};
module.exports = config;