Skip to content

Commit

Permalink
feat: First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
simenandre committed Aug 29, 2021
1 parent fe033de commit 4a7580c
Show file tree
Hide file tree
Showing 6 changed files with 2,239 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL"

on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: '0 12 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['javascript']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
34 changes: 34 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release
on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v2
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node

- if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v2

- if: ${{ steps.release.outputs.release_created }}
name: Use Node.js 14.x
uses: actions/setup-node@v2
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'

- if: ${{ steps.release.outputs.release_created }}
run: yarn install

- if: ${{ steps.release.outputs.release_created }}
run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"trailingComma": "all",
"htmlWhitespaceSensitivity": "ignore",
"proseWrap": "always",
"arrowParens": "avoid"
}
98 changes: 98 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/**
* This eslint config is derived work from @runeh and Indiv AS:
* https://github.com/runeh/typical-fetch/blob/main/.eslintrc.json
*/

module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:eslint-comments/recommended',
'plugin:promise/recommended',
'plugin:jest/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'jest', 'import', 'unicorn'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'warn',
'@typescript-eslint/member-ordering': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-expressions': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
caughtErrors: 'all',
},
],
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/prefer-ts-expect-error': 'error',
eqeqeq: ['error', 'smart'],
'eslint-comments/no-unused-disable': 'error',
'import/no-default-export': 'error',
'import/no-duplicates': 'error',
'import/no-extraneous-dependencies': 'error',
'import/no-unassigned-import': 'error',
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
},
'newlines-between': 'never',
},
],
'no-console': 'error',
'no-restricted-globals': [
'error',
'event',
'isNaN',
'location',
'name',
'parseInt',
],
'no-return-await': 'error',
'prefer-arrow-callback': 'error',
quotes: [
'error',
'single',
{
avoidEscape: true,
allowTemplateLiterals: false,
},
],
'sort-imports': [
'error',
{
ignoreDeclarationSort: true,
},
],
'spaced-comment': [
'error',
'always',
{
exceptions: ['-', '=', '#__PURE__'],
markers: ['/'],
},
],
'unicorn/filename-case': [
'error',
{
case: 'kebabCase',
},
],
},
overrides: [
{
files: ['**/*.test.ts'],
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
},
],
};
33 changes: 33 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "@bjerk/eslint-config",
"version": "1.0.0",
"repository": "github.com:bjerkio/eslint-config",
"author": "Bjerk AS",
"license": "Apache-2.0",
"publishConfig": {
"access": "public"
},
"engines": {
"node": ">=14.15"
},
"main": "index.js",
"dependencies": {
"@typescript-eslint/eslint-plugin": "^4.28.2",
"@typescript-eslint/parser": "^4.28.2",
"eslint": "^7.30.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jest": "^24.3.6",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-unicorn": "^34.0.1"
},
"devDependencies": {
"prettier": "^2.3.2"
},
"volta": {
"node": "14.15.0",
"yarn": "1.22.10"
}
}
Loading

0 comments on commit 4a7580c

Please sign in to comment.