cannot override object-shorthand
See original GitHub issueI 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:
- Created 7 years ago
- Comments:6
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ljharb
Thanks. The issue is resolved. I did something incredibly moronic that I’m too embarrassed to share :^)
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?