Skip to content

Commit

Permalink
feat: add ask-sdk-local-debug package
Browse files Browse the repository at this point in the history
  • Loading branch information
Shen Chen committed Jul 21, 2020
1 parent 10cf6d6 commit a7c22a9
Show file tree
Hide file tree
Showing 22 changed files with 1,105 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ask-sdk-local-debug/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
build
172 changes: 172 additions & 0 deletions ask-sdk-local-debug/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "prettier"],
env: {
node: true,
es6: true,
},
extends: [
"airbnb",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:eslint-comments/recommended",
// Disable below extends and parser options if having performance issues
// https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/TYPED_LINTING.md
"plugin:@typescript-eslint/recommended-requiring-type-checking",
],
rules: {
// ---------------------------------------------------------
// --- Rules from eslint:recommended that we override
// ---------------------------------------------------------
"class-methods-use-this": ["error", { "exceptMethods": ["errorEvent", "connectedEvent"] }],
"no-unused-vars": "off", // because it flags types that are imported for type declarations (but otherwise unused).
"no-undef": "off", // because if flags lack of import for Set. // TODO: fix the issues and remove this override.

// ---------------------------------------------------------
// --- Rules that we add and/or customize
// ---------------------------------------------------------

eqeqeq: ["error", "smart"],
"guard-for-in": "error",
"id-blacklist": [
"error",
"any",
"Number",
"number",
"String",
"string",
"Boolean",
"boolean",
"Undefined",
"undefined",
],
"id-match": "error",
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
],
"import/no-cycle": "off",
"import/no-default-export": "error",
"import/no-extraneous-dependencies": ["off", { devDependencies: false }],
"import/prefer-default-export": "off",
indent: "off",
"jsx-a11y/control-has-associated-label": "off",
"jsx-a11y/label-has-associated-control": "off",
"new-parens": "error",
"no-caller": "error",
"no-duplicate-imports": "error",
"no-eval": "error",
"no-extra-bind": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-return-await": "error",
"no-sequences": "error",
"no-shadow": ["off", { hoist: "all" }],
"no-undef-init": "error",
"no-underscore-dangle": ["error", {
"allowAfterThis": true
}],
"no-var": "error",
"object-shorthand": "error",
"one-var": ["error", "never"],
"prefer-const": "error",
"prefer-object-spread": "error",
radix: "error",

"@typescript-eslint/strict-boolean-expressions": ["error"], // avoids frequent sources of errors: 0, "", Promise<T>, null vs undefined
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": ["error", { default: "array-simple" }],
"@typescript-eslint/ban-types": [
"error",
{
types: {
Object: {
message: "Avoid using the `Object` type. Did you mean `object`?",
},
Function: {
message:
"Avoid using the `Function` type. Prefer a specific function type, like `() => void`.",
},
Boolean: {
message: "Avoid using the `Boolean` type. Did you mean `boolean`?",
},
Number: {
message: "Avoid using the `Number` type. Did you mean `number`?",
},
String: {
message: "Avoid using the `String` type. Did you mean `string`?",
},
Symbol: {
message: "Avoid using the `Symbol` type. Did you mean `symbol`?",
},
},
},
],
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
{ accessibility: "explicit" },
],
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/member-ordering": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-floating-promises": ["error"], // prevent those nasty forgotten promises !
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/no-this-alias": "error",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/triple-slash-reference": [
"error",
{
path: "always",
types: "prefer-import",
lib: "always",
},
],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",

// -- Rules form tsdoc
// "tsdoc/syntax": "warn", // TODO: enable once we have better tsdoc coverage
},
parserOptions: {
ecmaVersion: 6,
sourceType: "module",
// Disable below extends and parser options if having performance issues
// https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/TYPED_LINTING.md
tsconfigRootDir: __dirname,
project: "./tsconfig.json",
},
settings: {
"import/extensions": [".js", ".jsx", ".ts", ".tsx"],
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"],
},
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
// use <root>/tsconfig.json
typescript: {
// "alwaysTryTypes": true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`,
// "directory": "./"
},
},
},
};
11 changes: 11 additions & 0 deletions ask-sdk-local-debug/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
coverage/
dist/
doc/
node_modules/
package-lock.json
.DS_Store
.idea/
.vscode/
build
package/
*.tgz
8 changes: 8 additions & 0 deletions ask-sdk-local-debug/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
coverage/
doc/
lib/
node_modules/
tst/
package-lock.json
tsconfig.json
tslint.json
7 changes: 7 additions & 0 deletions ask-sdk-local-debug/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Change Log

# 1.0.0 (2020-07-21)

This release contains the following changes :

- Initial release for local development support for ASK SDK for Node.js.
Loading

0 comments on commit a7c22a9

Please sign in to comment.