Skip to content

Commit 8857376

Browse files
committed
Lint
1 parent 72b1760 commit 8857376

File tree

9 files changed

+133
-148
lines changed

9 files changed

+133
-148
lines changed

.eslintrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"afterColon": true,
4141
"on": "colon"
4242
} }],
43-
"keyword-spacing": [2, { "before": true, "after": false, "overrides" : { "else": { "after": true }} }],
43+
"keyword-spacing": [2, { "before": true, "after": false, "overrides" : { "else": { "after": true }, "return" : { "after" : true } } }],
4444
"new-cap": [2, { "newIsCap": true, "capIsNew": false }],
4545
"new-parens": 2,
4646
"no-array-constructor": 2,

test/addClassNameToNode.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,9 @@
22

33
const assert = require("assert"),
44

5-
forEach = require("lodash/forEach"),
6-
concat = require("lodash/concat"),
7-
85
addClassNameToNode = require("../lib/addClassNameToNode"),
96

10-
fixtures = require("./fixtures").addClassNameToNode,
11-
12-
groups = require("../lib/groups");
7+
fixtures = require("./fixtures").addClassNameToNode;
138

149
describe("/lib", () => {
1510
describe("/addClassNameToNode.js", () => {

test/api.js

-10
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
const assert = require("assert"),
44

55
posthtml = require("posthtml"),
6-
pseudo = require("../index"),
76

87
fixtures = require("./fixtures");
98

@@ -16,14 +15,5 @@ describe("/lib", () => {
1615
assert.equal(result.html, fixtures.basic.expected);
1716
})
1817
);
19-
20-
// it("should run posthtml with pseudo", () =>
21-
// posthtml()
22-
// .use(pseudo())
23-
// .process(fixtures.groups.all.input)
24-
// .then((result) => {
25-
// assert.equal(result.html, fixtures.groups.all.expected);
26-
// })
27-
// );
2818
});
2919
});

test/fixtures/addClassNameToNode/emptyClass.js

+22-22
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,39 @@
22

