-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.library.cjs
61 lines (61 loc) · 2.01 KB
/
.eslintrc.library.cjs
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
// ESLint config for formatting the <project name>/src/**/*.ts files.
module.exports = {
root: true,
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:type-only-import/recommended",
"plugin:jsdoc/recommended-typescript-error",
"plugin:prettier/recommended",
"plugin:sonarjs/recommended"
],
plugins: [
"type-only-import",
"jsdoc",
"prettier"
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
sourceType: "module",
ecmaVersion: "latest",
tsconfigRootDir: __dirname,
},
rules: {
"prettier/prettier": "error",
//"function-paren-newline": ["error", "always"],
"@typescript-eslint/explicit-module-boundary-types": "off", // IDE will show the return types
"@typescript-eslint/restrict-template-expressions": "off", // We are OK with whatever type within template expressions
"@typescript-eslint/unbound-method": "off", // We never use 'this' within functions anyways.
"@typescript-eslint/no-empty-function": "off", // Empty functions are ok sometimes.
"no-useless-return": "error",
"no-console": "error",
"sonarjs/no-nested-template-literals": "off", // Nested template literals are OK really
"jsdoc/require-file-overview": "error",
"jsdoc/require-jsdoc": [
"error",
{
"publicOnly": true,
"require": {
"ArrowFunctionExpression": true,
"ClassDeclaration": true,
"ClassExpression": true,
"FunctionDeclaration": true,
"FunctionExpression": true,
"MethodDefinition": true
},
"exemptEmptyConstructors": true,
"exemptEmptyFunctions": false,
"enableFixer": false,
"contexts": [
"TSInterfaceDeclaration",
"TSTypeAliasDeclaration",
"TSMethodSignature",
"TSPropertySignature"
]
}
]
}
};