Skip to content

Commit

Permalink
GH action and lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Benni-Math committed Sep 13, 2024
1 parent ee9b02b commit 3242d82
Show file tree
Hide file tree
Showing 126 changed files with 2,654 additions and 3,384 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

133 changes: 95 additions & 38 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,33 @@
},
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts"]
"@typescript-eslint/parser": [
".ts"
]
},
"import/resolver": {
"node": {
"extensions": [".js", ".ts"]
"extensions": [
".js",
".ts"
]
},
"typescript": {
"directory": "./tsconfig.json"
}
}
},
"plugins": ["@typescript-eslint", "import", "cdk"],
"plugins": [
"@typescript-eslint",
"import",
"cdk"
],
"extends": [
"airbnb-base",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"oclif",
"oclif-typescript",
"prettier"
],
"ignorePatterns": [
Expand All @@ -35,65 +46,111 @@
"*.generated.ts",
"build/",
"cdk/cdk.out/",
"dist"
"dist/",
"test/",
"src/cdk/assets/",
"bin",
"lib",
"cdk",
"index.js"
],
"rules": {
"n/no-process-exit": "off",
"unicorn/no-process-exit": "off",
"no-restricted-syntax": "off",
"no-warning-comments": "off",
"unicorn/no-array-reduce": "off",
"unicorn/filename-case": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-floating-promises": ["error"],
"@typescript-eslint/no-non-null-assertion": ["warn"],
"@typescript-eslint/no-floating-promises": [
"error"
],
"@typescript-eslint/no-non-null-assertion": [
"warn"
],
"@typescript-eslint/no-explicit-any": "off",
"max-classes-per-file": "off",
"arrow-body-style": ["warn", "always"],
"arrow-parens": ["warn", "always"],
"comma-dangle": ["error", "only-multiline"],
"arrow-body-style": [
"warn",
"always"
],
"arrow-parens": [
"warn",
"always"
],
"comma-dangle": [
"error",
"only-multiline"
],
"consistent-return": "off",
"no-duplicate-imports": ["error"],
"no-duplicate-imports": [
"error"
],
"no-continue": "off",
"no-shadow": ["error"],
"key-spacing": ["error"],
"semi": ["error", "always"],
"quote-props": ["error", "consistent-as-needed"],
"function-call-argument-newline": ["error", "consistent"],
"no-multiple-empty-lines": ["error"],
"no-shadow": [
"error"
],
"key-spacing": [
"error"
],
"semi": [
"error",
"always"
],
"quote-props": [
"error",
"consistent-as-needed"
],
"function-call-argument-newline": [
"error",
"consistent"
],
"no-multiple-empty-lines": [
"error"
],
"no-new": 0,
"explicit-function-return-type": 0,
"no-console": "off",
"no-underscore-dangle": "off",
"no-await-in-loop": "off",
"no-unused-expressions": "off",
"import/no-unresolved": ["error"],
"indent": ["error", 2, { "SwitchCase": 1 }],
"import/no-unresolved": [
"error"
],
"indent": [
"error",
2,
{
"SwitchCase": 1
}
],
"class-methods-use-this": [
"error",
{
"exceptMethods": ["createCommand"]
"exceptMethods": [
"createCommand"
]
}
],
"quotes": [
"error",
"single",
{
"avoidEscape": true
}
],
"import/no-extraneous-dependencies": [
"quotes": [
"error",
"single",
{
"devDependencies": ["**/build-tools/**", "**/test/**"],
"optionalDependencies": false,
"peerDependencies": false
"avoidEscape": true
}
],
"import/order": [
"warn",
"import/no-extraneous-dependencies": [
"error",
{
"groups": ["builtin", "external"],
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
"devDependencies": [
"**/build-tools/**",
"**/test/**"
],
"optionalDependencies": false,
"peerDependencies": false
}
],
"import/order": "off",
"import/extensions": [
"warn",
"never",
Expand Down Expand Up @@ -153,4 +210,4 @@
}
]
}
}
}
8 changes: 2 additions & 6 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"require": [
"ts-node/register"
],
"watch-extensions": [
"ts"
],
"require": ["ts-node/register"],
"watch-extensions": ["ts"],
"recursive": true,
"reporter": "spec",
"timeout": 60000,
Expand Down
8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

9 changes: 8 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
"@oclif/prettier-config"
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2,
"arrowParens": "always"
}
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "node",
"request": "launch",
"name": "Mocha: current file",
"env": {
"env": {
"TS_NODE_TRANSPILE_ONLY": "true",
"TS_NODE_FILES": "true"
},
Expand All @@ -18,4 +18,4 @@
}
}
]
}
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cSpell.words": [
"unflatten"
]
}
10 changes: 4 additions & 6 deletions TESTING.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# Testing

Manual testing of CLI:
0. apps, repos, images
- issue with `show`
Manual testing of CLI: 0. apps, repos, images - issue with `show`

May not be necessary to test stack creation. Just test that the right params are passed to CDK.
Could also potentially compare the templates that are output, using the `--synth` flag.
Should output into the `cdk/cdk.out` directory

Scenario 1:
1. `new`, `show`, `delete`, and `update`

1. `new`, `show`, `delete`, and `update`

Find way to remove the `plugin` command and display in `help`

Expand All @@ -23,4 +21,4 @@ We want to avoid running a mock server. Instead have canned responses and evalua
Automate these tests.

Evaluate different approaches and testing libraries for next week.
Also start some manual tests (make a branch off main for the old CLI).
Also start some manual tests (make a branch off main for the old CLI).
13 changes: 9 additions & 4 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# TODO:

- use more of built-in oclif for error handling
- add examples for commands
- tests
- JSDoc
- fix eslint
- package using oclif
- reference the `../.github/workflows`
- JSDoc

- use more of built-in oclif for error handling
- add examples for commands
- tests
- JSDoc
4 changes: 2 additions & 2 deletions bin/dev.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning

// eslint-disable-next-line n/shebang
import {execute} from '@oclif/core'
import { execute } from '@oclif/core';

await execute({development: true, dir: import.meta.url})
await execute({ development: true, dir: import.meta.url });
4 changes: 2 additions & 2 deletions bin/run.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env node

import {execute} from '@oclif/core';
import { execute } from '@oclif/core';
import process from 'process';

process.env.AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE = '1';

await execute({dir: import.meta.url})
await execute({ dir: import.meta.url });
2 changes: 1 addition & 1 deletion cdk/lib/stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CacclAppEnvironment } from './appEnvironment';
import { CacclSshBastion } from './bastion';
import { CacclCache, CacclCacheOptions } from './cache';
import { CacclMonitoring } from './dashboard';
import {
import {
CacclDbOptions,
CacclDocDb,
CacclRdsDb,
Expand Down
Loading

0 comments on commit 3242d82

Please sign in to comment.