Skip to content

Commit ebf666b

Browse files
committed
refactor: Run local ESLint
1 parent 8e38e02 commit ebf666b

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

src/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import checkValidOptions from './options'
22

3-
export default function ({types: t}) {
3+
export default function ({ types: t }) {
44
return {
55
visitor: {
66
ArrowFunctionExpression (path, state) {
@@ -9,7 +9,9 @@ export default function ({types: t}) {
99
const componentName = path.parent.id.name
1010

1111
const functionBody = path.get('body').get('body')
12-
const returnStatement = functionBody.find((c) => c.type === 'ReturnStatement')
12+
const returnStatement = functionBody.find(
13+
c => c.type === 'ReturnStatement'
14+
)
1315
const arg = returnStatement.get('argument')
1416
if (!arg.isJSXElement()) return
1517

src/options.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@ const langTransforms = {
99
snake: snakeCase
1010
}
1111

12-
const isValidOption = opt => {
13-
return opt && isString(opt)
14-
}
12+
const isValidOption = opt => opt && isString(opt)
1513

16-
const validTranform = (opt) => {
14+
const validTranform = opt => {
1715
return Object.keys(langTransforms).indexOf(opt) > -1
1816
}
1917

20-
const checkValidOptions = (state) => {
18+
const checkValidOptions = state => {
2119
let attribute = 'data-qa'
2220
let format = 'kebab'
2321

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
22
"plugins": [
33
"syntax-jsx",
4-
["../../../../src", {
5-
"format": "snake"
6-
}]
4+
[
5+
"../../../../src",
6+
{
7+
"format": "kebab"
8+
}
9+
]
710
]
811
}

0 commit comments

Comments
 (0)