@forsakringskassan/eslint-config-typescript 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +73 -0
- package/package.json +32 -0
package/index.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
parser: "@typescript-eslint/parser",
|
|
3
|
+
|
|
4
|
+
plugins: ["@typescript-eslint", "tsdoc"],
|
|
5
|
+
|
|
6
|
+
extends: [
|
|
7
|
+
"plugin:@typescript-eslint/strict",
|
|
8
|
+
"plugin:@typescript-eslint/stylistic",
|
|
9
|
+
],
|
|
10
|
+
|
|
11
|
+
rules: {
|
|
12
|
+
/* Disabled as it is better to let typescript deal with this. For
|
|
13
|
+
* instance, ESLint cannot detect when exhaustive checks are made and
|
|
14
|
+
* the rest of the function is dead thus yielding false positives */
|
|
15
|
+
"consistent-return": "off",
|
|
16
|
+
|
|
17
|
+
/* prefer T[] for simple types, Array<T> for complex types (unions, etc) */
|
|
18
|
+
"@typescript-eslint/array-type": ["error", { default: "array-simple" }],
|
|
19
|
+
|
|
20
|
+
/* require all regular functions and methods to explicitly declare
|
|
21
|
+
* return value type */
|
|
22
|
+
"@typescript-eslint/explicit-function-return-type": [
|
|
23
|
+
"error",
|
|
24
|
+
{
|
|
25
|
+
allowExpressions: true,
|
|
26
|
+
allowHigherOrderFunctions: true,
|
|
27
|
+
allowTypedFunctionExpressions: true,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
|
|
31
|
+
/* require all members to specify "public", "private", etc */
|
|
32
|
+
"@typescript-eslint/explicit-member-accessibility": "error",
|
|
33
|
+
|
|
34
|
+
/* allow "const foo: number = 0" */
|
|
35
|
+
"@typescript-eslint/no-inferrable-types": "off",
|
|
36
|
+
|
|
37
|
+
/* allow function(this: void, ...) */
|
|
38
|
+
"@typescript-eslint/no-invalid-void-type": [
|
|
39
|
+
"error",
|
|
40
|
+
{
|
|
41
|
+
allowAsThisParameter: true,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
|
|
45
|
+
/* allow constructs such as `unknown | null`, while `unknown` does override
|
|
46
|
+
* `null` it can still serve as a self-documenting type to signal that
|
|
47
|
+
* `null` has a special meaning. It also helps when the type is to be
|
|
48
|
+
* replaced with a better type later. */
|
|
49
|
+
"@typescript-eslint/no-redundant-type-constituents": "off",
|
|
50
|
+
|
|
51
|
+
"@typescript-eslint/no-unused-vars": [
|
|
52
|
+
"error",
|
|
53
|
+
{
|
|
54
|
+
/* allow `foo` to be unused when `{ foo, ...spread} = bar` is
|
|
55
|
+
* used to extract members from objects */
|
|
56
|
+
ignoreRestSiblings: true,
|
|
57
|
+
|
|
58
|
+
/* allow _ as prefix for intentionally unused variables */
|
|
59
|
+
argsIgnorePattern: "^_",
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
|
|
63
|
+
/* allow overloading only if the parameters have different names */
|
|
64
|
+
"@typescript-eslint/unified-signatures": [
|
|
65
|
+
"error",
|
|
66
|
+
{
|
|
67
|
+
ignoreDifferentlyNamedParameters: true,
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
|
|
71
|
+
"tsdoc/syntax": "error",
|
|
72
|
+
},
|
|
73
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@forsakringskassan/eslint-config-typescript",
|
|
3
|
+
"version": "10.2.0",
|
|
4
|
+
"description": "Försäkringskassans eslint shareable typescript config",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"eslint"
|
|
7
|
+
],
|
|
8
|
+
"homepage": "https://github.com/Forsakringskassan/eslint-config",
|
|
9
|
+
"bugs": "https://github.com/Forsakringskassan/eslint-config/issues",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/Forsakringskassan/eslint-config.git",
|
|
13
|
+
"directory": "packages/eslint-config-typescript"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "Försäkringskassan",
|
|
17
|
+
"files": [
|
|
18
|
+
"index.js"
|
|
19
|
+
],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@typescript-eslint/eslint-plugin": "6.21.0",
|
|
22
|
+
"@typescript-eslint/parser": "7.0.2",
|
|
23
|
+
"eslint-plugin-tsdoc": "0.2.17"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"typescript": "^3 || ^4 || ^5"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">= 16.10"
|
|
30
|
+
},
|
|
31
|
+
"gitHead": "0cd554a08710a08521bac5d79fcce26f2bdd5886"
|
|
32
|
+
}
|