question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cannot override object-shorthand

See original GitHub issue

I can’t seem to disable this rule…

here is my .estlintrc file:

{
    "parser": "babel-eslint",
    "plugins": [
        "react"
    ],
    "env": {
        "node": true,
        "browser": true
    },
    "parserOptions": {
        "ecmaFeatures": {
            "jsx": true,
            "modules": true
        }
    },

    "extends": "airbnb",

    "rules": {
        comma-spacing: 2,
        new-cap: 2,
        object-shorthand: 0,
        one-var: [2, never],
        quotes: [1, single],
        space-before-blocks: 2,
        //react
        jsx-quotes: [2, prefer-double],
        react/jsx-curly-spacing: 2,
        react/jsx-max-props-per-line: [2, {maximum: 4}],
        react/jsx-no-duplicate-props: 2,
        react/jsx-no-undef: 2,
        react/jsx-indent: 0,
        react/jsx-indent-props: 0,
        semi: ["error", "always"],
        "indent": ["error", "tab", {"SwitchCase": 1}],
    }

But I still get:

error Expected method shorthand

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
MuffinLightningcommented, Jun 27, 2016

@ljharb

Thanks. The issue is resolved. I did something incredibly moronic that I’m too embarrassed to share :^)

1reaction
ljharbcommented, Jun 27, 2016

I assume if you remove “extends airbnb” that it no longer errors out?

If so, this sounds like an eslint bug itself, not an issue with our config plugin. Can you file it there?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rule override for object-literal-shorthand to never does not work
Since I configured "object-literal-shorthand": [true, "never"], , I expected TSlint NOT to throw an error and lint correctly. Additional info:.
Read more >
object-shorthand - ESLint - Pluggable JavaScript Linter
"never" ensures that no property or method shorthand is used in any object literal. "consistent" ensures that either all shorthand or all long-form...
Read more >
Override a method in Java generically - Stack Overflow
There's a conceptual problem. Suppose C#get() overrides A#get() A a = new C(); Object obj = a.get(); // actually calling C#get().
Read more >
Object initializer - JavaScript - MDN Web Docs - Mozilla
The property name must be double-quoted, and the definition cannot be a shorthand. Computed property names are not allowed either.
Read more >
Why can't default methods override equals, hashCode, and ...
The current rules are simple: if a class implements a method, that always wins over a default implementation. Since all instances of interfaces ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found