Giter Club home page Giter Club logo

Comments (7)

rachel-fenichel avatar rachel-fenichel commented on May 18, 2024 6

The indent rule has been updated to be more configurable.

I found this repo while tweaking eslint configs for Google style. If you're still updating it, here's what I'm using for indentation so far:

        "indent": [
            "error", 2,  # Google use 2-space indents
            # Google uses +4 space indents for line continuations.
            {
                "SwitchCase": 1,
                "MemberExpression": 2,
                "FunctionDeclaration": {
                    "body": 1,
                    "parameters": 2
                },
                "FunctionExpression": {
                    "body": 1,
                    "parameters": 2
                },
                "CallExpression": {
                    "arguments": 2
                },
                # Ignore default rules for ternary expressions.
                "ignoredNodes": ["ConditionalExpression"]
            }
        ],

I haven't sorted out what version of the Object Expression rule applies.

from eslint-config-google.

sindresorhus avatar sindresorhus commented on May 18, 2024

Is there an ESLint rule for that? Otherwise you'll need to request it on the ESLint issue tracker.

from eslint-config-google.

 avatar commented on May 18, 2024

Apparently there is not, as I was unable to find one in the ESLint documentation (v2.11.1).

Unfortunately, according to the ESlint contributing guide page, to request a new rule and for it to be accepted, you also need to be the one to create and maintain it. Currently I would be unable to do that.

Wouldn't that be the case to create a custom rule for this configuration?

from eslint-config-google.

sindresorhus avatar sindresorhus commented on May 18, 2024

to request a new rule and for it to be accepted, you also need to be the one to create and maintain it.

That's not entirely correct. Open an issue and if there's merit to the idea, someone will come along and implement it.

from eslint-config-google.

 avatar commented on May 18, 2024

I just found that a parameter indentation rule is currently being evaluated by ESLint members. So it's just a question of time now.

from eslint-config-google.

mathiasbynens avatar mathiasbynens commented on May 18, 2024

Thanks for providing that snippet, @rachel-fenichel! I've added an object expression rule and submitted a PR: #50.

from eslint-config-google.

philipwalton avatar philipwalton commented on May 18, 2024

Closing now that #50 is merged.

from eslint-config-google.

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.