Giter VIP home page Giter VIP logo

Comments (5)

ilyavolodin avatar ilyavolodin commented on July 29, 2024 1

ESlint has a feature for this: https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions
Suggestions are not fixes, they will not be applied automatically, but will require the user to take an action to apply them. It was added specifically for the cases where there's no way to be sure that automatic change will make sense to the end user.

Finding duplicate code, however, is an np-complete problem, that's not trivial to implement even with a low guarantee.

from graphql-eslint.

dotansimha avatar dotansimha commented on July 29, 2024

This sounds very interesting. Any idea how can we locate those in a robust way what won't create incorrect results?
We can find similar selection sets (with TypeInfo) and suggest on moving to fragments, but that might not fit all use-cases...

from graphql-eslint.

FluorescentHallucinogen avatar FluorescentHallucinogen commented on July 29, 2024

Some of them already implemented in GraphQL Altair: altair-graphql/altair#745 (comment).

from graphql-eslint.

ilyavolodin avatar ilyavolodin commented on July 29, 2024

One other thing to keep in mind: ESLint operates on one file at a time, so if you have duplicate code across multiple files, ESLint will not be able to handle that, it will only be able to make a suggestion if it sees duplicate code in the same file.

from graphql-eslint.

dimaMachina avatar dimaMachina commented on July 29, 2024

no-one-place-fragments will be included in next release 3.14.0 to catch

find fragments that are used only in one place and suggest inline them.

from graphql-eslint.

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.