Skip to content

Commit

Permalink
Merge pull request #2 from technologiestiftung/first-draft
Browse files Browse the repository at this point in the history
chore(init): Setup first draft for testing
  • Loading branch information
ff6347 authored Mar 2, 2024
2 parents f0adee3 + 00a4f6d commit 3403e95
Show file tree
Hide file tree
Showing 22 changed files with 11,656 additions and 110 deletions.
25 changes: 11 additions & 14 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
{
"projectName": "template-default",
"projectOwner": "technologiestiftung",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 64,
"commit": true,
"commitConvention": "angular",
"contributors": [
],
"contributorsPerLine": 7,
"skipCi": true
"projectName": "template-default",
"projectOwner": "technologiestiftung",
"repoType": "github",
"repoHost": "https://github.com",
"files": ["README.md"],
"imageSize": 64,
"commit": true,
"commitConvention": "angular",
"contributors": [],
"contributorsPerLine": 7,
"skipCi": true
}
24 changes: 13 additions & 11 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
9 changes: 3 additions & 6 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
---
name: Custom issue template
about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---


7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
4 changes: 2 additions & 2 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>technologiestiftung/renovate-config"]
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>technologiestiftung/renovate-config"]
}
17 changes: 0 additions & 17 deletions .github/workflows/say.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests
name: Node.js CI
permissions:
contents: write
packages: write
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
env:
CI: true
ESLINT_USE_FLAT_CONFIG: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- run: npm ci
- run: npm run build --if-present
- run: npm run test --if-present
release:
name: semantic-release
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- run: |
npm ci
npx semantic-release --ci
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,4 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.envrc
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.11.1
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test/*
53 changes: 31 additions & 22 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
{
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#185ded",
"activityBar.activeBorder": "#76092d",
"activityBar.background": "#185ded",
"activityBar.foreground": "#e7e7e7",
"activityBar.inactiveForeground": "#e7e7e799",
"activityBarBadge.background": "#76092d",
"activityBarBadge.foreground": "#e7e7e7",
"sash.hoverBorder": "#185ded",
"statusBar.background": "#0f49c3",
"statusBar.foreground": "#e7e7e7",
"statusBarItem.hoverBackground": "#185ded",
"statusBarItem.remoteBackground": "#0f49c3",
"statusBarItem.remoteForeground": "#e7e7e7",
"titleBar.activeBackground": "#0f49c3",
"titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveBackground": "#0f49c399",
"titleBar.inactiveForeground": "#e7e7e799",
"commandCenter.border": "#e7e7e799"
},
"peacock.color": "#0f49c3"
}
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#185ded",
"activityBar.activeBorder": "#76092d",
"activityBar.background": "#185ded",
"activityBar.foreground": "#e7e7e7",
"activityBar.inactiveForeground": "#e7e7e799",
"activityBarBadge.background": "#76092d",
"activityBarBadge.foreground": "#e7e7e7",
"sash.hoverBorder": "#185ded",
"statusBar.background": "#0f49c3",
"statusBar.foreground": "#e7e7e7",
"statusBarItem.hoverBackground": "#185ded",
"statusBarItem.remoteBackground": "#0f49c3",
"statusBarItem.remoteForeground": "#e7e7e7",
"titleBar.activeBackground": "#0f49c3",
"titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveBackground": "#0f49c399",
"titleBar.inactiveForeground": "#e7e7e799",
"commandCenter.border": "#e7e7e799",
"editorGroup.border": "#185ded",
"panel.border": "#185ded",
"sideBar.border": "#185ded",
"statusBar.border": "#0f49c3",
"statusBar.debuggingBackground": "#c3890f",
"statusBar.debuggingBorder": "#c3890f",
"statusBar.debuggingForeground": "#15202b",
"tab.activeBorder": "#185ded",
"titleBar.border": "#0f49c3"
},
"peacock.color": "#0f49c3"
}
63 changes: 29 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,47 @@

<!-- ALL-CONTRIBUTORS-BADGE:END -->

# {repo-template}

## TODO (after you generated the repo)

- [ ] Review the content of the README.md and adjust to your liking
- [ ] Read the README.md till the end and adjust the content licensing,
logos, etc (I know you stopped at tbd...)
- [ ] Adjust the file [.github/CODEOWNERS](./.github/CODEOWNERS)
- [ ] Adjust the files under [.github/ISSUE_TEMPLATE](./.github/ISSUE_TEMPLATE)
- [ ] If you use staging and main branches use this template for [.github/renovate.json](./.github/renovate.json)

```json
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>technologiestiftung/renovate-config"],
"baseBranches": ["staging"]
}
```

- [ ] Do you want to honor all kinds of contributions? Use [all-contributors](https://allcontributors.org/)
# Sharable eslint config for @technologiestiftung

```bash
npx all-contributors-cli check
npx all-contributors-cli add ff6347 doc
```
This is a sharable eslint config for the @technologiestiftung organization. Still WIP
The idea here is to start out with a flat config but still be backwards compatible with the old config. So our team does not have to set the env variable `ESLINT_USE_FLAT_CONFIG=true` but can just reference this config as extend in the old config style.

You can use it on GitHub just by commenting on PRs and issues:
The rules we apply should also be only for coding style not formatting. We should use prettier for that.

```plain
@all-contributors please add @ff6347 for infrastructure, tests and code
```
## TODO

- [ ] Add your project description
- [ ] Get fancy shields at https://shields.io
- [ ] Figure out how we can leverage the flat config already and be backwards compatible
- [ ] Add relevant rules
- [x] Figure out how we can use this for javascript and typescript projects
- [ ] Add tests

## Prerequisites

tbd...
- Node.js
- eslint

## Installation

tbd...
npm install @technologiestiftung/eslint-config --save-dev

## Usage or Deployment
## Usage

tbd...
In your `eslint.config.js` file, add the following:

```javascript
import technologiestiftung from "@technologiestiftung/eslint-config";

export default {
...technologiestiftung,
rules: {
// your rules here
},
};
```

```
ESLINT_USE_FLAT_CONFIG=true npx eslint
```

## Development

Expand Down
3 changes: 3 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// https://eslint.org/blog/2022/08/new-config-system-part-2/
import technologiestiftung from "./index.js";
export default [...technologiestiftung];
45 changes: 45 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// @ts-check

import eslint from "@eslint/js";
import tseslint from "typescript-eslint";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.strict,
{
rules: {
"prefer-const": "error",
curly: "error",
"no-console": "error",
"no-undef": "error",
"no-var": "error",
//FIXME: default case not working?
"default-case": ["error"],
"arrow-parens": "error",
"consistent-return": "error",
"default-param-last": ["error"],
eqeqeq: "error",
"func-style": ["error", "declaration", { allowArrowFunctions: true }],
"max-depth": ["error", 4],
"max-lines": ["error", 150],
"max-params": ["error", 3],
complexity: ["error", 3],
"new-cap": ["error", { newIsCap: true }],
"no-else-return": "error",
"no-eval": "error",
"no-implicit-globals": "error",
"no-lonely-if": "error",
"no-loop-func": "error",
"no-multi-assign": "error",
"no-multi-str": "error",
"no-nested-ternary": "error",
"no-new": "error",
"no-param-reassign": "error",
"no-return-assign": "error",
"no-shadow": "error",
"no-throw-literal": "error",
"no-unneeded-ternary": "error",
},
},
);
Loading

0 comments on commit 3403e95

Please sign in to comment.