Skip to content

Commit

Permalink
docs, license, improve lint commands
Browse files Browse the repository at this point in the history
  • Loading branch information
tinahollygb committed Oct 7, 2022
1 parent 70bb716 commit 1cc0207
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2022 GrowthBook, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ yarn install

To develop the extension, open the code base in Visual Studio Code and hit F5. You can also open the Run/Debug tab (4th from the top) and press the Run button. Make sure you have "Extension" selected.

Additional documentation can be found in the [vsc-extension-quickstart.md](vsc-extension-quickstart.md) file.


### Tests

Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "growthbook",
"displayName": "growthbook",
"description": "TODO",
"description": "View your project's GrowthBook features right from Visual Studio Code",
"version": "0.0.1",
"license": "MIT",
"engines": {
"vscode": "^1.71.0"
},
Expand Down Expand Up @@ -35,7 +36,8 @@
"build": "yarn run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"lint": "eslint src --ext ts --fix --cache --cache-strategy content",
"lint:fix": "yarn lint --fix",
"lint": "eslint src --ext ts --cache --cache-strategy content",
"lint:ci": "yarn lint -- --max-warnings 0",
"coverage": "open coverage/index.html",
"test": "jest --config jest.config.js"
Expand Down
6 changes: 6 additions & 0 deletions src/utils/growthbook-utils/growthbook-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ type ConfigValidation = {
errors: string[];
};

/**
* Validates the provided config. If any of the required keys are missing, it will not be valid and will return a list of errors.
* Configs are loaded from the file system and are JSON parsed, so it is possible at runtime the config will not be valid.
* @param config
* @returns
*/
export const validateConfig = (config: GrowthBookConfig): ConfigValidation => {
const requiredConfig: (keyof GrowthBookConfig)[] = [
"appHost",
Expand Down

0 comments on commit 1cc0207

Please sign in to comment.