Skip to content

Commit

Permalink
feat: init
Browse files Browse the repository at this point in the history
  • Loading branch information
arcticShadow committed Dec 8, 2022
0 parents commit c9c4cd3
Show file tree
Hide file tree
Showing 15 changed files with 5,916 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "./src/node"
}
14 changes: 14 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This is a comment.
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.


# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies JS files, only @js-owner and not the global
# owner(s) will be requested for a review.

38 changes: 38 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Pull Request
on:
pull_request:
branches:
- master

jobs:
markdown-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
- run: npx markdownlint-cli2 "**/*.{md,markdown}"

commit-lint:
name: conventional-commits-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: check-for-conventional-commits
id: check-for-cc
uses: agenthunt/conventional-commit-checker-action@v1.0.0
with:
pr-body-regex: (.*\n)?(.*)

code-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
- run: npm i
- run: npm run lint


20 changes: 20 additions & 0 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Release & Publish
on:
push:
branches:
- master

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://npm.pkg.github.com'
- run: npm ci
- run: npx semantic-release
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
8 changes: 8 additions & 0 deletions .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"ignores": [
".github/CODEOWNERS"
],
"config": {
"MD013": false
}
}
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"davidanson.vscode-markdownlint",
"streetsidesoftware.code-spell-checker",
"dbaeumer.vscode-eslint"
]
}
29 changes: 29 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"[markdown]": {
"editor.formatOnPaste": true,
"editor.codeActionsOnSave": {
"source.fixAll.markdownlint": true
}
},

"[typescript][javascript][typescriptreact][javascriptreact]": {
"editor.formatOnSave": false,
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
},
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.detectIndentation": false,
"cSpell.words": [
"agenthunt",
"Atlassian",
"devs",
"Giflow",
"iaac",
"MADR",
"markdownlint",
"npm",
"sonarjs"
]
}
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# arcticShadows ESLint Config

[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
![example workflow](https://github.com/arcticshadow/eslint-config/actions/workflows/release-publish.yml/badge.svg)

## Contributing

If you would like to contribute to this base config - please open a PR.

This project uses semantic-release to orchestrate Release time activities. Its all managed autonomously when code is merged to master

## Using

### Install

```sh
npm i -D @arcticshadow/eslint-config
```

n.b. Install not working? You may need to auth your npm to github (instructions to come)

You will need to ensure that you install the peer dependencies. If you install with npm>=7 this should be taken care of for you.

A Note on Peer Dependencies - The version requirements of dependencies are intentionally left open - but you should ensure that the following conditions are met in your project:

* It is important that you use the same version number for @typescript-eslint/parser and @typescript-eslint/eslint-plugin.

Then add it to your config file

```json
//.eslintrc
{
"extends": "@arcticshadow",

// Or - for a browser project
"extends": "arcticshadow/eslint-config/src/browser",

// Or - for a backend/node project
"extends": "@arcticshadow/eslint-config/src/node"

// Or - for a react native project
"extends": "@arcticshadow/eslint-config/src/react-native"
}
```

To enable all rules of this plugin, use @typescript-eslint/parser as a parser for ESLint (this is correctly set for you out of the box) and set the [parserOptions.project](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser#parseroptionsproject) option. Thanks to it, type information is available, which is beneficial or even essential for some rules.

### Optional for VSCode

1. Install the `eslint` extension from Microsoft
2. Add the eslint package to your `.vscode/extensions.json` file so other devs get suggested it automatically.
3. Update your workspace settings `.vscode/settings.json` to include the following

```jsonc
{
// Disable any formatters provided by vscode extensions for ts/js files
// This is a brute-force approach as we don't know what extensions you have, or how they may conflict.
"[typescript][javascript][typescriptreact][javascriptreact]": {
"editor.formatOnSave": false,
},
"editor.codeActionsOnSave": {
// Tell the Eslint plugin to 'fix' all on save. This eslint config provides a prettier plugin - so
// ts/js formatting is taken care of.
"source.fixAll.eslint": true,
},
// The following are setting defaults that align to how prettier formats the code. These settings are
// used in various ways by vscode.
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.detectIndentation": false,
}
```
Loading

0 comments on commit c9c4cd3

Please sign in to comment.