-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from StanHannebelle/typing
Typing
- Loading branch information
Showing
28 changed files
with
2,607 additions
and
1,012 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,97 @@ | ||
module.exports = { | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:import/recommended", | ||
"plugin:prettier/recommended", | ||
], | ||
rules: { | ||
curly: ["error", "all"], | ||
eqeqeq: ["error", "smart"], | ||
"import/no-duplicates": "off", | ||
"import/no-extraneous-dependencies": [ | ||
"error", | ||
{ | ||
devDependencies: true, | ||
optionalDependencies: false, | ||
peerDependencies: false, | ||
}, | ||
], | ||
"no-shadow": [ | ||
"error", | ||
{ | ||
hoist: "all", | ||
}, | ||
], | ||
"prefer-const": "error", | ||
"sort-imports": [ | ||
"error", | ||
{ | ||
ignoreCase: true, | ||
ignoreDeclarationSort: true, | ||
ignoreMemberSort: false, | ||
memberSyntaxSortOrder: ["none", "all", "multiple", "single"], | ||
}, | ||
], | ||
"padding-line-between-statements": [ | ||
"error", | ||
{ | ||
blankLine: "always", | ||
prev: "*", | ||
next: "return", | ||
}, | ||
], | ||
complexity: ["error", 8], | ||
"max-lines": ["error", 200], | ||
"max-depth": ["error", 3], | ||
"max-params": ["error", 2], | ||
}, | ||
|
||
root: true, | ||
plugins: ["import"], | ||
env: { | ||
node: true, | ||
es6: true, | ||
node: true, | ||
}, | ||
extends: ["airbnb-base", "prettier"], | ||
globals: { | ||
Atomics: "readonly", | ||
SharedArrayBuffer: "readonly", | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
sourceType: "module", | ||
}, | ||
plugins: ["prettier"], | ||
rules: { | ||
"prettier/prettier": "error", | ||
quotes: ["error", "double"], | ||
"no-console": "off", | ||
"no-plusplus": "off", | ||
"no-param-reassign": "off", | ||
"no-new": "off", | ||
"import/named": "off", | ||
"import/no-cycle": "off", | ||
}, | ||
parserOptions: { ecmaVersion: 2021 }, | ||
overrides: [ | ||
{ | ||
files: ["**/*.ts?(x)"], | ||
settings: { "import/resolver": { typescript: {} } }, | ||
extends: [ | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking", | ||
"plugin:import/typescript", | ||
"plugin:prettier/recommended", | ||
], | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
project: "tsconfig.json", | ||
}, | ||
rules: { | ||
"@typescript-eslint/explicit-module-boundary-types": "error", | ||
"@typescript-eslint/prefer-optional-chain": "error", | ||
"no-shadow": "off", | ||
"@typescript-eslint/no-shadow": "error", | ||
"@typescript-eslint/prefer-nullish-coalescing": "error", | ||
"@typescript-eslint/strict-boolean-expressions": "error", | ||
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error", | ||
"@typescript-eslint/no-unnecessary-condition": "error", | ||
"@typescript-eslint/no-unnecessary-type-arguments": "error", | ||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ argsIgnorePattern: "^_$", varsIgnorePattern: "^_$" }, | ||
], | ||
"@typescript-eslint/prefer-string-starts-ends-with": "error", | ||
"@typescript-eslint/switch-exhaustiveness-check": "error", | ||
"@typescript-eslint/ban-ts-comment": [ | ||
"error", | ||
{ | ||
"ts-ignore": "allow-with-description", | ||
minimumDescriptionLength: 10, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
const defaultPresets = [ | ||
["@babel/preset-typescript", { allowNamespaces: true }], | ||
]; | ||
|
||
const defaultIgnores = [ | ||
/.*\/(.*\.|)test\.tsx?/, | ||
/bundle\.ts/, | ||
/node_modules/, | ||
/lib/, | ||
]; | ||
|
||
const presetsForESM = [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
modules: false, | ||
}, | ||
], | ||
...defaultPresets, | ||
]; | ||
const presetsForCJS = [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
modules: "cjs", | ||
}, | ||
], | ||
...defaultPresets, | ||
]; | ||
const plugins = [ | ||
[ | ||
"module-resolver", | ||
{ | ||
root: ["./src"], | ||
extensions: [".ts"], | ||
}, | ||
], | ||
"@babel/plugin-transform-runtime", | ||
]; | ||
|
||
module.exports = { | ||
env: { | ||
cjs: { | ||
presets: presetsForCJS, | ||
}, | ||
esm: { | ||
presets: presetsForESM, | ||
}, | ||
}, | ||
ignore: defaultIgnores, | ||
plugins, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import toExistAsS3Bucket from "./toExistAsS3Bucket"; | ||
import toHaveContentEqualTo from "./toHaveContentEqualTo"; | ||
import toHaveContentTypeEqualTo from "./toHaveContentTypeEqualTo"; | ||
import toHaveEvent from "./toHaveEvent"; | ||
import toHaveEventWithSource from "./toHaveEventWithSource"; | ||
import toHaveObjectWithNameEqualTo from "./toHaveObjectWithNameEqualTo"; | ||
import toExistInDynamoTable from "./toExistInDynamoTable"; | ||
|
||
export default { | ||
...toExistAsS3Bucket, | ||
...toHaveContentEqualTo, | ||
...toHaveContentTypeEqualTo, | ||
...toHaveEvent, | ||
...toHaveEventWithSource, | ||
...toHaveObjectWithNameEqualTo, | ||
...toExistInDynamoTable, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.