@eclipse-glsp/eslint-config 0.9.0-next.13e5422c → 0.9.0-next.cd85cefd
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/configs/errors.eslintrc.js +75 -81
- package/package.json +4 -11
|
@@ -1,107 +1,101 @@
|
|
|
1
|
+
const year = new Date().getFullYear();
|
|
1
2
|
module.exports = {
|
|
2
3
|
rules: {
|
|
3
4
|
// https://eslint.org/docs/rules/
|
|
4
5
|
// Possible Errors
|
|
5
|
-
|
|
6
|
+
'no-inner-declarations': 'off',
|
|
6
7
|
// Best Practices
|
|
7
|
-
curly:
|
|
8
|
-
|
|
9
|
-
eqeqeq: [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
curly: 'error',
|
|
9
|
+
'eol-last': 'error',
|
|
10
|
+
eqeqeq: ['error', 'smart'],
|
|
11
|
+
'guard-for-in': 'error',
|
|
12
|
+
'no-caller': 'error',
|
|
13
|
+
'no-eval': 'error',
|
|
14
|
+
'no-redeclare': [
|
|
15
|
+
'error',
|
|
15
16
|
{
|
|
16
|
-
builtinGlobals: false
|
|
17
|
-
}
|
|
17
|
+
builtinGlobals: false
|
|
18
|
+
}
|
|
18
19
|
],
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"../../index",
|
|
25
|
-
],
|
|
26
|
-
"no-sequences": "error",
|
|
27
|
-
"no-throw-literal": "error",
|
|
28
|
-
"no-unused-expressions": [
|
|
29
|
-
"error",
|
|
20
|
+
'no-restricted-imports': ['error', '..', '../index', '../..', '../../index'],
|
|
21
|
+
'no-sequences': 'error',
|
|
22
|
+
'no-throw-literal': 'error',
|
|
23
|
+
'no-unused-expressions': [
|
|
24
|
+
'error',
|
|
30
25
|
{
|
|
31
26
|
allowShortCircuit: true,
|
|
32
|
-
allowTernary: true
|
|
33
|
-
}
|
|
27
|
+
allowTernary: true
|
|
28
|
+
}
|
|
34
29
|
],
|
|
35
30
|
// Variables
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
'no-unused-vars': 'off', // typescript-eslint rule activated instead
|
|
32
|
+
'no-use-before-define': 'off', // typescript-eslint rule activated instead
|
|
38
33
|
// Stylistic Issues
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
'max-len': [
|
|
35
|
+
'error',
|
|
41
36
|
{
|
|
42
|
-
code: 180
|
|
43
|
-
}
|
|
37
|
+
code: 180
|
|
38
|
+
}
|
|
44
39
|
],
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
'no-multiple-empty-lines': [
|
|
41
|
+
'error',
|
|
47
42
|
{
|
|
48
|
-
max: 1
|
|
49
|
-
}
|
|
43
|
+
max: 1
|
|
44
|
+
}
|
|
50
45
|
],
|
|
51
|
-
|
|
52
|
-
quotes:
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
'no-underscore-dangle': 'off',
|
|
47
|
+
quotes: 'off', // typescript-eslint rule activated instead
|
|
48
|
+
'space-before-function-paren': [
|
|
49
|
+
'error',
|
|
55
50
|
{
|
|
56
|
-
anonymous:
|
|
57
|
-
named:
|
|
58
|
-
asyncArrow:
|
|
59
|
-
}
|
|
51
|
+
anonymous: 'always',
|
|
52
|
+
named: 'never',
|
|
53
|
+
asyncArrow: 'always'
|
|
54
|
+
}
|
|
60
55
|
],
|
|
61
|
-
|
|
56
|
+
'one-var': ['error', 'never'],
|
|
62
57
|
// ECMAScript6
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
58
|
+
'arrow-body-style': ['error', 'as-needed'],
|
|
59
|
+
'arrow-parens': ['error', 'as-needed'],
|
|
60
|
+
'no-var': 'error',
|
|
61
|
+
'prefer-const': [
|
|
62
|
+
'error',
|
|
68
63
|
{
|
|
69
|
-
destructuring:
|
|
70
|
-
}
|
|
64
|
+
destructuring: 'all'
|
|
65
|
+
}
|
|
71
66
|
],
|
|
72
67
|
// @typescript-eslint/eslint-plugin
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
68
|
+
'@typescript-eslint/class-name-casing': 'error',
|
|
69
|
+
'@typescript-eslint/consistent-type-definitions': 'error',
|
|
70
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
71
|
+
'@typescript-eslint/no-misused-new': 'error',
|
|
72
|
+
'@typescript-eslint/no-empty-interface': 'off',
|
|
73
|
+
'@typescript-eslint/interface-name-prefix': 'off',
|
|
74
|
+
'@typescript-eslint/no-namespace': 'off',
|
|
75
|
+
'@typescript-eslint/no-use-before-define': 'off',
|
|
76
|
+
'@typescript-eslint/no-unused-vars': [
|
|
77
|
+
'error',
|
|
83
78
|
{
|
|
84
|
-
args:
|
|
85
|
-
}
|
|
79
|
+
args: 'none'
|
|
80
|
+
}
|
|
86
81
|
],
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
'@typescript-eslint/quotes': [
|
|
83
|
+
'error',
|
|
84
|
+
'single',
|
|
90
85
|
{
|
|
91
|
-
avoidEscape: true
|
|
92
|
-
}
|
|
86
|
+
avoidEscape: true
|
|
87
|
+
}
|
|
93
88
|
],
|
|
94
|
-
|
|
89
|
+
'@typescript-eslint/semi': ['error', 'always'],
|
|
95
90
|
// eslint-plugin-header
|
|
96
|
-
|
|
91
|
+
'header/header': [
|
|
97
92
|
2,
|
|
98
|
-
|
|
93
|
+
'block',
|
|
99
94
|
[
|
|
100
95
|
{
|
|
101
|
-
pattern:
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
* Copyright (c) 2021 EclipseSource and others.
|
|
96
|
+
pattern: '[\n\r]+ \\* Copyright \\([cC]\\) \\d{4}(-\\d{4})? .*[\n\r]+',
|
|
97
|
+
template: `*******************************************************************************
|
|
98
|
+
* Copyright (c) ${year} EclipseSource and others.
|
|
105
99
|
*
|
|
106
100
|
* This program and the accompanying materials are made available under the
|
|
107
101
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -114,14 +108,14 @@ module.exports = {
|
|
|
114
108
|
* https://www.gnu.org/software/classpath/license.html.
|
|
115
109
|
*
|
|
116
110
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
]
|
|
111
|
+
*******************************************************************************`
|
|
112
|
+
}
|
|
113
|
+
]
|
|
120
114
|
],
|
|
121
115
|
// eslint-plugin-import
|
|
122
|
-
|
|
123
|
-
|
|
116
|
+
'import/export': 'off', // we have multiple exports due to namespaces, enums and classes that share the same name
|
|
117
|
+
'import/no-deprecated': 'error',
|
|
124
118
|
// eslint-plugin-no-null
|
|
125
|
-
|
|
126
|
-
}
|
|
119
|
+
'no-null/no-null': 'error'
|
|
120
|
+
}
|
|
127
121
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/eslint-config",
|
|
3
|
-
"version": "0.9.0-next.
|
|
3
|
+
"version": "0.9.0-next.cd85cefd",
|
|
4
4
|
"description": "Shared ESLint configuration for GLSP projects",
|
|
5
5
|
"license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",
|
|
6
6
|
"keywords": [
|
|
@@ -27,24 +27,17 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
+
"@eclipse-glsp/prettier-config": "0.9.0-next.cd85cefd",
|
|
30
31
|
"@typescript-eslint/eslint-plugin": "^2.16.0",
|
|
31
32
|
"@typescript-eslint/parser": "^2.16.0",
|
|
32
33
|
"eslint": "^6.8.0",
|
|
33
34
|
"eslint-config-prettier": "^8.3.0",
|
|
34
|
-
"eslint-plugin-header": "^3.
|
|
35
|
+
"eslint-plugin-header": "^3.1.1",
|
|
35
36
|
"eslint-plugin-import": "^2.20.0",
|
|
36
37
|
"eslint-plugin-no-null": "^1.0.2"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
40
|
"typescript": "^3.9.2"
|
|
40
41
|
},
|
|
41
|
-
"
|
|
42
|
-
"@typescript-eslint/eslint-plugin": ">=2.16.0",
|
|
43
|
-
"@typescript-eslint/parser": ">=2.16.0",
|
|
44
|
-
"eslint": ">=6.8.0",
|
|
45
|
-
"eslint-config-prettier": ">=8.3.0",
|
|
46
|
-
"eslint-plugin-header": ">=3.0.0",
|
|
47
|
-
"eslint-plugin-import": ">=2.20.0",
|
|
48
|
-
"eslint-plugin-no-null": ">=1.0.2"
|
|
49
|
-
}
|
|
42
|
+
"prettier": "@eclipse-glsp/prettier-config"
|
|
50
43
|
}
|