Git Product home page Git Product logo

Comments (7)

chenshuai2144 avatar chenshuai2144 commented on September 28, 2024 1

新版本修复了一下,那个插件原来不支持less。

from fabric.

lcysgsg avatar lcysgsg commented on September 28, 2024

现在暂时处理的方法是去 node_modules 里删除 prettier-plugin-style-order 文件夹...

from fabric.

liangjiayu avatar liangjiayu commented on September 28, 2024

现在暂时处理的方法是去 node_modules 里删除 prettier-plugin-style-order 文件夹...

还有其他更好的解决方案吗?

from fabric.

lcysgsg avatar lcysgsg commented on September 28, 2024

@liangjiayu 依赖的依赖,prettier 插件又是自动加载的,还能咋办。ant-designumi 很多都使用了 fabric, node_modules 包含 prettier-plugin-style-order 就会被 prettier 自动加载,设置 prettier 插件加载目录的话,一是 vscode 里不知道怎么设置,二是也不合适改这个。

只能去提issues和pr。临时处理我想到的就这样了

from fabric.

cat-walk avatar cat-walk commented on September 28, 2024

遇到了同样的问题,less 里写注释就会导致 prettier 格式化失败,楼主现在有更好的解决方案了吗?

from fabric.

cat-walk avatar cat-walk commented on September 28, 2024

这个问题已经提了挺久的,也没有看到有人出来解决...

from fabric.

lcysgsg avatar lcysgsg commented on September 28, 2024

@liangjiayu @cat-walk

比起手动删除进步了一点,现在在安装依赖的时候自动删除,利用 package.json 的自带钩子

修改 package.jsonscripts.postinstall: "umi g tmp" => "postinstall": "node ./scripts/postinstall.js"

// ./scripts/postinstall.js
// Run AFTER the package is installed
// 自动在安装依赖的时候执行

const { execSync } = require('child_process');

console.log(`$ umi g tmp`);
execSync(`umi g tmp`);

console.log('------------');
console.log(`-- $ rm -rf ./node_modules/prettier-plugin-style-order`);
console.log(`-- > 这个包不兼容 prettier ^2,删除了才能正常在 .less 中使用格式化等功能`);
console.log(`-- > 在这里跟进进度 https://github.com/umijs/fabric/issues/88`);
console.log('------------');
execSync(`rm -rf ./node_modules/prettier-plugin-style-order`);

from fabric.

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.