Giter Site home page Giter Site logo

antfu / eslint-plugin-command Goto Github PK

View Code? Open in Web Editor NEW
136.0 3.0 7.0 594 KB

Comment-as-command for one-off codemod with ESLint.

Home Page: https://eslint-plugin-command.antfu.me/

License: MIT License

TypeScript 99.24% JavaScript 0.76%
codemod eslint-plugin

eslint-plugin-command's People

Contributors

9romise avatar alexzhang1030 avatar antfu avatar hyoban avatar sxzz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

eslint-plugin-command's Issues

`/// to-promise-all`

Clear and concise description of the problem

Hey there, I started using eslint-plugin-command and it's a pure joy so far, thanks @antfu!

I'd like a new command to refactor sequential promises to a single Promise.all call to run things in parallel.

Source:

/// to-promise-all
const a = await getA();
const b = await getB();
const c = await getC();

Suggested solution

Result:

const [a, b, c] = await Promise.all([getA(), getB(), getC()]);

Alternative

There might already be an eslint rule that finds and fixes potential performance issues, but I haven't found it yet

Additional context

Maybe the reverse operation /// to-seq-await would make sense if one wants to introduce dependencies between the promises and avoid refactoring by hand:

/// to-seq-await
const [a, b, c] = await Promise.all([getA(b), getB(c), getC()]);

const c = await getC();
const b = await getB(c);
const a = await getA(a);

Validations

Interconversion between `template string` and `string`

Clear and concise description of the problem

I would like to use a command to interconvert between template string and string.

Suggested solution

Interconversion would be easy, if there are multiple strings in one line, we can specify the number or all to covert.

Alternative

No response

Additional context

No response

Validations

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.