This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support granular config in 'object-literal-shorthand'
- Loading branch information
1 parent
85d4125
commit a7820f8
Showing
6 changed files
with
254 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
test/rules/object-literal-shorthand/onlyMethods/test.ts.fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const badMethodsGoodProps = { | ||
w() {}, | ||
*x() {}, | ||
[y]() {}, | ||
z: z | ||
}; | ||
|
||
const goodMethodsBadProps = { | ||
w() {}, | ||
*x() {}, | ||
[y]() {}, | ||
z: z | ||
}; | ||
|
||
const arrows = { | ||
x: (y) => y // this is OK. | ||
}; | ||
|
||
const namedFunctions = { | ||
x: function y() {} // named function expressions are also OK. | ||
}; | ||
|
||
const quotes = { | ||
"foo-bar"() {}, | ||
"foo-bar"() {} | ||
}; | ||
|
||
const extraCases = { | ||
x: x, | ||
a: 123, | ||
b: "hello", | ||
c: 'c', | ||
["a" + "nested"]: { | ||
x: x | ||
} | ||
}; | ||
|
||
const asyncFn = { | ||
async foo() {}, | ||
async *bar() {} | ||
} | ||
|
||
({foo: foo} = {foo: foo}); | ||
({foo: foo} = {foo: foo}); | ||
|
Oops, something went wrong.