Code Monkey home page Code Monkey logo

Comments (5)

wroughtec avatar wroughtec commented on June 3, 2024

hmm also seems eslint doesn't like it:
error Unable to resolve path to module 'react-use-clipboard' import/no-unresolved

seems to build fine though

from react-use-clipboard.

danoc avatar danoc commented on June 3, 2024

Hey @wroughtec — Thanks for the issue. I'm not able to reproduce this one.

Can you see if the package exists in your package.json, yarn.lock or package-lock.json, and node_modules folder?

from react-use-clipboard.

wroughtec avatar wroughtec commented on June 3, 2024

yes is in the lock file & node_modules:

[email protected]:
  version "0.1.3"
  resolved "https://registry.yarnpkg.com/react-use-clipboard/-/react-use-clipboard-0.1.3.tgz#46dfbdb08586d1335970a7fdd88383ec64b95dc4"
  integrity sha512-EDKKJpduJtqpEDLXPdqcoQszTGyctg8V7tO8DWPAUFDnZOvfVA/EfTCYzugrpRS3ikeFbBbR8MrBrHJ2DhhqGg==
  dependencies:
    copy-to-clipboard "^3.0.8"

Eslint config as below:

const path = require('path');

module.exports = {
  extends: [
    'plugin:cypress-dev/general',
    'plugin:cypress-dev/tests',
    'plugin:cypress-dev/react',
    'plugin:import/typescript',
    'plugin:@typescript-eslint/recommended',
    'airbnb',
    'prettier',
    'prettier/@typescript-eslint',
    'prettier/react'
  ],
  plugins: [
    'html',
    'import',
    'eslint-plugin-env',
    'react-hooks',
    'jasmine',
    'cypress',
    'chai-friendly',
    '@typescript-eslint',
    'prettier'
  ],
  globals: { google: true, analytics: true },
  parser: '@typescript-eslint/parser',
  parserOptions: {
    ecmaVersion: 2018,
    sourceType: 'module',
    ecmaFeatures: {
      jsx: true
    },
    tokens: true
  },
  env: {
    es6: true,
    browser: true,
    node: true,
    jest: true,
    jasmine: true,
    serviceworker: true,
    'cypress/globals': true
  },
  rules: {},
  settings: {
    'import/resolver': {
      'babel-module': {},
      typescript: {},
      node: true,
      'eslint-import-resolver-typescript': true
    }
  },
  overrides: [
    {
      files: ['**/__tests__/**'],
      settings: {
        'import/resolver': {
          jest: {
            jestConfigFile: path.join(__dirname, './jest.config.js')
          }
        }
      }
    },
    {
      files: ['**/__tests__/*.test.ts', '**/__tests__/*.test.tsx'],
      rules: {
        '@typescript-eslint/explicit-function-return-type': 0
      }
    }
  ]
};

jest config:

const path = require('path');

module.exports = {
  verbose: true,
  rootDir: './src',
  moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json'],
  transform: {
    '^.+\\.(js|jsx)$': 'babel-jest',
    '^.+\\.(ts|tsx)$': 'babel-jest'
  },
  transformIgnorePatterns: ['[/\\\\]node_modules/\\\\].+\\.(js|jsx|ts|tsx)$', '\\.(css|scss|sass|less)$'],
  coveragePathIgnorePatterns: ['./public/', './node_modules/'],
  setupFiles: ['./testsSetup/setupTests.js', 'jest-localstorage-mock'],
  globals: {
    TZ: 'UTC'
  },
  moduleDirectories: ['node_modules', 'src', 'testUtils', __dirname],
  collectCoverageFrom: [],
  reporters: ['default', 'jest-junit'],
  watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname', 'jest-watch-select-projects'],
  setupFilesAfterEnv: ['./testsSetup/extendJest.js'],
  moduleNameMapper: {
    '\\.(css|scss|sass|less)$': 'identity-obj-proxy',
    '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
      '<rootDir>/__mocks__/fileMock.js'
  }
};

Tried on both Mac and ubuntu same error rolling back to 0.1.2 resolves, its probably something in my config

from react-use-clipboard.

danoc avatar danoc commented on June 3, 2024

@wroughtec — Not too sure what the issue is. Happy to help debug if there's a reproduction I can clone locally.

I just published version 0.1.4 which adopts TypeScript. It's possible that the new version accidentally also fixes the issue you're running into.

from react-use-clipboard.

wroughtec avatar wroughtec commented on June 3, 2024

Yep fixed my issue 👍

from react-use-clipboard.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.