Coder Social home page Coder Social logo

Comments (5)

rickyp-uber avatar rickyp-uber commented on July 19, 2024

import/sort does not order by path, it orders by first specifier based on documentation which isn't ideal considering your imports may jump around in diffs if you import a new function (e.g. importing extra lodash functions).

I'm also curious what the benefit of enforcing the ordering actually is. If a team wants to enforce it they can, but in the base eslint rules? Why? I say just enforce the import/first without absolute and avoid bad code scenarios from a platform perspective. As for ordering preferences, leave that up to each team.

from eslint-config-fusion.

rickyp-uber avatar rickyp-uber commented on July 19, 2024

Oh and if you're enforcing the sort order of imports, may want to include exports in that ordering then
and change import/exports-last to on instead of off (which is it's current value)

from eslint-config-fusion.

rickyp-uber avatar rickyp-uber commented on July 19, 2024

About import/first... Jest allows you to mock an import, for example:

jest.mock('@uber/web-rpc-redux');
import * as rpcRedux from '@uber/web-rpc-redux';

Without adding a eslint-disable for every single one of these cases, is there a more general solution if we keep import/first?

from eslint-config-fusion.

KevinGrandon avatar KevinGrandon commented on July 19, 2024

I think we've decided as a team that we only want to go with eslint:recommended and type checking for now. Developers can be more specific with their own rules if they want.

from eslint-config-fusion.

rickyp-uber avatar rickyp-uber commented on July 19, 2024

Is there a issue/PR tracking the work to remove the non eslint:recommended rules that have already been added?

from eslint-config-fusion.

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.