NCIOCPL / drug-dictionary-app

NCI Drug Dictionary Application
2 stars 0 forks source link

Add in Testing Best Practice ESLint Plugins #111

Open bryanpizzillo opened 3 years ago

bryanpizzillo commented 3 years ago

Issue description

ESTIMATE 5

Replace all linter plugins with https://github.com/NCIOCPL/cgov-standards-xt/tree/develop/packages/eslint-config-react. This should roughly be:

  1. Add a .npmrc file at the root with
    @nciocpl:registry=https://npm.pkg.github.com
  2. Login to the GH Registry. The following command will work, but see GH for more info if needed. npm login --scope=@nciocpl --registry=https://npm.pkg.github.com
  3. Run the following command to remove old lint packages
    npm uninstall --save eslint-config-airbnb eslint-config-prettier eslint-config-react-app eslint-plugin-flowtype eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks prettier
  4. Install our Lint configuration module. npm install --save-dev @nciocpl/eslint-config-react
  5. Update .github/workflows/workflow.yml to:
    • Replace:
      ## This installs the correct node version
      - name: Use Node.js 12.x
        uses: actions/setup-node@v1
        with:
          node-version: 12.x
      ## Restore cache
      - name: Restore npm cache
        uses: actions/cache@v1
        with:
            path: ~/.npm
            key: cache-${{ hashFiles('package-lock.json') }}
      ## Install using CI
      - name: Install Dependencies
        run: npm ci
        env:
            CI: true
    • With
      ## Setup node and npm caching.
      - name: Setup Node
        uses: actions/setup-node@v2
        with:
            node-version: '12'
            cache: 'npm'
            registry-url: https://npm.pkg.github.com
            scope: '@nciocpl'
      ## Install using CI
      - name: Install Dependencies
        run: npm ci
        env:
            CI: true
            NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  6. Fix any linting issues
arcepaul commented 1 year ago

Looks like a few things were missed in finishing this ticket requiring us to re-open.

Please check the steps above: