Skip to content

Commit 6168653

Browse files
author
jedmao
committed
fix: fix linting, codecov badge
1 parent d3eb2d6 commit 6168653

File tree

4 files changed

+7
-20
lines changed

4 files changed

+7
-20
lines changed

.eslintrc.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@
1515
"sourceType": "module",
1616
"tsconfigRootDir": "."
1717
},
18-
"plugins": ["@typescript-eslint"],
18+
"plugins": ["prettier", "@typescript-eslint"],
1919
"extends": [
2020
"eslint:recommended",
21+
"xo",
2122
"prettier",
2223
"plugin:@typescript-eslint/recommended"
2324
],
2425
"rules": {
26+
"valid-jsdoc": "off",
27+
2528
// Possible Errors
2629
"no-async-promise-executor": "error",
2730
"no-await-in-loop": "error",

package.json

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,6 @@
6565
"git reset"
6666
]
6767
},
68-
"eslintConfig": {
69-
"extends": [
70-
"xo",
71-
"prettier"
72-
],
73-
"env": {
74-
"jest": true,
75-
"node": true
76-
},
77-
"rules": {
78-
"prettier/prettier": "error"
79-
},
80-
"plugins": [
81-
"prettier"
82-
]
83-
},
8468
"prettier": {
8569
"arrowParens": "avoid",
8670
"proseWrap": "always",

src/ThemeContext.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const defaultTheme = {
77
primaryColor: 'red',
88
}
99

10-
let setProperty = jest.fn()
10+
const setProperty = jest.fn()
1111
const { style } = window.document.documentElement
1212
const saveSetProperty = style.setProperty
1313
style.setProperty = setProperty

src/ThemeContext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ export default class ThemeContext<T extends Theme> {
6666
): [T, Dispatch<SetStateAction<T>>] {
6767
const [theme, setTheme] = this.use()
6868
useLayoutEffect(() => {
69-
for (const key in theme) {
69+
Object.keys(theme).forEach(key => {
7070
element.style.setProperty(`--${kebabCase(key)}`, theme[
7171
key
7272
] as string)
73-
}
73+
})
7474
}, [theme])
7575
return [theme, setTheme]
7676
}

0 commit comments

Comments
 (0)