Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dependencies and configuration files. #1

Merged
merged 2 commits into from
Jul 26, 2023

Conversation

NathanWEdwards
Copy link
Collaborator

@NathanWEdwards NathanWEdwards commented Jul 15, 2023

This request adds several classes to support a data model, configurations for TypeScript and linting, and methods for interacting with Firebase.

CI integration was excluded from this request. The project needs to be initialized in a CI/CD environment. A Google Cloud Service Account with appropriate permissions needs to be added.

Entities are provided as classes over types for use with the Firebase API. Accessor methods are provided for each entity to promote use of calling methods to access an entity's data members. A models directory contains plain objects for the following entities:

  • Address
  • Contact
  • Donation
  • DonationDetails
  • Image
  • ImageDetails
  • Name
  • Phone
  • Storage
  • User
  • UserDetails

api/firebase-donation.ts and api/firebase-images.ts outline how entities may be retrieved as documents and collections from storage.

Initial tests present in this request are situated side-by-side the the feature/file they test. A dedicated test directory for .spec/test files is not included. Test support includes development dependencies for:

  • argos-ci
  • firebase-tools (for Firebase emulation)
  • Jest
  • Puppeteer
  • @testing-library React and Jest testing utilities

ESLint is provided as the linter of choice with the following configuration:

module.exports = {
    parser: '@typescript-eslint/parser',
    extends: ['eslint:recommended', 'plugin:react/recommended', 'plugin:@typescript-eslint/recommended'],
    plugins: ['@typescript-eslint', 'react-hooks', 'prettier'],
    parserOptions: {
        ecmaVersion: 2018,
        sourceType: 'module',
        ecmaFeatures: {
            jsx: true
        }
    },
    env: {
        browser: true,
        node: true,
        es6: true,
        jest: true
    },
    rules: {
        'no-control-regex': 0,
        'no-undef': 0,
        'no-unused-vars': 'off',
        'react/prop-types': 0,
        '@typescript-eslint/camelcase': 0,
        '@typescript-eslint/no-unused-vars': 1,
        '@typescript-eslint/no-use-before-define': 0,
        '@typescript-eslint/ban-ts-comment': 0,
        '@typescript-eslint/ban-ts-ignore': 0,
        '@typescript-eslint/explicit-member-accessibility': 0,
        '@typescript-eslint/member-delimiter-style': 0,
        '@typescript-eslint/no-empty-function': 0,
        '@typescript-eslint/no-explicit-any': 0,
        '@typescript-eslint/no-non-null-assertion': 'off',
        'react-hooks/rules-of-hooks': 'error',
        'react-hooks/exhaustive-deps': 'warn'
    },
    settings: {
        react: {
            version: 'detect'
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant