Giter Site home page Giter Site logo

Comments (14)

NullVoxPopuli avatar NullVoxPopuli commented on August 16, 2024

cross reported here: vfile/vfile#47

from unified.

ChristianMurphy avatar ChristianMurphy commented on August 16, 2024

vfile 4 and vfile-message 2 include typings built in.
vfile 3 and below as well as vfile-message 1 require typings to be installed from definitely typed.

either upgrade dependencies through the tree to get the versions that include typings or install @types/vfile-message

from unified.

ChristianMurphy avatar ChristianMurphy commented on August 16, 2024

FWIW, I use TS with Stylelint as well, and do not have have this issue.
There may be something specific to your build (webpack) or typescript configuration that is causing the conflict.
If you'd like help with that feel free to open a question at https://spectrum.chat/unified/type-definitions with more context on your build configuration.

from unified.

NullVoxPopuli avatar NullVoxPopuli commented on August 16, 2024

I have:

vfile 3.0.1, as a dep of unified.
unified 7.1.0 as a dep of remark.
remark 10.0.1 (latest is 11.0.2) as a dep of postcss-markdown # <-- this could be the issue here
postcss-markdown 0.36.0 (latest) as a dep of stylelint <- needs to upgrade remark
  - has remark specified as: `"remark": "^10.0.1",`
[email protected] (latest) is my direct dependency.

I'll bring my issue to postcss-markdown

from unified.

NullVoxPopuli avatar NullVoxPopuli commented on August 16, 2024

This looks promising: https://github.com/gucong3000/postcss-markdown/issues

๐Ÿคฆโ€โ™‚๏ธ

from unified.

NullVoxPopuli avatar NullVoxPopuli commented on August 16, 2024

FWIW, I use TS with Stylelint as well, and do not have have this issue.

you'd have to be using the master branch of postcss-markdown
or maybe have remark 11 installed yourself?

from unified.

ChristianMurphy avatar ChristianMurphy commented on August 16, 2024

No customization

  • stylelint 13.0.0
  • react-scripts (Create react app) 3.3.0
  • typescript 3.7.5

with tsconfig

{
  "compilerOptions": {
    "baseUrl": "src",
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "preserve"
  },
  "include": ["src"]
}

remark, unified, and vfile all are included with their standard transitive version provided by stylelint.

from unified.

drwpow avatar drwpow commented on August 16, 2024

Iโ€™m seeing the same as @NullVoxPopuli. @ChristianMurphy just out of curiosity, if you delete node_modules and package-lock.json/yarn.lock, and npm install, does your build still work? Iโ€™m wondering if in your project you are locked to an older version resolution.

from unified.

ChristianMurphy avatar ChristianMurphy commented on August 16, 2024

@DangoDev the package-lock.json and node_modules have been updated regularly, I did again today for good measure, the build still works.
I suspect it has to do with CRA setting "skipLibCheck": true

from unified.

drwpow avatar drwpow commented on August 16, 2024

I suspect it has to do with CRA setting "skipLibCheck": true

Ah you may be onto something there

from unified.

NullVoxPopuli avatar NullVoxPopuli commented on August 16, 2024

For those using the new(ish) tsc --build, skipLibCheck isn't an option (or at the very least isn't available via --skipLibCheck)

from unified.

ChristianMurphy avatar ChristianMurphy commented on August 16, 2024

@NullVoxPopuli this appears to be a tangentially related or unrelated to the original question?
To start a new discussion consider opening a thread at https://github.com/unifiedjs/unified/discussions

In addition, the TypeScript docs, make no mention of build restricting skipLibCheck it may be unrelated to the mode.

from unified.

NullVoxPopuli avatar NullVoxPopuli commented on August 16, 2024

๐Ÿ‘

I just tested with the tsconfig.json flag, and it works as described by others.

(Wouldn't recommend it tho)

from unified.

ChristianMurphy avatar ChristianMurphy commented on August 16, 2024

@NullVoxPopuli nobody here said it was recommended. ๐Ÿคจ
It's a work around for packages which haven't updated to the latest version which includes typings.


If you disagree with CRA's choice to use the flag, that would be something to take up with CRA directly https://github.com/facebook/create-react-app/issues

from unified.

Related Issues (20)

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.