Skip to content
This repository was archived by the owner on Aug 26, 2023. It is now read-only.

Commit e8bd877

Browse files
authored
Several improvements (#48)
- Adding our usual editor config - Adding linting for test files - Adding prettier (and appliying it) - Adding prettier to eslint - Removing the license information from the PR template file (it's annoying to have this in github when opening a PR) - Adjusting the workflow files to other projects - Adding Jetbrains Copyright configuration - Pinning dev dependencies - Adding yarn berry - Adding a yarn.lock so renovate can work Signed-off-by: Tilman Vatteroth <[email protected]>
1 parent e0c2a8c commit e8bd877

38 files changed

+6011
-3000
lines changed

.editorconfig

Lines changed: 470 additions & 0 deletions
Large diffs are not rendered by default.

.eslintrc.js

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

.eslintrc.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
3+
*
4+
* SPDX-License-Identifier: AGPL-3.0-only
5+
*/
6+
{
7+
"parser": "@typescript-eslint/parser",
8+
"parserOptions": {
9+
"project": [
10+
"./tsconfig.json"
11+
]
12+
},
13+
"plugins": [
14+
"@typescript-eslint",
15+
"jest",
16+
"prettier"
17+
],
18+
"env": {
19+
"jest": true,
20+
"jest/globals": true
21+
},
22+
"extends": [
23+
"eslint:recommended",
24+
"plugin:@typescript-eslint/eslint-recommended",
25+
"plugin:@typescript-eslint/recommended",
26+
"prettier"
27+
],
28+
"rules": {
29+
"prettier/prettier": "error",
30+
"jest/no-disabled-tests": "warn",
31+
"jest/no-focused-tests": "error",
32+
"jest/no-identical-title": "error",
33+
"jest/prefer-to-have-length": "warn",
34+
"jest/valid-expect": "error"
35+
}
36+
}

.github/pull_request_template.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
<!--
2-
SPDX-FileCopyrightText: 2020 The HedgeDoc developers (see AUTHORS file)
3-
4-
SPDX-License-Identifier: CC-BY-SA-4.0
5-
-->
6-
71
### Description
82
This PR fixes/adds/improves/...
93

.github/workflows/lint.yml

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
1+
# SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
22
#
33
# SPDX-License-Identifier: AGPL-3.0-only
44

5-
name: lint
5+
name: Lint and check code style
66

77
on:
88
push:
9-
branches: [main]
9+
branches: [ main ]
1010
pull_request:
11-
branches: [main]
11+
branches: [ main ]
1212

1313
jobs:
1414
lint:
@@ -20,50 +20,24 @@ jobs:
2020

2121
- name: Get yarn cache directory path
2222
id: yarn-cache-dir-path
23-
run: echo "::set-output name=dir::$(yarn cache dir)"
23+
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
2424

25-
- name: Cache node_modules
26-
uses: actions/cache@v3
25+
- name: Cache yarn cache
26+
uses: actions/cache@v3.0.4
2727
id: yarn-cache
2828
with:
2929
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
30-
key: ${{ runner.os }}-16-yarn-${{ hashFiles('**/yarn.lock') }}
30+
key: ${{ runner.os }}-18-yarn-${{ hashFiles('**/yarn.lock') }}
3131
restore-keys: |
32-
${{ runner.os }}-yarn-
32+
${{ runner.os }}-yarn-18
3333
3434
- name: Set up NodeJS
3535
uses: actions/setup-node@v3
3636
with:
37-
node-version: 16
38-
- name: Install dependencies
39-
run: yarn install --frozen-lockfile --prefer-offline
40-
- name: Lint code
41-
run: yarn lint
42-
format:
43-
runs-on: ubuntu-latest
44-
name: Checks codestyle of all .ts and .tsx files
45-
steps:
46-
- name: Checkout repository
47-
uses: actions/checkout@v3
48-
49-
- name: Get yarn cache directory path
50-
id: yarn-cache-dir-path
51-
run: echo "::set-output name=dir::$(yarn cache dir)"
37+
node-version: 18
5238

53-
- name: Cache node_modules
54-
uses: actions/cache@v3
55-
id: yarn-cache
56-
with:
57-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
58-
key: ${{ runner.os }}-16-yarn-${{ hashFiles('**/yarn.lock') }}
59-
restore-keys: |
60-
${{ runner.os }}-yarn-
61-
62-
- name: Set up NodeJS
63-
uses: actions/setup-node@v3
64-
with:
65-
node-version: 16
6639
- name: Install dependencies
67-
run: yarn install --frozen-lockfile --prefer-offline
40+
run: yarn install --immutable
41+
6842
- name: Lint code
69-
run: yarn format
43+
run: yarn lint

.github/workflows/reuse.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
# SPDX-FileCopyrightText: 2020 The HedgeDoc developers (see AUTHORS file)
1+
# SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
22
#
33
# SPDX-License-Identifier: AGPL-3.0-only
44

55
name: REUSE Compliance Check
66

7-
on: [push, pull_request]
7+
on:
8+
push:
9+
branches: [main]
10+
pull_request:
11+
branches: [main]
812

913
jobs:
1014
reuse:

.github/workflows/main.yml renamed to .github/workflows/test.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,30 @@ jobs:
1818
steps:
1919
- name: Checkout repository
2020
uses: actions/checkout@v3
21+
2122
- name: Get yarn cache directory path
2223
id: yarn-cache-dir-path
2324
run: echo "::set-output name=dir::$(yarn cache dir)"
24-
- name: Cache node_modules
25+
26+
- name: Cache yarn cache
2527
uses: actions/cache@v3
2628
id: yarn-cache
2729
with:
2830
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
29-
key: ${{ runner.os }}-16-yarn-${{ hashFiles('**/yarn.lock') }}
31+
key: ${{ runner.os }}-18-yarn-${{ hashFiles('**/yarn.lock') }}
3032
restore-keys: |
31-
${{ runner.os }}-yarn-
33+
${{ runner.os }}-yarn-18
34+
3235
- name: Set up NodeJS
3336
uses: actions/setup-node@v3
3437
with:
35-
node-version: 16
38+
node-version: 18
39+
3640
- name: Install dependencies
37-
run: yarn install --frozen-lockfile --prefer-offline
41+
run: yarn install --immutable
42+
3843
- name: Build project
3944
run: yarn build
40-
- name: Test project
45+
46+
- name: Test Project
4147
run: yarn test

.gitignore

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
1-
# SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
1+
# SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
22
#
33
# SPDX-License-Identifier: CC0-1.0
44

5-
npm-debug.log
6-
.idea
7-
node_modules
85
dist/
96
coverage/
10-
lib/
7+
lib/
8+
9+
# dependencies
10+
/node_modules
11+
/.pnp
12+
.pnp.*
13+
14+
# package manager
15+
.yarn/*
16+
!.yarn/patches
17+
!.yarn/plugins
18+
!.yarn/releases
19+
!.yarn/sdks
20+
!.yarn/versions
21+
22+
# IDE
23+
.idea
24+
!.idea/copyright

.idea/copyright/hedgedoc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copyright/profiles_settings.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.npmignore.license

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
1+
SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
22

3-
SPDX-License-Identifier: CC0-1.0
3+
SPDX-License-Identifier: CC0-1.0

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

.prettierignore.license

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
2+
3+
SPDX-License-Identifier: CC0-1.0
4+

.prettierrc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"parser": "typescript",
3+
"singleQuote": true,
4+
"jsxSingleQuote": true,
5+
"semi": false,
6+
"tabWidth": 2,
7+
"trailingComma": "none",
8+
"bracketSpacing": true,
9+
"bracketSameLine": true,
10+
"arrowParens": "always"
11+
}

.prettierrc.json.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
2+
3+
SPDX-License-Identifier: CC0-1.0

.reuse/dep5

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,14 @@ Upstream-Name: html-to-react
33
Upstream-Contact: The HedgeDoc developers <[email protected]>
44
Source: https://github.com/hedgedoc/html-to-react
55

6+
Files: .github/pull_request_template.md
7+
Copyright: 2022 The HedgeDoc developers (see AUTHORS file)
8+
License: CC-BY-SA-4.0
9+
10+
Files: .yarn/**
11+
Copyright: Yarn contributors
12+
License: LicenseRef-yarn
13+
14+
Files: .idea/**
15+
Copyright: 2022 The HedgeDoc developers (see AUTHORS file)
16+
License: CC0-1.0

.yarn/releases/yarn-3.2.1.cjs

Lines changed: 786 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
yarnPath: .yarn/releases/yarn-3.2.1.cjs
2+
nodeLinker: node-modules
3+

.yarnrc.yml.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
2+
3+
SPDX-License-Identifier: CC0-1.0

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
2+
SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
33
44
SPDX-License-Identifier: CC-BY-SA-4.0
55
-->

LICENSES/LicenseRef-yarn.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
BSD 2-Clause License
2+
3+
For Yarn software
4+
5+
Copyright (c) 2016-present, Yarn Contributors. All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice, this
11+
list of conditions and the following disclaimer.
12+
13+
* Redistributions in binary form must reproduce the above copyright notice,
14+
this list of conditions and the following disclaimer in the documentation
15+
and/or other materials provided with the distribution.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
21+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
2+
SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
33
44
SPDX-License-Identifier: CC-BY-SA-4.0
55
-->

jest.config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"transform": {
3+
".(ts|tsx)": "ts-jest"
4+
},
5+
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx)$",
6+
"testPathIgnorePatterns": [
7+
"/dist/"
8+
],
9+
"moduleFileExtensions": [
10+
"ts",
11+
"tsx",
12+
"js"
13+
]
14+
}

jest.config.json.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
2+
3+
SPDX-License-Identifier: CC0-1.0

0 commit comments

Comments
 (0)