diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..f302f38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,11 @@ +node_modules +amplify +tests +public +aws-video-exports.js +aws-exports.js +src/models +.cache +.github +.idea +.vscode diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..0a08902 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,42 @@ +module.exports = { + parser: "@typescript-eslint/parser", // Specifies the ESLint parser + extends: [ + "eslint:recommended", + "plugin:react/recommended", + "plugin:@typescript-eslint/recommended", + "plugin:prettier/recommended", + "prettier", + ], + settings: { + react: { + version: "detect", + }, + }, + env: { + browser: true, + node: true, + es6: true, + }, + plugins: ["@typescript-eslint", "react"], + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features + sourceType: "module", // Allows for the use of imports + }, + rules: { + "react/prop-types": "off", // Disable prop-types as we use TypeScript for type checking + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + }, + overrides: [ + // Override some TypeScript rules just for .js files + { + files: ["*.js"], + rules: { + "@typescript-eslint/no-var-requires": "off", // + }, + }, + ], +}; diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000..c9cdc63 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..7c788bb --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,5 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm run pre-commit +#exit 1 diff --git a/.lintstagedrc.js b/.lintstagedrc.js new file mode 100644 index 0000000..584a6d7 --- /dev/null +++ b/.lintstagedrc.js @@ -0,0 +1,19 @@ +const { ESLint } = require('eslint') +const filterAsync = require('node-filter-async').default + +const eslintCli = new ESLint() + +const removeIgnoredFiles = async (files) => { + const filteredFiles = await filterAsync(files, async (file) => { + const isIgnored = await eslintCli.isPathIgnored(file) + return !isIgnored + }) + return filteredFiles.join(' ') +} + +module.exports = { + '**/*.{ts,tsx,js,jsx}': async (files) => { + const filesToLint = await removeIgnoredFiles(files) + return [`eslint --max-warnings=0 ${filesToLint}`] + }, +} diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..d09e7b5 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v16.20.0 \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..e74ed9f --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "trailingComma": "es5", + "tabWidth": 4, + "semi": false, + "singleQuote": true +}