Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkace committed Sep 8, 2016
1 parent 72b1760 commit 8857376
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 148 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"afterColon": true,
"on": "colon"
} }],
"keyword-spacing": [2, { "before": true, "after": false, "overrides" : { "else": { "after": true }} }],
"keyword-spacing": [2, { "before": true, "after": false, "overrides" : { "else": { "after": true }, "return" : { "after" : true } } }],
"new-cap": [2, { "newIsCap": true, "capIsNew": false }],
"new-parens": 2,
"no-array-constructor": 2,
Expand Down
7 changes: 1 addition & 6 deletions test/addClassNameToNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@

const assert = require("assert"),

forEach = require("lodash/forEach"),
concat = require("lodash/concat"),

addClassNameToNode = require("../lib/addClassNameToNode"),

fixtures = require("./fixtures").addClassNameToNode,

groups = require("../lib/groups");
fixtures = require("./fixtures").addClassNameToNode;

describe("/lib", () => {
describe("/addClassNameToNode.js", () => {
Expand Down
10 changes: 0 additions & 10 deletions test/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const assert = require("assert"),

posthtml = require("posthtml"),
pseudo = require("../index"),

fixtures = require("./fixtures");

Expand All @@ -16,14 +15,5 @@ describe("/lib", () => {
assert.equal(result.html, fixtures.basic.expected);
})
);

// it("should run posthtml with pseudo", () =>
// posthtml()
// .use(pseudo())
// .process(fixtures.groups.all.input)
// .then((result) => {
// assert.equal(result.html, fixtures.groups.all.expected);
// })
// );
});
});
44 changes: 22 additions & 22 deletions test/fixtures/addClassNameToNode/emptyClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@

module.exports = {
input : {
tag: "a",
attrs: {
href: "#",
class: ""
tag : "a",
attrs : {
href : "#",
class : ""
},
content: [
content : [
"\n ",
{
tag: "span",
attrs: {
class: "animals__cat",
style: "background: url(cat.png)"
{
tag : "span",
attrs : {
class : "animals__cat",
style : "background: url(cat.png)"
},
content: ["Cat"]
content : ["Cat"]
},
"\n"
]
},
expected : {
tag: "a",
attrs: {
class: ":test",
href: "#"
tag : "a",
attrs : {
class : ":test",
href : "#"
},
content: [
content : [
"\n ",
{
tag: "span",
attrs: {
class: "animals__cat",
style: "background: url(cat.png)"
{
tag : "span",
attrs : {
class : "animals__cat",
style : "background: url(cat.png)"
},
content: ["Cat"]
content : ["Cat"]
},
"\n"
]
Expand Down
44 changes: 22 additions & 22 deletions test/fixtures/addClassNameToNode/endClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@

module.exports = {
input : {
tag: "a",
attrs: {
href: "#",
class: "something"
tag : "a",
attrs : {
href : "#",
class : "something"
},
content: [
content : [
"\n ",
{
tag: "span",
attrs: {
class: "animals__cat",
style: "background: url(cat.png)"
{
tag : "span",
attrs : {
class : "animals__cat",
style : "background: url(cat.png)"
},
content: ["Cat"]
content : ["Cat"]
},
"\n"
]
},
expected : {
tag: "a",
attrs: {
class: "something :test",
href: "#"
tag : "a",
attrs : {
class : "something :test",
href : "#"
},
content: [
content : [
"\n ",
{
tag: "span",
attrs: {
class: "animals__cat",
style: "background: url(cat.png)"
{
tag : "span",
attrs : {
class : "animals__cat",
style : "background: url(cat.png)"
},
content: ["Cat"]
content : ["Cat"]
},
"\n"
]
Expand Down
42 changes: 21 additions & 21 deletions test/fixtures/addClassNameToNode/noClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,38 @@

module.exports = {
input : {
tag: "a",
attrs: {
href: "#"
tag : "a",
attrs : {
href : "#"
},
content: [
content : [
"\n ",
{
tag: "span",
attrs: {
class: "animals__cat",
style: "background: url(cat.png)"
{
tag : "span",
attrs : {
class : "animals__cat",
style : "background: url(cat.png)"
},
content: ["Cat"]
content : ["Cat"]
},
"\n"
]
},
expected : {
tag: "a",
attrs: {
class: ":test",
href: "#"
tag : "a",
attrs : {
class : ":test",
href : "#"
},
content: [
content : [
"\n ",
{
tag: "span",
attrs: {
class: "animals__cat",
style: "background: url(cat.png)"
{
tag : "span",
attrs : {
class : "animals__cat",
style : "background: url(cat.png)"
},
content: ["Cat"]
content : ["Cat"]
},
"\n"
]
Expand Down
44 changes: 22 additions & 22 deletions test/fixtures/addClassNameToNode/sortClass1.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@

module.exports = {
input : {
tag: "a",
attrs: {
href: "#",
class: "something :first-child"
tag : "a",
attrs : {
href : "#",
class : "something :first-child"
},
content: [
content : [
"\n ",
{
tag: "span",
attrs: {
class: "animals__cat",
style: "background: url(cat.png)"
{
tag : "span",
attrs : {
class : "animals__cat",
style : "background: url(cat.png)"
},
content: ["Cat"]
content : ["Cat"]
},
"\n"
]
},
expected : {
tag: "a",
attrs: {
class: "something :first-child :first-of-type",
href: "#"
tag : "a",
attrs : {
class : "something :first-child :first-of-type",
href : "#"
},
content: [
content : [
"\n ",
{
tag: "span",
attrs: {
class: "animals__cat",
style: "background: url(cat.png)"
{
tag : "span",
attrs : {
class : "animals__cat",
style : "background: url(cat.png)"
},
content: ["Cat"]
content : ["Cat"]
},
"\n"
]
Expand Down
44 changes: 22 additions & 22 deletions test/fixtures/addClassNameToNode/sortClass2.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@

module.exports = {
input : {
tag: "a",
attrs: {
href: "#",
class: "something :first-of-type"
tag : "a",
attrs : {
href : "#",
class : "something :first-of-type"
},
content: [
content : [
"\n ",
{
tag: "span",
attrs: {
class: "animals__cat",
style: "background: url(cat.png)"
{
tag : "span",
attrs : {
class : "animals__cat",
style : "background: url(cat.png)"
},
content: ["Cat"]
content : ["Cat"]
},
"\n"
]
},
expected : {
tag: "a",
attrs: {
class: "something :first-child :first-of-type",
href: "#"
tag : "a",
attrs : {
class : "something :first-child :first-of-type",
href : "#"
},
content: [
content : [
"\n ",
{
tag: "span",
attrs: {
class: "animals__cat",
style: "background: url(cat.png)"
{
tag : "span",
attrs : {
class : "animals__cat",
style : "background: url(cat.png)"
},
content: ["Cat"]
content : ["Cat"]
},
"\n"
]
Expand Down
Loading

0 comments on commit 8857376

Please sign in to comment.