Skip to content

Commit b33b61c

Browse files
committed
style: fix lint errors
1 parent 36f3e2d commit b33b61c

File tree

4 files changed

+8
-17
lines changed

4 files changed

+8
-17
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/fixtures/*.js

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
]
1010
},
1111
"eslintConfig": {
12-
"extends": "prometheusresearch"
12+
"extends": "prometheusresearch",
13+
"env": {
14+
"mocha": true
15+
}
1316
},
1417
"scripts": {
1518
"test": "make test"

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function render(source: string, config: RenderConfig = {}): {js: string;
3434
return {js, css};
3535
}
3636

37-
function renderToCSS(source: string, config: RenderConfig): string {
37+
function renderToCSS(source: string, _config: RenderConfig): string {
3838
let root = postcss.parse(source);
3939
root = transformVariants(root);
4040
root.walkRules(node => {
@@ -85,7 +85,7 @@ function exportComponent(name: string, component: string, className: string) {
8585
types.spreadProperty(types.identifier('props')),
8686
types.objectProperty(
8787
types.identifier('className'),
88-
types.memberExpression(types.identifier('styles'), types.identifier(name))
88+
types.memberExpression(types.identifier('styles'), types.identifier(className))
8989
)
9090
]);
9191
let elementNode = types.callExpression(

src/transformVariants.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/**
77
* Variant names we want to see compiled as CSS pseudo classes.
88
*/
9-
const SUPPORTED_PSEUDO_CLASSES = {
9+
const _SUPPORTED_PSEUDO_CLASSES = {
1010
focus: true,
1111
hover: true,
1212
active: true,
@@ -75,16 +75,3 @@ export function isComponent(node) {
7575
node.parent.type === 'root'
7676
);
7777
}
78-
79-
function findComponent(node) {
80-
while (true) {
81-
if (isComponent(node)) {
82-
return node;
83-
}
84-
if (!node.parent) {
85-
break;
86-
}
87-
node = node.parent;
88-
}
89-
return null;
90-
}

0 commit comments

Comments
 (0)