33
module.exports = {
44
input : {
5-
tag: "a",
6-
attrs: {
7-
href: "#",
8-
class: ""
5+
tag : "a",
6+
attrs : {
7+
href : "#",
8+
class : ""
99
},
10-
content: [
10+
content : [
1111
"\n ",
12-
{
13-
tag: "span",
14-
attrs: {
15-
class: "animals__cat",
16-
style: "background: url(cat.png)"
12+
{
13+
tag : "span",
14+
attrs : {
15+
class : "animals__cat",
16+
style : "background: url(cat.png)"
1717
},
18-
content: ["Cat"]
18+
content : ["Cat"]
1919
},
2020
"\n"
2121
]
2222
},
2323
expected : {
24-
tag: "a",
25-
attrs: {
26-
class: ":test",
27-
href: "#"
24+
tag : "a",
25+
attrs : {
26+
class : ":test",
27+
href : "#"
2828
},
29-
content: [
29+
content : [
3030
"\n ",
31-
{
32-
tag: "span",
33-
attrs: {
34-
class: "animals__cat",
35-
style: "background: url(cat.png)"
31+
{
32+
tag : "span",
33+
attrs : {
34+
class : "animals__cat",
35+
style : "background: url(cat.png)"
3636
},
37-
content: ["Cat"]
37+
content : ["Cat"]
3838
},
3939
"\n"
4040
]

test/fixtures/addClassNameToNode/endClass.js

+22-22
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,39 @@
22

33
module.exports = {
44
input : {
5-
tag: "a",
6-
attrs: {
7-
href: "#",
8-
class: "something"
5+
tag : "a",
6+
attrs : {
7+
href : "#",
8+
class : "something"
99
},
10-
content: [
10+
content : [
1111
"\n ",
12-
{
13-
tag: "span",
14-
attrs: {
15-
class: "animals__cat",
16-
style: "background: url(cat.png)"
12+
{
13+
tag : "span",
14+
attrs : {
15+
class : "animals__cat",
16+
style : "background: url(cat.png)"
1717
},
18-
content: ["Cat"]
18+
content : ["Cat"]
1919
},
2020
"\n"
2121
]
2222
},
2323
expected : {
24-
tag: "a",
25-
attrs: {
26-
class: "something :test",
27-
href: "#"
24+
tag : "a",
25+
attrs : {
26+
class : "something :test",
27+
href : "#"
2828
},
29-
content: [
29+
content : [
3030
"\n ",
31-
{
32-
tag: "span",
33-
attrs: {
34-
class: "animals__cat",
35-
style: "background: url(cat.png)"
31+
{
32+
tag : "span",
33+
attrs : {
34+
class : "animals__cat",
35+
style : "background: url(cat.png)"
3636
},
37-
content: ["Cat"]
37+
content : ["Cat"]
3838
},
3939
"\n"
4040
]

test/fixtures/addClassNameToNode/noClass.js

+21-21
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,38 @@
22

33
module.exports = {
44
input : {
5-
tag: "a",
6-
attrs: {
7-
href: "#"
5+
tag : "a",
6+
attrs : {
7+
href : "#"
88
},
9-
content: [
9+
content : [
1010
"\n ",
11-
{
12-
tag: "span",
13-
attrs: {
14-
class: "animals__cat",
15-
style: "background: url(cat.png)"
11+
{
12+
tag : "span",
13+
attrs : {
14+
class : "animals__cat",
15+
style : "background: url(cat.png)"
1616
},
17-
content: ["Cat"]
17+
content : ["Cat"]
1818
},
1919
"\n"
2020
]
2121
},
2222
expected : {
23-
tag: "a",
24-
attrs: {
25-
class: ":test",
26-
href: "#"
23+
tag : "a",
24+
attrs : {
25+
class : ":test",
26+
href : "#"
2727
},
28-
content: [
28+
content : [
2929
"\n ",
30-
{
31-
tag: "span",
32-
attrs: {
33-
class: "animals__cat",
34-
style: "background: url(cat.png)"
30+
{
31+
tag : "span",
32+
attrs : {
33+
class : "animals__cat",
34+
style : "background: url(cat.png)"
3535
},
36-
content: ["Cat"]
36+
content : ["Cat"]
3737
},
3838
"\n"
3939
]

test/fixtures/addClassNameToNode/sortClass1.js

+22-22
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,39 @@
22

33
module.exports = {
44
input : {
5-
tag: "a",
6-
attrs: {
7-
href: "#",
8-
class: "something :first-child"
5+
tag : "a",
6+
attrs : {
7+
href : "#",
8+
class : "something :first-child"
99
},
10-
content: [
10+
content : [
1111
"\n ",
12-
{
13-
tag: "span",
14-
attrs: {
15-
class: "animals__cat",
16-
style: "background: url(cat.png)"
12+
{
13+
tag : "span",
14+
attrs : {
15+
class : "animals__cat",
16+
style : "background: url(cat.png)"
1717
},
18-
content: ["Cat"]
18+
content : ["Cat"]
1919
},
2020
"\n"
2121
]
2222
},
2323
expected : {
24-
tag: "a",
25-
attrs: {
26-
class: "something :first-child :first-of-type",
27-
href: "#"
24+
tag : "a",
25+
attrs : {
26+
class : "something :first-child :first-of-type",
27+
href : "#"
2828
},
29-
content: [
29+
content : [
3030
"\n ",
31-
{
32-
tag: "span",
33-
attrs: {
34-
class: "animals__cat",
35-
style: "background: url(cat.png)"
31+
{
32+
tag : "span",
33+
attrs : {
34+
class : "animals__cat",
35+
style : "background: url(cat.png)"
3636
},
37-
content: ["Cat"]
37+
content : ["Cat"]
3838
},
3939
"\n"
4040
]

test/fixtures/addClassNameToNode/sortClass2.js

+22-22
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,39 @@
22

33
module.exports = {
44
input : {
5-
tag: "a",
6-
attrs: {
7-
href: "#",
8-
class: "something :first-of-type"
5+
tag : "a",
6+
attrs : {
7+
href : "#",
8+
class : "something :first-of-type"
99
},
10-
content: [
10+
content : [
1111
"\n ",
12-
{
13-
tag: "span",
14-
attrs: {
15-
class: "animals__cat",
16-
style: "background: url(cat.png)"
12+
{
13+
tag : "span",
14+
attrs : {
15+
class : "animals__cat",
16+
style : "background: url(cat.png)"
1717
},
18-
content: ["Cat"]
18+
content : ["Cat"]
1919
},
2020
"\n"
2121
]
2222
},
2323
expected : {
24-
tag: "a",
25-
attrs: {
26-
class: "something :first-child :first-of-type",
27-
href: "#"
24+
tag : "a",
25+
attrs : {
26+
class : "something :first-child :first-of-type",
27+
href : "#"
2828
},
29-
content: [
29+
content : [
3030
"\n ",
31-
{
32-
tag: "span",
33-
attrs: {
34-
class: "animals__cat",
35-
style: "background: url(cat.png)"
31+
{
32+
tag : "span",
33+
attrs : {
34+
class : "animals__cat",
35+
style : "background: url(cat.png)"
3636
},
37-
content: ["Cat"]
37+
content : ["Cat"]
3838
},
3939
"\n"
4040
]

0 commit comments

Comments
 (0)