Skip to content

Commit 29a13ef

Browse files
author
Joran De Braekeleer
committed
Merge remote-tracking branch 'upstream/dspace-8_x' into w2p-131442_backport-4335-to-dspace-8_x
2 parents c58b398 + 46394d4 commit 29a13ef

3,558 files changed

Lines changed: 191790 additions & 76876 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.json

Lines changed: 90 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@
88
"eslint-plugin-deprecation",
99
"unused-imports",
1010
"eslint-plugin-lodash",
11-
"eslint-plugin-jsonc"
11+
"eslint-plugin-jsonc",
12+
"eslint-plugin-rxjs",
13+
"eslint-plugin-simple-import-sort",
14+
"eslint-plugin-import-newlines",
15+
"dspace-angular-ts",
16+
"dspace-angular-html"
17+
],
18+
"ignorePatterns": [
19+
"lint/test/fixture"
1220
],
1321
"overrides": [
1422
{
@@ -18,7 +26,8 @@
1826
"parserOptions": {
1927
"project": [
2028
"./tsconfig.json",
21-
"./cypress/tsconfig.json"
29+
"./cypress/tsconfig.json",
30+
"./lint/tsconfig.json"
2231
],
2332
"createDefaultProgram": true
2433
},
@@ -27,17 +36,32 @@
2736
"plugin:@typescript-eslint/recommended",
2837
"plugin:@typescript-eslint/recommended-requiring-type-checking",
2938
"plugin:@angular-eslint/recommended",
30-
"plugin:@angular-eslint/template/process-inline-templates"
39+
"plugin:@angular-eslint/template/process-inline-templates",
40+
"plugin:rxjs/recommended"
3141
],
3242
"rules": {
43+
"indent": [
44+
"error",
45+
2,
46+
{
47+
"SwitchCase": 1,
48+
"ignoredNodes": [
49+
"ClassBody.body > PropertyDefinition[decorators.length > 0] > .key"
50+
]
51+
}
52+
],
3353
"max-classes-per-file": [
3454
"error",
3555
1
3656
],
3757
"comma-dangle": [
38-
"off",
58+
"error",
3959
"always-multiline"
4060
],
61+
"object-curly-spacing": [
62+
"error",
63+
"always"
64+
],
4165
"eol-last": [
4266
"error",
4367
"always"
@@ -104,15 +128,13 @@
104128
"allowTernary": true
105129
}
106130
],
107-
"prefer-const": "off", // todo: re-enable & fix errors (more strict than it used to be in TSLint)
131+
"prefer-const": "error",
132+
"no-case-declarations": "error",
133+
"no-extra-boolean-cast": "error",
108134
"prefer-spread": "off",
109135
"no-underscore-dangle": "off",
110-
111-
// todo: disabled rules from eslint:recommended, consider re-enabling & fixing
112136
"no-prototype-builtins": "off",
113137
"no-useless-escape": "off",
114-
"no-case-declarations": "off",
115-
"no-extra-boolean-cast": "off",
116138

117139
"@angular-eslint/directive-selector": [
118140
"error",
@@ -139,10 +161,10 @@
139161
}
140162
],
141163
"@angular-eslint/no-attribute-decorator": "error",
142-
"@angular-eslint/no-forward-ref": "error",
143164
"@angular-eslint/no-output-native": "warn",
144165
"@angular-eslint/no-output-on-prefix": "warn",
145166
"@angular-eslint/no-conflicting-lifecycle": "warn",
167+
"@angular-eslint/use-lifecycle-interface": "error",
146168

147169
"@typescript-eslint/no-inferrable-types":[
148170
"error",
@@ -183,7 +205,7 @@
183205
],
184206
"@typescript-eslint/type-annotation-spacing": "error",
185207
"@typescript-eslint/unified-signatures": "error",
186-
"@typescript-eslint/ban-types": "warn", // todo: deal with {} type issues & re-enable
208+
"@typescript-eslint/ban-types": "error",
187209
"@typescript-eslint/no-floating-promises": "warn",
188210
"@typescript-eslint/no-misused-promises": "warn",
189211
"@typescript-eslint/restrict-plus-operands": "warn",
@@ -200,17 +222,65 @@
200222
"@typescript-eslint/no-unsafe-return": "off",
201223
"@typescript-eslint/restrict-template-expressions": "off",
202224
"@typescript-eslint/require-await": "off",
225+
"@typescript-eslint/no-base-to-string": [
226+
"error",
227+
{
228+
"ignoredTypeNames": [
229+
"ResourceType",
230+
"Error"
231+
]
232+
}
233+
],
203234

204235
"deprecation/deprecation": "warn",
205236

237+
"simple-import-sort/imports": "error",
238+
"simple-import-sort/exports": "error",
206239
"import/order": "off",
240+
"import/first": "error",
241+
"import/newline-after-import": "error",
242+
"import/no-duplicates": "error",
207243
"import/no-deprecated": "warn",
208244
"import/no-namespace": "error",
245+
"import-newlines/enforce": [
246+
"error",
247+
{
248+
"items": 1,
249+
"semi": true,
250+
"forceSingleLine": true
251+
}
252+
],
253+
209254
"unused-imports/no-unused-imports": "error",
210255
"lodash/import-scope": [
211256
"error",
212257
"method"
213-
]
258+
],
259+
260+
"rxjs/no-nested-subscribe": "off", // todo: go over _all_ cases
261+
262+
// Custom DSpace Angular rules
263+
"dspace-angular-ts/themed-component-classes": "error",
264+
"dspace-angular-ts/themed-component-selectors": "error",
265+
"dspace-angular-ts/themed-component-usages": "error"
266+
}
267+
},
268+
{
269+
"files": [
270+
"*.spec.ts"
271+
],
272+
"parserOptions": {
273+
"project": [
274+
"./tsconfig.json",
275+
"./cypress/tsconfig.json"
276+
],
277+
"createDefaultProgram": true
278+
},
279+
"rules": {
280+
"prefer-const": "off",
281+
282+
// Custom DSpace Angular rules
283+
"dspace-angular-ts/themed-component-usages": "error"
214284
}
215285
},
216286
{
@@ -221,20 +291,23 @@
221291
"plugin:@angular-eslint/template/recommended"
222292
],
223293
"rules": {
224-
// todo: re-enable & fix errors
225-
"@angular-eslint/template/no-negated-async": "off",
226-
"@angular-eslint/template/eqeqeq": "off"
294+
// Custom DSpace Angular rules
295+
"dspace-angular-html/themed-component-usages": "error",
296+
"dspace-angular-html/no-disabled-attribute-on-button": "error"
227297
}
228298
},
229299
{
230300
"files": [
231301
"*.json5"
232302
],
233303
"extends": [
234-
"plugin:jsonc/recommended-with-jsonc"
304+
"plugin:jsonc/recommended-with-json5"
235305
],
236306
"rules": {
237-
"no-irregular-whitespace": "error",
307+
// The ESLint core no-irregular-whitespace rule doesn't work well in JSON
308+
// See: https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-irregular-whitespace.html
309+
"no-irregular-whitespace": "off",
310+
"jsonc/no-irregular-whitespace": "error",
238311
"no-trailing-spaces": "error",
239312
"jsonc/comma-dangle": [
240313
"error",

.gitattributes

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@
1313
*.css eol=lf
1414
*.scss eol=lf
1515
*.html eol=lf
16-
*.svg eol=lf
16+
*.svg eol=lf
17+
18+
# Generated documentation should have LF line endings to reduce git noise
19+
docs/lint/**/*.md eol=lf

.github/disabled-workflows/pull_request_opened.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)