Uploaded image for project: 'Stripes'
  1. Stripes
  2. STRIPES-429

Get rid of "eslint-disable-next-line import/no-unresolved" for import React

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: P3
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Template:

      Description

      For a long time we have had problems with multiple copies of React getting into our builds – see STRIPES-220. The old way of avoiding this was to remove the copies of React from the node_modules areas of each module. This caused ESLint errors, since the require package was not visibly available. (But it worked when running the code, since stripes-core's copy of React was available to the whole program.)

      Now that we have the yarn-link script (STRPCORE-14) that symbolically links stripes-core's copy of React into all the other modules' node_modules areas, so that the same version of React is available everywhere.

      This means we no longer need to kludge the ESLinting, and we can rip out all the many instances of this nonsense:

      // We have to remove node_modules/react to avoid having multiple copies loaded.
      // eslint-disable-next-line import/no-unresolved
      import React, { Component } from 'react';
      

      As with STRIPES-427, this is code-quality issue that touches all the numerous bits of Stripes and its modules that use React. Rather than filing a separate issue for each one, I will use this as a single all-in-one issue.

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                mike Mike Taylor
                Reporter:
                mike Mike Taylor
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 2 hours
                    2h

                      TestRail: Runs

                        TestRail: Cases