Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.
/ reinv-js-config Public archive

Shared Javascript Configuration in Reinventary

Notifications You must be signed in to change notification settings

bitgaming/reinv-js-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shared Javascript Configuration

Configuration files including:

How to use

  1. Add this package inside package.json

    {
        "devDependencies": {
            "@bitgaming/reinv-js-config": "git+https://github.com/bitgaming/reinv-js-config.git#semver:^1.5.0",
        }
    }

    semver is the same as git tag of this repo

  2. Make sure you have resolve all the peerDependencies, you can check the warning messages once you have npm/yarn install

  3. Extend local config files in your repo

    Example .eslintrc.js

    Replace {category} with the folder of project category

    module.exports = require('@bitgaming/reinv-js-config/{category}/eslintrc')(
        {
            "parserOptions": {
                "ecmaVersion": 6,
            },
            "rules": {
                '@typescript-eslint/no-explicit-any': 'off',
            },
        }
    )

    Example tsconfig.json

    Replace {category} with the folder of project category

    {
        "extends": "@bitgaming/reinv-js-config/{category}/.tsconfig",
        "exclude": [
            "cdk.out"
        ]
    }
  4. (Optional for prettier) In order to auto-format with eslint-prettier, add the following config inside your VSCode preference (JSON):

    {
        "[typescript]": {
            "editor.formatOnSave": false,
            "editor.codeActionsOnSave": {
                // For ESLint
                "source.fixAll.eslint": true
            },
        },
        ...
    }

    This will override the default formatter from VSCode, please make sure you already setup eslint prettier in the project. Application config with prettier:

    • /serverless/prettier
    • /cdk

Contribute

Test

This repo itself uses eslint as well. Run yarn test to test the linting.

Before commit to this repo

Make sure git tag is consistent with version in package.json