Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Commit

Permalink
Add types to events-handler, add test and prettier with eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian-Fitzner committed Nov 4, 2020
1 parent 053023f commit 960174f
Show file tree
Hide file tree
Showing 11 changed files with 13,513 additions and 133 deletions.
46 changes: 46 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"browsers": "last 2 versions"
}
}
],
"@babel/typescript"
],
"plugins": [
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
[
"@babel/plugin-proposal-class-properties",
{
"loose": true
}
],
"@babel/plugin-proposal-json-strings",
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-logical-assignment-operators",
"@babel/plugin-proposal-optional-chaining",
[
"@babel/plugin-proposal-pipeline-operator",
{
"proposal": "minimal"
}
],
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-do-expressions",
"@babel/plugin-proposal-function-bind"
]
}
18 changes: 18 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from @typescript-eslint/eslint-plugin
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parserOptions: {
ecmaVersion: 2019, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
jsx: false, // Allows for the parsing of JSX
},
},
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
'@typescript-eslint/no-explicit-any': 'off',
},
};
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"useTabs": false,
"printWidth": 100,
"singleQuote": true,
"trailingComma": "es5",
"semi": true
}
12 changes: 12 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
preset: 'ts-jest',
verbose: true,
name: 'ccc',
moduleFileExtensions: ['js', 'ts'],
transformIgnorePatterns: ['<rootDir>/node_modules/'],
coverageDirectory: './coverage/',
coverageReporters: ['json-summary', 'text', 'lcov'],
collectCoverage: true,
roots: ['<rootDir>/src'],
setupFiles: ['<rootDir>/setupTests.js'],
};
Loading

0 comments on commit 960174f

Please sign in to comment.