Skip to content

Commit

Permalink
fix(practs): upgrade to latest best practices per declapract-typescri…
Browse files Browse the repository at this point in the history
…pt-ehmpathy
  • Loading branch information
uladkasach committed Feb 12, 2023
1 parent f756834 commit be703c1
Show file tree
Hide file tree
Showing 60 changed files with 22,530 additions and 15,226 deletions.
10 changes: 10 additions & 0 deletions .depcheckrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ignores:
- depcheck
- declapract
- declapract-typescript-ehmpathy
- '@commitlint/config-conventional'
- '@trivago/prettier-plugin-sort-imports'
- '@tsconfig/node-lts-strictest'
- core-js
- ts-jest
- husky
46 changes: 46 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:import/recommended', // specifies good import rules
'airbnb-typescript/base', // uses the airbnb recommended rules
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parserOptions: {
project: './tsconfig.json',
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
rules: {
'@typescript-eslint/explicit-function-return-type': 'off', // this can be figured out implicitly, and that is better
'sort-imports': 'off',
'import/prefer-default-export': 'off', // default export = bad
'import/no-default-export': 'error', // require named exports - they make it easier to refactor, enforce consistency, and increase constraints
'@typescript-eslint/no-non-null-assertion': 'off', // we use these to help typescript out when we know something it doesnt, and cant easily express that
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'**/*.test.ts',
'**/*.test.integration.ts',
'**/*.test.acceptance.ts',
'acceptance/**/*.ts',
'**/__test_utils__/**/*.ts',
'provision/**/*.ts',
],
},
],
'@typescript-eslint/no-explicit-any': 'off', // sometimes this is a valid definition
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'import/no-cycle': 'off',
'max-classes-per-file': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-floating-promises': 'error',
'prefer-destructuring': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'lines-between-class-members': 'off',
'@typescript-eslint/lines-between-class-members': 'off',
'no-return-await': 'off', // this does not help anything and actually leads to bugs if we subsequently wrap the return in a try catch without remembering to _then_ add await
'@typescript-eslint/return-await': 'off',
},
};
108 changes: 0 additions & 108 deletions .github/workflows/ci_on_commit.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/pr-release-on-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: pr-release-on-main

on:
push:
branches:
- main

jobs:
release-please:
runs-on: ubuntu-20.04
steps:
- uses: google-github-actions/release-please-action@v3
with:
token: ${{ secrets.RELEASE_PLEASE_GITHUB_TOKEN }}
release-type: node
pull-request-title-pattern: 'chore(release): v${version} 🎉'
changelog-path: changelog.md
39 changes: 39 additions & 0 deletions .github/workflows/publish-on-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: deploy_on_tag

on:
push:
tags:
- v*

jobs:
test_and_deploy:
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # we need all commits to test:commits

- name: read nvmrc
id: nvmrc
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)

- name: setup node
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
cache: 'npm'

- name: install
run: npm ci

- name: tests
run: npm run test
env:
FORCE_COLOR: true # ensure colors are saved in jest snapshots, to be consistent with local development

- name: publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
32 changes: 0 additions & 32 deletions .github/workflows/publish_on_tag.yml

This file was deleted.

Loading

0 comments on commit be703c1

Please sign in to comment.